Skip to content

Commit

Permalink
reformat(core): Core reformatted (specklesystems#2416)
Browse files Browse the repository at this point in the history
* feat(formatting): Added vscode tasks for global formatting

* ensured escaped backslashes in slnf

* Core format

* reformat(core): reformatted core

* Full cleanup on Core + Tests + Integration + Examples

* fix(core): Fix Credential tests by null properlly implementing Equals comparison

We should not assume an object (or account) is non-null when checking equality.

* feat(core): Implemented account getHashCode and removed redundant code

* Revert "feat(core): Implemented account getHashCode and removed redundant code"

This reverts commit 9e4c65e.

* fix(core): Disable pragma warning for Equals override in Accounts.cs

* Attempt at fixing our CI on mac after the reformat (specklesystems#2420)

* feat: get-ci-tools will now try to mirror branches

* fix(ci): Build mac connectors with dotnet

* fix(ci): build-with-mono instead of build-with-msbuild

* fix(ci): Git ci-tools checkout fix

* fix(ci): Build with mono path fix

* fix(ci): SDK changes for avalonia to build rhino with dotnet targeting win

* fix(ci): new dotnet build for mac

* fix(ci): no build with mono param

* fix(ci): run slnf

* fix: do not use self-contained for connector mac build

* fix(ci): Env vars not being propagated... 🤦🏼‍♂️

* fix(ci): PEBKAC

* fix(ci): Install zip

* fix(ci): case sensitive name of installer

* fix(ci): Testing SDK build instead

* fix(ci): PEBKAC round 2002

* fix(ci): Do not wait for integration tests to build connectors, just wait for deploy

* fix(ci): Rename `build-core` to `build-sdk`

* fix(ci): 🤦🏼‍♂️ missing the parameter

* fix(ci): Name cannot be used as parameter name

* fix(ci): pebkac yet again

* fix(ci): this is it!

* fix(ci): use net6.0 image

* fix(ci): rollback to use net6 in tests

---------

Co-authored-by: Alan Rynne <[email protected]>
  • Loading branch information
JR-Morgan and AlanRynne authored Apr 13, 2023
1 parent 03bdd19 commit 064064a
Show file tree
Hide file tree
Showing 118 changed files with 15,058 additions and 14,301 deletions.
2 changes: 1 addition & 1 deletion .circleci/scripts/common-jobs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
core:
- test-core:
requires:
- build-core
- build-sdk
10 changes: 5 additions & 5 deletions .circleci/scripts/config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ def createConfigFile(deploy: bool, outputPath: str, external_build: bool):
if "requires" not in jobAttrs.keys():
jobAttrs["requires"] = []
# Require objects to build for all connectors
jobAttrs["requires"] += ["build-objects"]
if build_core:
# Require core tests too if core needs rebuilding.
jobAttrs["requires"] += ["test-core"]
jobAttrs["requires"] += ["build-sdk"]

# Add name to all jobs
name = f"{slug}-build"
if "name" not in jobAttrs.keys():
Expand All @@ -148,7 +146,9 @@ def createConfigFile(deploy: bool, outputPath: str, external_build: bool):

# Append connector jobs to main workflow jobs
main_workflow["jobs"] += connector_jobs[connector]

if build_core:
# Require core tests too if core needs rebuilding.
jobs_before_deploy.append("test-core")
# Modify jobs for deployment
if deploy:
deploy_job = {}
Expand Down
307 changes: 162 additions & 145 deletions .circleci/scripts/config-template.yml

Large diffs are not rendered by default.

41 changes: 3 additions & 38 deletions .circleci/scripts/connector-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,33 @@ rhino:
slnname: ConnectorRhino
dllname: SpeckleConnectorRhino.rhp
slug: rhino
requires:
- build-desktopui
context: innosetup
- build-connector:
slnname: ConnectorRhino
dllname: SpeckleConnectorRhino.rhp
slug: grasshopper
requires:
- build-desktopui
context: innosetup
- build-connector-mac:
- build-connector-dotnet-mac:
name: rhino-build-mac
slnname: ConnectorRhino
projname: ConnectorRhino7
installername: SpeckleRhinoInstall
build-config: Release Mac
slug: rhino
requires:
- build-desktopui
converter-files: "
Objects/Converters/ConverterRhinoGh/ConverterRhino7/bin/Release/net48/Objects.dll
Objects/Converters/ConverterRhinoGh/ConverterRhino7/bin/Release/net48/Objects.Converter.Rhino7.dll
Objects/Converters/ConverterRhinoGh/ConverterRhino6/bin/Release/netstandard2.0/Objects.Converter.Rhino6.dll
Objects/Converters/ConverterRhinoGh/ConverterGrasshopper7/bin/Release/net48/Objects.Converter.Grasshopper7.dll
Objects/Converters/ConverterRhinoGh/ConverterGrasshopper6/bin/Release/netstandard2.0/Objects.Converter.Grasshopper6.dll
"
- build-connector-mac:
- build-connector-dotnet-mac:
name: grasshopper-build-mac
slnname: ConnectorRhino
projname: ConnectorRhino7
build-config: Release Mac
installername: SpeckleGhInstall
installer: true
installername: SpeckleGHInstall
slug: grasshopper
requires:
- build-desktopui
converter-files: "
Objects/Converters/ConverterRhinoGh/ConverterRhino7/bin/Release/net48/Objects.dll
Objects/Converters/ConverterRhinoGh/ConverterRhino7/bin/Release/net48/Objects.Converter.Rhino7.dll
Expand All @@ -63,47 +54,35 @@ revit:
slnname: ConnectorRevit
dllname: SpeckleConnectorRevit.dll
slug: revit
requires:
- build-desktopui
context: innosetup

autocadcivil:
- build-connector:
slnname: ConnectorAutocadCivil
dllname: SpeckleConnectorAutocad.dll
slug: autocad
requires:
- build-desktopui
context: innosetup
- build-connector:
slnname: ConnectorAutocadCivil
dllname: SpeckleConnectorAutocad.dll
slug: civil3d
requires:
- build-desktopui
context: innosetup

bentley:
- build-connector:
slnname: ConnectorBentley
dllname: SpeckleConnectorMicroStation.dll
slug: microstation
requires:
- build-desktopui
context: innosetup
- build-connector:
slnname: ConnectorBentley
dllname: SpeckleConnectorOpenBuildings.dll
slug: openbuildings
requires:
- build-desktopui
context: innosetup
- build-connector:
slnname: ConnectorBentley
dllname: SpeckleConnectorOpenRail.dll
slug: openrail
requires:
- build-desktopui
context: innosetup
- build-connector:
slnname: ConnectorBentley
Expand All @@ -116,37 +95,27 @@ teklastructures:
slnname: ConnectorTeklaStructures
dllname: SpeckleConnectorTeklaStructures.dll
slug: teklastructures
requires:
- build-desktopui
context: innosetup
csi:
- build-connector:
slnname: ConnectorCSI
dllname: SpeckleConnectorCSI.dll
slug: etabs
requires:
- build-desktopui
context: innosetup
- build-connector:
slnname: ConnectorCSI
dllname: SpeckleConnectorCSI.dll
slug: sap2000
requires:
- build-desktopui
context: innosetup
- build-connector:
slnname: ConnectorCSI
dllname: SpeckleConnectorCSI.dll
slug: safe
requires:
- build-desktopui
context: innosetup
- build-connector:
slnname: ConnectorCSI
dllname: SpeckleConnectorCSI.dll
slug: csibridge
requires:
- build-desktopui
context: innosetup

archicad:
Expand All @@ -166,7 +135,6 @@ archicad:
requires:
- build-archicad-add-on-25
- build-archicad-add-on-26
- build-desktopui
slnname: ConnectorArchicad
projname: ConnectorArchicad
dllname: ConnectorArchicad.dll
Expand All @@ -192,7 +160,6 @@ archicad:
requires:
- build-archicad-add-on-25-mac
- build-archicad-add-on-26-mac
- build-desktopui
slnname: ConnectorArchicad
projname: ConnectorArchicad
slug: archicad
Expand All @@ -204,6 +171,4 @@ navisworks:
slnname: ConnectorNavisworks
dllname: SpeckleConnectorNavisworks.dll
slug: navisworks
requires:
- build-desktopui
context: innosetup
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"commands": [
"jb"
]
},
"csharpier": {
"version": "0.23.0",
"commands": [
"dotnet-csharpier"
]
}
}
}
7 changes: 7 additions & 0 deletions .csharpierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
printWidth: 120
useTabs: false
tabWidth: 2
preprocessorSymbolSets:
- ""
- "DEBUG"
- "DEBUG,CODE_STYLE"
8 changes: 5 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ resharper_csharp_align_multiline_parameter = false
resharper_csharp_int_align_comments = false
resharper_csharp_outdent_commas = true
resharper_csharp_outdent_dots = false
resharper_csharp_wrap_after_declaration_lpar = false
resharper_csharp_wrap_after_declaration_lpar = true
resharper_csharp_wrap_after_invocation_lpar = true
resharper_csharp_wrap_arguments_style = chop_if_long
resharper_csharp_wrap_before_declaration_rpar = true
resharper_csharp_wrap_before_invocation_rpar = false
resharper_csharp_wrap_extends_list_style = chop_if_long
resharper_csharp_wrap_parameters_style = chop_if_long
Expand All @@ -49,7 +50,7 @@ resharper_keep_existing_declaration_block_arrangement = true
resharper_keep_existing_declaration_parens_arrangement = false
resharper_keep_existing_embedded_block_arrangement = true
resharper_keep_existing_enum_arrangement = true
resharper_keep_existing_expr_member_arrangement = false
resharper_keep_existing_expr_member_arrangement = true
resharper_keep_existing_initializer_arrangement = false
resharper_local_function_body = expression_body
resharper_max_attribute_length_for_same_line = 20
Expand All @@ -59,7 +60,7 @@ resharper_max_invocation_arguments_on_line = 5
resharper_outdent_binary_ops = true
resharper_outdent_dots = false
resharper_place_constructor_initializer_on_same_line = false
resharper_place_simple_initializer_on_single_line = false
resharper_place_simple_initializer_on_single_line = true
resharper_prefer_explicit_discard_declaration = false
resharper_wrap_after_declaration_lpar = false
resharper_wrap_before_invocation_rpar = false
Expand Down Expand Up @@ -181,6 +182,7 @@ csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true

# Analyzer settings
dotnet_diagnostic.ide0055.severity = none

# Maintainability rules
dotnet_diagnostic.ca1501.severity = warning
Expand Down
100 changes: 100 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"inputs": [
{
"type": "promptString",
"id": "projectPath",
"description": "The path to the csproj, sln or slnf you want formatting",
"default": "./All.sln"
}
],
"tasks": [
{
"label": "speckle.format.csharpier",
"command": "dotnet",
"type": "shell",
"args": ["csharpier", "${input:projectPath}/.."],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile",
"hide": true
},
{
"label": "speckle.format.style",
"command": "dotnet",
"type": "shell",
"args": ["format", "style", "${input:projectPath}"],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile",
"hide": true
},
{
"label": "speckle.format.whitespace",
"command": "dotnet",
"type": "shell",
"args": ["format", "whitespace", "${input:projectPath}"],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile",
"hide": true
},
{
"label": "speckle.format.analyzers",
"command": "dotnet",
"type": "shell",
"args": ["format", "analyzers", "${input:projectPath}"],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile",
"hide": true
},
{
"label": "speckle.format.resharper",
"command": "dotnet",
"type": "shell",
"args": [
"tool",
"run",
"jb",
"cleanupcode",
"${input:projectPath}",
"--profile=\"Speckle:\\sCustom\\sCleanup\"",
"--settings=\"All.sln.DotSettings\"",
],
"group": "build",
"problemMatcher": "$msCompile",
"hide": false
},
{
"label": "Speckle: Format Code",
"dependsOn": [
"speckle.format.whitespace",
"speckle.format.style",
"speckle.format.csharpier",
],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "Speckle: Cleanup Code",
"dependsOn": [
"Speckle: Format Code",
"speckle.format.analyzers",
"speckle.format.resharper",
],
"dependsOrder": "sequence",
"problemMatcher": []
}
]
}
Loading

0 comments on commit 064064a

Please sign in to comment.