diff --git a/.circleci/scripts/config-template.yml b/.circleci/scripts/config-template.yml index 061fa2ef5e..f3bd874b86 100644 --- a/.circleci/scripts/config-template.yml +++ b/.circleci/scripts/config-template.yml @@ -18,9 +18,6 @@ workflows: - build-sdk: requires: - get-ci-tools - build-dui3: - jobs: - - build-dui3-job nuget: jobs: - build-sdk: @@ -75,25 +72,6 @@ commands: --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover jobs: # Each project will have individual jobs for each specific task it has to execute (build, release...) - build-dui3-job: - executor: - name: win/default - shell: powershell.exe - steps: - - checkout - - run: - name: Enforce formatting - command: | - dotnet tool restore - dotnet csharpier --check . - - run: - name: Dotnet Restore - command: | - dotnet restore DUI3-DX.slnf - - run: - name: Build DUI3 Solution filter - command: | - msbuild DUI3-DX.slnf /p:Configuration=Release /p:IsDesktopBuild=false build-sdk: docker: - image: cimg/base:2021.01 diff --git a/.circleci/scripts/parameters.json b/.circleci/scripts/parameters.json index 3530ba7244..f5529641b7 100644 --- a/.circleci/scripts/parameters.json +++ b/.circleci/scripts/parameters.json @@ -1,12 +1,12 @@ { - "core": true, - "rhino": true, - "revit": true, - "dynamo": true, - "csi": true, - "autocadcivil": true, - "bentley": true, - "archicad": true, - "teklastructures": true, - "navisworks": true -} + "core": true, + "rhino": true, + "revit": true, + "dynamo": true, + "csi": true, + "autocadcivil": true, + "bentley": true, + "archicad": true, + "teklastructures": true, + "navisworks": true + } \ No newline at end of file diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3b0ca23774..47a1501435 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -4,27 +4,19 @@ "tools": { "dotnet-t4": { "version": "2.2.1", - "commands": [ - "t4" - ] - }, - "jetbrains.resharper.globaltools": { - "version": "2023.1.0", - "commands": [ - "jb" - ] + "commands": ["t4"] }, "csharpier": { "version": "0.23.0", - "commands": [ - "dotnet-csharpier" - ] + "commands": ["dotnet-csharpier"] }, "husky": { "version": "0.5.4", - "commands": [ - "husky" - ] + "commands": ["husky"] + }, + "gitversion.tool": { + "version": "5.12.0", + "commands": ["dotnet-gitversion"] } } -} \ No newline at end of file +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..3413224bf0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" # search for actions - there are other options available + directory: "/" # search in .github/workflows under root `/` + schedule: + interval: "weekly" # check for action update every week \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..d8ac5bfcdf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: .NET Build + +on: + pull_request: # Run build on every pull request that is not to main/dev + branches-ignore: + - main + - dev + workflow_call: + outputs: + version: + value: ${{ jobs.build.outputs.version }} + +jobs: + build: + runs-on: windows-latest + outputs: + version: ${{ steps.set-version.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 7.x.x + + - name: ⚒️ Run build + run: ./build.ps1 + + - name: ⬆️ Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: output-${{ env.GitVersion_AssemblySemFileVer }} + path: output/*.* + compression-level: 0 # no compression + + - id: set-version + name: Set version to output + run: echo "version=${{env.GitVersion_FullSemVer}}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..871f58e657 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +name: .NET Build and Publish + +on: + push: + branches: ["main", "dev", "dui3/alpha"] # Continuous delivery on every long-lived branch + tags: ["3.*"] # Manual delivery on every 3.x tag + pull_request: + branches: ["main", "dev"] # Releases on every PR that targets main or dev + +jobs: + build: + uses: ./.github/workflows/ci.yml + + deploy-installers: + runs-on: ubuntu-latest + needs: build + steps: + - name: 🔫 Trigger Build Installers + uses: ALEEF02/workflow-dispatch@v3.0.0 + with: + workflow: Build Installers + repo: specklesystems/connector-installers + token: ${{ secrets.CONNECTORS_GH_TOKEN }} + inputs: '{ "run_id": "${{ github.run_id }}", "version": "${{ needs.build.outputs.version }}" }' + ref: main + wait-for-completion: true + wait-for-completion-interval: 10s + wait-for-completion-timeout: 10m + display-workflow-run-url: true + display-workflow-run-url-interval: 10s + workflow-logs: true + run-name: "Deploying from: ${{ github.ref_name }}" diff --git a/.gitignore b/.gitignore index 1775cb1c7d..f7b3cd5d9a 100644 --- a/.gitignore +++ b/.gitignore @@ -382,3 +382,5 @@ ConnectorArchicad/AddOn/Build* **/yarn.lock + +output/ diff --git a/All.sln b/All.sln index 10b475678a..ab1b3af2c6 100644 --- a/All.sln +++ b/All.sln @@ -524,9 +524,20 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.AutocadS EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023", "DUI3-DX\Converters\Autocad\Speckle.Converters.Autocad2023\Speckle.Converters.Autocad2023.csproj", "{631C295A-7CCF-4B42-8686-7034E31469E7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Autocad2023.DependencyInjection", "DUI3-DX\Converters\Autocad\Speckle.Converters.Autocad2023.DependencyInjection\Speckle.Converters.Autocad2023.DependencyInjection.csproj", "{D940853C-003A-482C-BDB0-665367F274A0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023.DependencyInjection", "DUI3-DX\Converters\Autocad\Speckle.Converters.Autocad2023.DependencyInjection\Speckle.Converters.Autocad2023.DependencyInjection.csproj", "{D940853C-003A-482C-BDB0-665367F274A0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.DUI.WebView", "DUI3-DX\DUI3\Speckle.Connectors.DUI.WebView\Speckle.Connectors.DUI.WebView.csproj", "{7420652C-3046-4F38-BE64-9B9E69D76FA2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.DUI.WebView", "DUI3-DX\DUI3\Speckle.Connectors.DUI.WebView\Speckle.Connectors.DUI.WebView.csproj", "{7420652C-3046-4F38-BE64-9B9E69D76FA2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{326ECEE0-D009-4A65-B24C-00FA343D8B99}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build", "Build\Build.csproj", "{3973D572-5E24-476F-B058-8022D826B793}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{2AB6B848-E8F6-4BB7-AE8F-9913C74C893F}" + ProjectSection(SolutionItems) = preProject + .github\workflows\ci.yml = .github\workflows\ci.yml + .github\workflows\main.yml = .github\workflows\main.yml + .github\workflows\test.yml = .github\workflows\test.yml + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RevitSharedResources2025", "ConnectorRevit\RevitSharedResources2025\RevitSharedResources2025.csproj", "{7B02BACC-D9B6-4FFE-A450-7ECB5F71F209}" EndProject @@ -2478,8 +2489,8 @@ Global {01F98733-7352-47AD-A594-537D979DE3DE}.Debug Mac|x64.Build.0 = Debug|Any CPU {01F98733-7352-47AD-A594-537D979DE3DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {01F98733-7352-47AD-A594-537D979DE3DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {01F98733-7352-47AD-A594-537D979DE3DE}.Debug|x64.ActiveCfg = Debug|x64 - {01F98733-7352-47AD-A594-537D979DE3DE}.Debug|x64.Build.0 = Debug|x64 + {01F98733-7352-47AD-A594-537D979DE3DE}.Debug|x64.ActiveCfg = Debug|Any CPU + {01F98733-7352-47AD-A594-537D979DE3DE}.Debug|x64.Build.0 = Debug|Any CPU {01F98733-7352-47AD-A594-537D979DE3DE}.Release Mac|Any CPU.ActiveCfg = Release|Any CPU {01F98733-7352-47AD-A594-537D979DE3DE}.Release Mac|Any CPU.Build.0 = Release|Any CPU {01F98733-7352-47AD-A594-537D979DE3DE}.Release Mac|x64.ActiveCfg = Release|Any CPU @@ -2494,8 +2505,8 @@ Global {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug Mac|x64.Build.0 = Debug|Any CPU {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug|x64.ActiveCfg = Debug|x64 - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug|x64.Build.0 = Debug|x64 + {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug|x64.ActiveCfg = Debug|Any CPU + {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug|x64.Build.0 = Debug|Any CPU {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Release Mac|Any CPU.ActiveCfg = Release|Any CPU {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Release Mac|Any CPU.Build.0 = Release|Any CPU {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Release Mac|x64.ActiveCfg = Release|Any CPU @@ -2510,8 +2521,8 @@ Global {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug Mac|x64.Build.0 = Debug|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug|x64.ActiveCfg = Debug|x64 - {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug|x64.Build.0 = Debug|x64 + {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug|x64.ActiveCfg = Debug|Any CPU + {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug|x64.Build.0 = Debug|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Release Mac|Any CPU.ActiveCfg = Release|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Release Mac|Any CPU.Build.0 = Release|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Release Mac|x64.ActiveCfg = Release|Any CPU @@ -2526,8 +2537,8 @@ Global {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Debug Mac|x64.Build.0 = Debug|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Debug|x64.ActiveCfg = Debug|x64 - {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Debug|x64.Build.0 = Debug|x64 + {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Debug|x64.ActiveCfg = Debug|Any CPU + {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Debug|x64.Build.0 = Debug|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Release Mac|Any CPU.ActiveCfg = Release|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Release Mac|Any CPU.Build.0 = Release|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Release Mac|x64.ActiveCfg = Release|Any CPU @@ -2542,8 +2553,8 @@ Global {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug Mac|x64.Build.0 = Debug|Any CPU {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug|x64.ActiveCfg = Debug|x64 - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug|x64.Build.0 = Debug|x64 + {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug|x64.ActiveCfg = Debug|Any CPU + {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug|x64.Build.0 = Debug|Any CPU {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Release Mac|Any CPU.ActiveCfg = Release|Any CPU {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Release Mac|Any CPU.Build.0 = Release|Any CPU {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Release Mac|x64.ActiveCfg = Release|Any CPU @@ -2558,8 +2569,8 @@ Global {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug Mac|x64.Build.0 = Debug|Any CPU {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug|x64.ActiveCfg = Debug|x64 - {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug|x64.Build.0 = Debug|x64 + {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug|x64.ActiveCfg = Debug|Any CPU + {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug|x64.Build.0 = Debug|Any CPU {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Release Mac|Any CPU.ActiveCfg = Release|Any CPU {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Release Mac|Any CPU.Build.0 = Release|Any CPU {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Release Mac|x64.ActiveCfg = Release|Any CPU @@ -2574,8 +2585,8 @@ Global {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Debug Mac|x64.Build.0 = Debug|Any CPU {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Debug|x64.ActiveCfg = Debug|x64 - {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Debug|x64.Build.0 = Debug|x64 + {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Debug|x64.ActiveCfg = Debug|Any CPU + {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Debug|x64.Build.0 = Debug|Any CPU {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Release Mac|Any CPU.ActiveCfg = Release|Any CPU {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Release Mac|Any CPU.Build.0 = Release|Any CPU {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Release Mac|x64.ActiveCfg = Release|Any CPU @@ -2632,22 +2643,6 @@ Global {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Release|Any CPU.Build.0 = Release|Any CPU {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Release|x64.ActiveCfg = Release|Any CPU {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Release|x64.Build.0 = Release|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug Mac|x64.ActiveCfg = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug Mac|x64.Build.0 = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|x64.ActiveCfg = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|x64.Build.0 = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release Mac|Any CPU.ActiveCfg = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release Mac|Any CPU.Build.0 = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release Mac|x64.ActiveCfg = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release Mac|x64.Build.0 = Debug|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|Any CPU.Build.0 = Release|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|x64.ActiveCfg = Release|Any CPU - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|x64.Build.0 = Release|Any CPU {A97F7177-86C7-4B38-A6ED-DA51BF762471}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU {A97F7177-86C7-4B38-A6ED-DA51BF762471}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU {A97F7177-86C7-4B38-A6ED-DA51BF762471}.Debug Mac|x64.ActiveCfg = Debug|Any CPU @@ -2696,6 +2691,22 @@ Global {7DFF1591-237D-499E-A767-EE37B93FB958}.Release|Any CPU.Build.0 = Release|Any CPU {7DFF1591-237D-499E-A767-EE37B93FB958}.Release|x64.ActiveCfg = Release|Any CPU {7DFF1591-237D-499E-A767-EE37B93FB958}.Release|x64.Build.0 = Release|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug Mac|x64.ActiveCfg = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug Mac|x64.Build.0 = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|x64.ActiveCfg = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|x64.Build.0 = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release Mac|Any CPU.ActiveCfg = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release Mac|Any CPU.Build.0 = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release Mac|x64.ActiveCfg = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release Mac|x64.Build.0 = Debug|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|Any CPU.Build.0 = Release|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|x64.ActiveCfg = Release|Any CPU + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|x64.Build.0 = Release|Any CPU {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Debug Mac|x64.ActiveCfg = Debug|Any CPU @@ -2760,6 +2771,22 @@ Global {7420652C-3046-4F38-BE64-9B9E69D76FA2}.Release|Any CPU.Build.0 = Release|Any CPU {7420652C-3046-4F38-BE64-9B9E69D76FA2}.Release|x64.ActiveCfg = Release|Any CPU {7420652C-3046-4F38-BE64-9B9E69D76FA2}.Release|x64.Build.0 = Release|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Debug Mac|x64.ActiveCfg = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Debug Mac|x64.Build.0 = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Debug|x64.ActiveCfg = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Debug|x64.Build.0 = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Release Mac|Any CPU.ActiveCfg = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Release Mac|Any CPU.Build.0 = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Release Mac|x64.ActiveCfg = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Release Mac|x64.Build.0 = Debug|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Release|Any CPU.Build.0 = Release|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Release|x64.ActiveCfg = Release|Any CPU + {3973D572-5E24-476F-B058-8022D826B793}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2956,20 +2983,21 @@ Global {34C2C062-E43F-4FB5-B839-64BC044CCEF3} = {1FE3C60E-7865-40A5-9794-55ECB64F6489} {65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5} = {34C2C062-E43F-4FB5-B839-64BC044CCEF3} {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D} = {34C2C062-E43F-4FB5-B839-64BC044CCEF3} - {743489BF-1941-43D5-8AF9-35C56D0DCC34} = {33D19E88-F3AE-4D28-B588-D91CCF9E3BA8} - {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395} = {743489BF-1941-43D5-8AF9-35C56D0DCC34} - {41BC679F-887F-44CF-971D-A5502EE87DB0} = {743489BF-1941-43D5-8AF9-35C56D0DCC34} {A97F7177-86C7-4B38-A6ED-DA51BF762471} = {CE4B899D-9C0A-4B5D-B91A-CE62D2327695} {CE4B899D-9C0A-4B5D-B91A-CE62D2327695} = {33D19E88-F3AE-4D28-B588-D91CCF9E3BA8} {139F7A79-69E4-4B8A-B2A5-6A30A66C495C} = {CCF48B65-33D1-4E8B-A57B-E03394730B21} {7DFF1591-237D-499E-A767-EE37B93FB958} = {CCF48B65-33D1-4E8B-A57B-E03394730B21} {CCF48B65-33D1-4E8B-A57B-E03394730B21} = {1FE3C60E-7865-40A5-9794-55ECB64F6489} + {743489BF-1941-43D5-8AF9-35C56D0DCC34} = {33D19E88-F3AE-4D28-B588-D91CCF9E3BA8} + {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395} = {743489BF-1941-43D5-8AF9-35C56D0DCC34} + {41BC679F-887F-44CF-971D-A5502EE87DB0} = {743489BF-1941-43D5-8AF9-35C56D0DCC34} {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {804E065F-914C-414A-AF84-009312C3CFF6} = {1FE3C60E-7865-40A5-9794-55ECB64F6489} {9ADD1B7A-6401-4202-8613-F668E2FBC0A4} = {804E065F-914C-414A-AF84-009312C3CFF6} {631C295A-7CCF-4B42-8686-7034E31469E7} = {804E065F-914C-414A-AF84-009312C3CFF6} {D940853C-003A-482C-BDB0-665367F274A0} = {804E065F-914C-414A-AF84-009312C3CFF6} {7420652C-3046-4F38-BE64-9B9E69D76FA2} = {FD4D6594-D81E-456F-8F2E-35B09E04A755} + {3973D572-5E24-476F-B058-8022D826B793} = {326ECEE0-D009-4A65-B24C-00FA343D8B99} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {1D43D91B-4F01-4A78-8250-CC6F9BD93A14} diff --git a/Build/Build.csproj b/Build/Build.csproj new file mode 100644 index 0000000000..74408729a7 --- /dev/null +++ b/Build/Build.csproj @@ -0,0 +1,13 @@ + + + + Exe + net7.0 + enable + + + + + + + diff --git a/Build/Consts.cs b/Build/Consts.cs new file mode 100644 index 0000000000..d8921e234f --- /dev/null +++ b/Build/Consts.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic; + +namespace Build; + +public static class Consts +{ + public static readonly string[] Solutions = { "DUI3-DX.slnf" }; + + public static InstallerProject[] InstallerManifests = + { + new( + "arcgis", + new InstallerAsset[] { new("DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3", "net6.0-windows") } + ), + new("rhino", new InstallerAsset[] { new("DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7", "net48") }), + new("revit", new InstallerAsset[] { new("DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023", "net48") }), + new("autocad", new InstallerAsset[] { new("DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023", "net48") }) + }; +} + +public readonly struct InstallerProject +{ + public string HostAppSlug { get; init; } + public IReadOnlyList Projects { get; init; } + + public InstallerProject(string hostAppSlug, IReadOnlyList projects) + { + HostAppSlug = hostAppSlug; + Projects = projects; + } + + public override string ToString() => $"{HostAppSlug}"; +} + +public readonly struct InstallerAsset +{ + public InstallerAsset(string projectPath, string targetName) + { + ProjectPath = projectPath; + TargetName = targetName; + } + + public string ProjectPath { get; init; } + public string TargetName { get; init; } +} diff --git a/Build/Github.cs b/Build/Github.cs new file mode 100644 index 0000000000..5d3267937e --- /dev/null +++ b/Build/Github.cs @@ -0,0 +1,42 @@ +using System; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Mime; +using System.Text.Json; +using System.Threading.Tasks; + +namespace Build; + +public static class Github +{ + public static async Task BuildInstallers(string token, string runId, string version) + { + using var client = new HttpClient(); + var payload = new { event_type = "build-installers", client_payload = new { run_id = runId, version } }; + var content = new StringContent( + JsonSerializer.Serialize(payload), + new MediaTypeHeaderValue(MediaTypeNames.Application.Json) + ); + + var request = new HttpRequestMessage() + { + Method = HttpMethod.Post, + RequestUri = new Uri("https://api.github.com/repos/specklesystems/connector-installers/dispatches"), + Headers = + { + Accept = { new MediaTypeWithQualityHeaderValue("application/vnd.github+json") }, + Authorization = new AuthenticationHeaderValue("Bearer", token), + UserAgent = { new ProductInfoHeaderValue("Speckle.build", "3.0.0") } + }, + Content = content + }; + request.Headers.Add("X-GitHub-Api-Version", "2022-11-28"); + var response = await client.SendAsync(request).ConfigureAwait(false); + if (!response.IsSuccessStatusCode) + { + throw new InvalidOperationException( + $"{response.StatusCode} {response.ReasonPhrase} {await response.Content.ReadAsStringAsync().ConfigureAwait(false)}" + ); + } + } +} diff --git a/Build/Program.cs b/Build/Program.cs new file mode 100644 index 0000000000..10bc82322c --- /dev/null +++ b/Build/Program.cs @@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Linq; +using Build; +using GlobExpressions; +using static Bullseye.Targets; +using static SimpleExec.Command; + +const string CLEAN = "clean"; +const string RESTORE = "restore"; +const string BUILD = "build"; +const string TEST = "test"; +const string FORMAT = "format"; +const string ZIP = "zip"; +const string VERSION = "version"; +const string RESTORE_TOOLS = "restore-tools"; +const string BUILD_SERVER_VERSION = "build-server-version"; + +var arguments = new List(); +if (args.Length > 1) +{ + arguments = args.ToList(); + args = new[] { arguments.First() }; + arguments = arguments.Skip(1).ToList(); +} + +Target( + CLEAN, + ForEach("**/output"), + dir => + { + IEnumerable GetDirectories(string d) + { + return Glob.Directories(".", d); + } + + void RemoveDirectory(string d) + { + if (Directory.Exists(d)) + { + Console.WriteLine(d); + Directory.Delete(d, true); + } + } + + foreach (var d in GetDirectories(dir)) + { + RemoveDirectory(d); + } + } +); + +Target( + VERSION, + async () => + { + var (output, _) = await ReadAsync("dotnet", "minver -v w").ConfigureAwait(false); + output = output.Trim(); + Console.WriteLine($"Version: {output}"); + Run("echo", $"\"version={output}\" >> $GITHUB_OUTPUT"); + } +); + +Target( + RESTORE_TOOLS, + () => + { + Run("dotnet", "tool restore"); + } +); + +Target( + FORMAT, + DependsOn(RESTORE_TOOLS), + () => + { + Run("dotnet", "csharpier --check ."); + } +); + +Target( + RESTORE, + Consts.Solutions, + s => + { + Run("dotnet", $"restore {s}"); + } +); + +Target( + BUILD_SERVER_VERSION, + DependsOn(RESTORE_TOOLS), + () => + { + Run("dotnet", "tool run dotnet-gitversion /output json /output buildserver"); + } +); + +Target( + BUILD, + DependsOn(RESTORE, BUILD_SERVER_VERSION), + Consts.Solutions, + s => + { + var version = Environment.GetEnvironmentVariable("GitVersion_FullSemVer") ?? "3.0.0-localBuild"; + var fileVersion = Environment.GetEnvironmentVariable("GitVersion_AssemblySemFileVer") ?? "3.0.0.0"; + Console.WriteLine($"Version: {version} & {fileVersion}"); + Run( + "dotnet", + $"build {s} -c Release --no-restore -p:IsDesktopBuild=false -p:Version={version} -p:FileVersion={fileVersion} -v:m" + ); + } +); + +Target( + TEST, + DependsOn(BUILD), + () => + { + IEnumerable GetFiles(string d) + { + return Glob.Files(".", d); + } + + foreach (var file in GetFiles("**/*.Test.csproj")) + { + Run("dotnet", $"test {file} -c Release --no-restore --verbosity=normal"); + } + } +); + +Target( + ZIP, + DependsOn(TEST), + Consts.InstallerManifests, + x => + { + var outputDir = Path.Combine(".", "output"); + var slugDir = Path.Combine(outputDir, x.HostAppSlug); + + Directory.CreateDirectory(outputDir); + Directory.CreateDirectory(slugDir); + + foreach (var asset in x.Projects) + { + var fullPath = Path.Combine(".", asset.ProjectPath, "bin", "Release", asset.TargetName); + if (!Directory.Exists(fullPath)) + { + throw new InvalidOperationException("Could not find: " + fullPath); + } + + var assetName = Path.GetFileName(asset.ProjectPath); + var connectorDir = Path.Combine(slugDir, assetName); + + Directory.CreateDirectory(connectorDir); + foreach (var directory in Directory.EnumerateDirectories(fullPath, "*", SearchOption.AllDirectories)) + { + Directory.CreateDirectory(directory.Replace(fullPath, connectorDir)); + } + + foreach (var file in Directory.EnumerateFiles(fullPath, "*", SearchOption.AllDirectories)) + { + Console.WriteLine(file); + File.Copy(file, file.Replace(fullPath, connectorDir), true); + } + } + + var outputPath = Path.Combine(outputDir, $"{x.HostAppSlug}.zip"); + File.Delete(outputPath); + Console.WriteLine($"Zipping: '{slugDir}' to '{outputPath}'"); + ZipFile.CreateFromDirectory(slugDir, outputPath); + // Directory.Delete(slugDir, true); + } +); + +Target("default", DependsOn(FORMAT, ZIP), () => Console.WriteLine("Done!")); + +await RunTargetsAndExitAsync(args).ConfigureAwait(true); diff --git a/Core/Tests/Speckle.Core.Tests.Performance/Speckle.Core.Tests.Performance.csproj b/Core/Tests/Speckle.Core.Tests.Performance/Speckle.Core.Tests.Performance.csproj index 8b53d9d4a8..625d087f71 100644 --- a/Core/Tests/Speckle.Core.Tests.Performance/Speckle.Core.Tests.Performance.csproj +++ b/Core/Tests/Speckle.Core.Tests.Performance/Speckle.Core.Tests.Performance.csproj @@ -1,7 +1,7 @@ - net481 + net48 enable disable exe @@ -13,7 +13,7 @@ - + diff --git a/DUI3-DX.slnf b/DUI3-DX.slnf index c8a3bf311c..bd01603c29 100644 --- a/DUI3-DX.slnf +++ b/DUI3-DX.slnf @@ -2,6 +2,7 @@ "solution": { "path": "All.sln", "projects": [ + "Build\\Build.csproj", "Core\\Core\\Core.csproj", "Core\\Tests\\Speckle.Core.Tests.Integration\\Speckle.Core.Tests.Integration.csproj", "Core\\Tests\\Speckle.Core.Tests.Performance\\Speckle.Core.Tests.Performance.csproj", diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Esri.ArcGISPro.Extensions30.Speckle.targets b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Esri.ArcGISPro.Extensions30.Speckle.targets new file mode 100644 index 0000000000..a25abf1d91 --- /dev/null +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Esri.ArcGISPro.Extensions30.Speckle.targets @@ -0,0 +1,352 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (); + System.Uri relativeTo = new Uri(this.RelativeTo); + foreach (var i in Paths) { + try { + System.Uri itemFullPath = new Uri(i.GetMetadata("FullPath")); + var relativeUri = relativeTo.MakeRelativeUri(itemFullPath); + + result.Add(new TaskItem(Uri.UnescapeDataString(relativeUri.ToString()))); + } + catch { + return false; + } + } + RelativePaths = result.ToArray(); + foreach (var i in RelativePaths) + { + Log.LogMessage(MessageImportance.Low, "RelativePaths: " + i.ToString()); + } + return true; + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + Addin + + + $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro', 'InstallDir', null, RegistryView.Registry64)) + $(registry:HKEY_CURRENT_USER\SOFTWARE\ESRI\ArcGISPro@InstallDir) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj index 2f19e002e1..0dc50a19aa 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj @@ -7,6 +7,7 @@ win-x64 Speckle.Connectors.ArcGIS true + false true @@ -19,7 +20,8 @@ - + @@ -31,4 +33,6 @@ + + \ No newline at end of file diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj index 40658970e5..4ef5a65342 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj @@ -7,6 +7,7 @@ Program $(ProgramW6432)\Autodesk\AutoCAD 2023\acad.exe + diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle - Backup.Connectors.Revit2023.csproj b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle - Backup.Connectors.Revit2023.csproj deleted file mode 100644 index 994dbd662d..0000000000 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle - Backup.Connectors.Revit2023.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - net48 - x64 - win-x64 - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj index 9927081c9c..a24cfec381 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj @@ -1,4 +1,4 @@ - + net48 x64 diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj index eddc6f5826..cf48f27e61 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj @@ -4,6 +4,7 @@ .rhp true true + true @@ -14,6 +15,7 @@ + diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj index 596f00af45..3b07dc8f64 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj @@ -3,14 +3,17 @@ net6.0-windows x64 + true - + - - - - - + + + + + \ No newline at end of file diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj index 04d9915261..c115e62f88 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj +++ b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj @@ -1,7 +1,7 @@ - net47 + net48 x64 diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj index 895443e448..60d55503f4 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj +++ b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj @@ -1,7 +1,7 @@  - net47 + net48 x64 diff --git a/Directory.Build.props b/Directory.Build.props index 1e72e65133..cc6e4ea861 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -127,7 +127,7 @@ $(MSBuildThisFileDirectory) - + diff --git a/Directory.Build.targets b/Directory.Build.targets index bfe533e029..74264cc54f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -41,14 +41,6 @@ Command="cp '$(TargetDir)$(AssemblyName).dll' $HOME'/.config/Speckle/Kits/$(KitFolder)/'"/> - - - -