Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 34e16b7

Browse files
authored
Merge dev -> dui3/alpha with merge conflict (#3562)
2 parents 4e57b47 + 9502b7b commit 34e16b7

81 files changed

Lines changed: 2888 additions & 678 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/scripts/config-template.yml

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,28 @@ jobs: # Each project will have individual jobs for each specific task it has to
341341
msbuild << parameters.slnname >>/<< parameters.slnname >>.sln /r /p:Configuration='<< parameters.build-config >>' /p:IsDesktopBuild=false /p:Version=$SEMVER /p:FileVersion=$VERSION
342342
environment:
343343
WORKFLOW_NUM: << pipeline.number >>
344+
- unless:
345+
condition: << parameters.build-with-mono >>
346+
steps:
347+
- run:
348+
name: Publish x64 and arm64
349+
command: |
350+
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)
351+
SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//')
352+
VER=$(echo "$SEMVER" | sed -e 's/-.*//')
353+
VERSION=$(echo $VER.$WORKFLOW_NUM)
354+
$HOME/.dotnet/dotnet publish << parameters.slnname >>/<< parameters.projname >>/<< parameters.projname >>.csproj -c Release -r osx-arm64 --self-contained /p:IsDesktopBuild=false /p:Version=$SEMVER /p:FileVersion=$VERSION
355+
$HOME/.dotnet/dotnet publish << parameters.slnname >>/<< parameters.projname >>/<< parameters.projname >>.csproj -c Release -r osx-x64 --self-contained /p:IsDesktopBuild=false /p:Version=$SEMVER /p:FileVersion=$VERSION
356+
environment:
357+
WORKFLOW_NUM: << pipeline.number >>
358+
# Create installer
359+
- run:
360+
name: Exit if External PR
361+
command: if [ "$CIRCLE_PR_REPONAME" ]; then circleci-agent step halt; fi
362+
# Zip files for installer
363+
- when:
364+
condition: << parameters.build-with-mono >>
365+
steps:
344366
# Compress build files
345367
- run:
346368
name: Zip Objects Kit files
@@ -362,34 +384,25 @@ jobs: # Each project will have individual jobs for each specific task it has to
362384
condition: << parameters.build-with-mono >>
363385
steps:
364386
- run:
365-
name: Publish x64 and arm64
387+
name: Create app bundles
366388
command: |
367-
TAG=$(if [ "${CIRCLE_TAG}" ]; then echo $CIRCLE_TAG; else echo "2.0.999"; fi;)
368-
SEMVER=$(echo "$TAG" | sed -e 's/\/[a-zA-Z-]*//')
369-
VER=$(echo "$SEMVER" | sed -e 's/-.*//')
370-
VERSION=$(echo $VER.$WORKFLOW_NUM)
371-
$HOME/.dotnet/dotnet publish << parameters.slnname >>/<< parameters.projname >>/<< parameters.projname >>.csproj -c Release -r osx-arm64 --self-contained /p:IsDesktopBuild=false /p:Version=$SEMVER /p:FileVersion=$VERSION
372-
$HOME/.dotnet/dotnet publish << parameters.slnname >>/<< parameters.projname >>/<< parameters.projname >>.csproj -c Release -r osx-x64 --self-contained /p:IsDesktopBuild=false /p:Version=$SEMVER /p:FileVersion=$VERSION
373-
environment:
374-
WORKFLOW_NUM: << pipeline.number >>
389+
sh ./speckle-sharp-ci-tools/Mac/AppBundle/bundle.sh ./<< parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-arm64/publish/ ./<< parameters.slnname >>/<< parameters.slnname >>/Info.plist ./<< parameters.slnname >>/<< parameters.slnname >>/Assets/icon-mac.icns ./<< parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-arm64/<< parameters.slnname >>
390+
sh ./speckle-sharp-ci-tools/Mac/AppBundle/bundle.sh ./<< parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-x64/publish/ ./<< parameters.slnname >>/<< parameters.slnname >>/Info.plist ./<< parameters.slnname >>/<< parameters.slnname >>/Assets/icon-mac.icns ./<< parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-x64/<< parameters.slnname >>
375391
- run:
376392
name: Zip Connector files
377393
command: |
378-
cd "<< parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-arm64/publish"
379-
zip -r << parameters.slug >>-mac-arm64.zip "./"
380-
cd "../../osx-x64/publish"
381-
zip -r << parameters.slug >>-mac-x64.zip "./"
394+
cd "<< parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-arm64/"
395+
zip -r << parameters.slug >>-mac-arm64.zip "./<< parameters.slnname >>.app"
396+
cd "../osx-x64/"
397+
zip -r << parameters.slug >>-mac-x64.zip "./<< parameters.slnname >>.app"
382398
# Copy installer files
383399
- run:
384400
name: Copy files to installer
385401
command: |
386402
mkdir -p speckle-sharp-ci-tools/Mac/<< parameters.installername >>/.installationFiles/
387-
cp << parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-arm64/publish/<< parameters.slug >>-mac-arm64.zip speckle-sharp-ci-tools/Mac/<<parameters.installername>>/.installationFiles
388-
cp << parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-x64/publish/<< parameters.slug >>-mac-x64.zip speckle-sharp-ci-tools/Mac/<<parameters.installername>>/.installationFiles
389-
# Create installer
390-
- run:
391-
name: Exit if External PR
392-
command: if [ "$CIRCLE_PR_REPONAME" ]; then circleci-agent step halt; fi
403+
cp << parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-arm64/<< parameters.slug >>-mac-arm64.zip speckle-sharp-ci-tools/Mac/<<parameters.installername>>/.installationFiles
404+
cp << parameters.slnname >>/<< parameters.slnname >>/bin/Release/net6.0/osx-x64/<< parameters.slug >>-mac-x64.zip speckle-sharp-ci-tools/Mac/<<parameters.installername>>/.installationFiles
405+
393406
- run:
394407
name: Build Mac installer
395408
command: ~/.dotnet/dotnet publish speckle-sharp-ci-tools/Mac/<<parameters.installername>>/<<parameters.installername>>.sln -r osx-x64 -c Release

Automate/Speckle.Automate.Sdk/AutomationContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ private void MarkRun(AutomationStatus status, string? statusMessage)
317317

318318
public void MarkRunFailed(string statusMessage) => MarkRun(AutomationStatus.Failed, statusMessage);
319319

320+
public void MarkRunException(string? statusMessage) => MarkRun(AutomationStatus.Exception, statusMessage);
321+
320322
public void MarkRunSuccess(string? statusMessage) => MarkRun(AutomationStatus.Succeeded, statusMessage);
321323

322324
/// <summary>

Automate/Speckle.Automate.Sdk/Runner.cs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ TInput inputs
4141
catch (Exception ex) when (!ex.IsFatal())
4242
{
4343
Console.WriteLine(ex.ToString());
44-
automationContext.MarkRunFailed("Function error. Check the automation run logs for details.");
44+
automationContext.MarkRunException("Function error. Check the automation run logs for details.");
4545
}
4646
finally
4747
{
@@ -59,16 +59,14 @@ public static async Task<AutomationContext> RunFunction(
5959
Func<AutomationContext, Task> automateFunction,
6060
AutomationRunData automationRunData,
6161
string speckleToken
62-
)
63-
{
64-
return await RunFunction(
62+
) =>
63+
await RunFunction(
6564
async (context, _) => await automateFunction(context).ConfigureAwait(false),
6665
automationRunData,
6766
speckleToken,
6867
new Fake()
6968
)
7069
.ConfigureAwait(false);
71-
}
7270

7371
private struct Fake { }
7472

@@ -100,14 +98,25 @@ public static async Task<int> Main<TInput>(string[] args, Func<AutomationContext
10098
Argument<string> pathArg = new(name: "Input Path", description: "A file path to retrieve function inputs");
10199
RootCommand rootCommand = new();
102100

101+
// a stupid hack to be able to exit with a specific integer exit code
102+
// read more at https://github.com/dotnet/command-line-api/issues/1570
103+
var exitCode = 0;
104+
103105
rootCommand.AddArgument(pathArg);
104106
rootCommand.SetHandler(
105107
async inputPath =>
106108
{
107109
FunctionRunData<TInput> data = FunctionRunDataParser.FromPath<TInput>(inputPath);
108110

109-
await RunFunction(automateFunction, data.AutomationRunData, data.SpeckleToken, data.FunctionInputs)
111+
var context = await RunFunction(
112+
automateFunction,
113+
data.AutomationRunData,
114+
data.SpeckleToken,
115+
data.FunctionInputs
116+
)
110117
.ConfigureAwait(false);
118+
119+
exitCode = context.RunStatus == "EXCEPTION" ? 1 : 0;
111120
},
112121
pathArg
113122
);
@@ -118,7 +127,7 @@ await RunFunction(automateFunction, data.AutomationRunData, data.SpeckleToken, d
118127
Command generateSchemaCommand = new("generate-schema", "Generate JSON schema for the function inputs");
119128
generateSchemaCommand.AddArgument(schemaFilePathArg);
120129
generateSchemaCommand.SetHandler(
121-
(schemaFilePath) =>
130+
schemaFilePath =>
122131
{
123132
JSchemaGenerator generator = new() { ContractResolver = new CamelCasePropertyNamesContractResolver() };
124133
generator.GenerationProviders.Add(new SpeckleSecretProvider());
@@ -134,7 +143,7 @@ await RunFunction(automateFunction, data.AutomationRunData, data.SpeckleToken, d
134143

135144
// if we've gotten this far, the execution should technically be completed as expected
136145
// thus exiting with 0 is the semantically correct thing to do
137-
return 0;
146+
return exitCode;
138147
}
139148
}
140149

Automate/Speckle.Automate.Sdk/Schema/AutomationRunData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ public struct AutomationRunData
1212
public string AutomationId { get; set; }
1313
public string AutomationRunId { get; set; }
1414
public string FunctionRunId { get; set; }
15-
public List<AutomationRunTriggerBase> Triggers { get; set; }
15+
public List<VersionCreationTrigger> Triggers { get; set; }
1616
}

Automate/Speckle.Automate.Sdk/Schema/AutomationStatus.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ public enum AutomationStatus
88
Initializing,
99
Running,
1010
Failed,
11-
Succeeded
11+
Succeeded,
12+
Exception
1213
}

Automate/Speckle.Automate.Sdk/Schema/AutomationStatusMapping.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public abstract class AutomationStatusMapping
66
private const string RUNNING = "RUNNING";
77
private const string FAILED = "FAILED";
88
private const string SUCCEEDED = "SUCCEEDED";
9+
private const string EXCEPTION = "EXCEPTION";
910

1011
public static string Get(AutomationStatus status) =>
1112
status switch
@@ -14,6 +15,7 @@ public static string Get(AutomationStatus status) =>
1415
AutomationStatus.Failed => FAILED,
1516
AutomationStatus.Succeeded => SUCCEEDED,
1617
AutomationStatus.Initializing => INITIALIZING,
18+
AutomationStatus.Exception => EXCEPTION,
1719
_ => throw new ArgumentOutOfRangeException($"Not valid value for enum {status}")
1820
};
1921
}

Automate/Speckle.Automate.Sdk/Schema/Triggers/VersionCreationTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class VersionCreationTrigger : AutomationRunTriggerBase
1010
public VersionCreationTrigger(string modelId, string versionId)
1111
{
1212
TriggerType = "versionCreation";
13-
Payload = new VersionCreationTriggerPayload() { ModelId = modelId, VersionId = versionId };
13+
Payload = new VersionCreationTriggerPayload { ModelId = modelId, VersionId = versionId };
1414
}
1515
}
1616

Automate/Speckle.Automate.Sdk/Test/TestAutomateUtils.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ mutation Mutation($projectId: ID!, $automationId: ID!) {
5252
AutomationId = TestAutomateEnvironment.GetSpeckleAutomationId(),
5353
AutomationRunId = runData["automationRunId"],
5454
FunctionRunId = runData["functionRunId"],
55-
Triggers = new List<AutomationRunTriggerBase>()
56-
{
57-
new VersionCreationTrigger(modelId: modelId, versionId: versionId)
58-
}
55+
Triggers = new List<VersionCreationTrigger> { new(modelId: modelId, versionId: versionId) }
5956
};
6057

6158
return data;

Automate/Tests/Speckle.Automate.Sdk.Tests.Integration/SpeckleAutomate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private async Task<AutomationRunData> AutomationRunData(Base testObject)
4646
string functionRelease = Utils.RandomString(10);
4747
string functionRunId = Utils.RandomString(10);
4848

49-
var triggers = new List<AutomationRunTriggerBase>() { new VersionCreationTrigger(modelId, versionId) };
49+
var triggers = new List<VersionCreationTrigger> { new(modelId, versionId) };
5050

5151
return new AutomationRunData
5252
{
@@ -59,7 +59,7 @@ private async Task<AutomationRunData> AutomationRunData(Base testObject)
5959
};
6060
}
6161

62-
private VersionCreationTrigger GetVersionCreationTrigger(List<AutomationRunTriggerBase> triggers)
62+
private VersionCreationTrigger GetVersionCreationTrigger(List<VersionCreationTrigger> triggers)
6363
{
6464
if (triggers.FirstOrDefault() is not VersionCreationTrigger trigger)
6565
{

ConnectorArchicad/AddOn/Sources/AddOn/AddOnMain.cpp

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "Commands/GetElementBaseData.hpp"
1919
#include "Commands/GetGridElementData.hpp"
2020
#include "Commands/GetObjectData.hpp"
21+
#include "Commands/GetOpeningData.hpp"
2122
#include "Commands/GetSlabData.hpp"
2223
#include "Commands/GetRoofData.hpp"
2324
#include "Commands/GetShellData.hpp"
@@ -31,6 +32,7 @@
3132
#include "Commands/CreateColumn.hpp"
3233
#include "Commands/CreateGridElement.hpp"
3334
#include "Commands/CreateObject.hpp"
35+
#include "Commands/CreateOpening.hpp"
3436
#include "Commands/CreateRoof.hpp"
3537
#include "Commands/CreateSkylight.hpp"
3638
#include "Commands/CreateSlab.hpp"
@@ -90,46 +92,41 @@ class AvaloniaProcessManager {
9092
private:
9193
GS::UniString GetPlatformSpecificExecutablePath ()
9294
{
93-
#if defined (macintosh)
94-
static const char* FileName = "ConnectorArchicad";
95-
#else
96-
static const char* FileName = "ConnectorArchicad.exe";
97-
#endif
98-
static const char* FolderNameCommon = "Common";
99-
static const char* FolderName = "ConnectorArchicad";
100-
10195
IO::Location ownFileLoc;
10296
auto err = ACAPI_GetOwnLocation (&ownFileLoc);
10397
if (err != NoError) {
10498
return "";
10599
}
106100

101+
#if defined (macintosh)
102+
static const char* ProductionConnector = "../../../Common/ConnectorArchicad/ConnectorArchicad.app/Contents/MacOS/ConnectorArchicad";
103+
#else
104+
static const char* ProductionConnector = "../../../Common/ConnectorArchicad/ConnectorArchicad.exe";
105+
#endif
106+
107107
IO::Location location (ownFileLoc);
108-
location.DeleteLastLocalName ();
109-
location.DeleteLastLocalName ();
110-
location.DeleteLastLocalName ();
111-
location.AppendToLocal (IO::Name (FolderNameCommon));
112-
location.AppendToLocal (IO::Name (FolderName));
113-
location.AppendToLocal (IO::Name (FileName));
108+
location.AppendToLocal (IO::RelativeLocation (ProductionConnector));
114109

115110
bool exist (false);
116111
err = IO::fileSystem.Contains (location, &exist);
117112
if (err != NoError || !exist) {
118113
location = ownFileLoc;
119-
location.DeleteLastLocalName ();
120-
location.DeleteLastLocalName ();
121-
location.DeleteLastLocalName ();
122-
location.DeleteLastLocalName ();
123114

124-
location.AppendToLocal (IO::Name (FolderName));
125-
location.AppendToLocal (IO::Name ("bin"));
115+
#if defined (macintosh)
126116
#ifdef DEBUG
127-
location.AppendToLocal (IO::Name ("Debug"));
117+
static const char* DevelopmentConnector = "../../../../ConnectorArchicad/bin/Debug/net6.0/ConnectorArchicad";
128118
#else
129-
location.AppendToLocal (IO::Name ("Release"));
119+
static const char* DevelopmentConnector = "../../../../ConnectorArchicad/bin/Release/net6.0/ConnectorArchicad";
130120
#endif
131-
location.AppendToLocal (IO::Name ("net6.0"));
132-
location.AppendToLocal (IO::Name (FileName));
121+
#else
122+
#ifdef DEBUG
123+
static const char* DevelopmentConnector = "../../../../ConnectorArchicad/bin/Debug/net6.0/ConnectorArchicad.exe";
124+
#else
125+
static const char* DevelopmentConnector = "../../../../ConnectorArchicad/bin/Release/net6.0/ConnectorArchicad.exe";
126+
#endif
127+
#endif
128+
129+
location.AppendToLocal (IO::RelativeLocation (DevelopmentConnector));
133130
}
134131

135132
GS::UniString executableStr;
@@ -200,6 +197,7 @@ static GSErrCode RegisterAddOnCommands ()
200197
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::GetElementBaseData> ()));
201198
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::GetGridElementData> ()));
202199
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::GetObjectData> ()));
200+
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::GetOpeningData> ()));
203201
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::GetRoofData> ()));
204202
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::GetShellData> ()));
205203
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::GetSkylightData> ()));
@@ -213,6 +211,7 @@ static GSErrCode RegisterAddOnCommands ()
213211
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::CreateGridElement> ()));
214212
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::CreateColumn> ()));
215213
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::CreateObject> ()));
214+
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::CreateOpening> ()));
216215
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::CreateRoof> ()));
217216
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::CreateShell> ()));
218217
CHECKERROR (ACAPI_AddOnAddOnCommunication_InstallAddOnCommandHandler (NewOwned<AddOnCommands::CreateSkylight> ()));

0 commit comments

Comments
 (0)