From 8b73f0c37ef8a9c126975d563c5a2a734c545dc9 Mon Sep 17 00:00:00 2001 From: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com> Date: Wed, 28 May 2025 23:39:09 +0100 Subject: [PATCH] comments --- README.md | 7 ++++--- SpeckleAutomateDotnetExample.sln | 10 +++++----- SpeckleAutomateDotnetExample/Program.cs | 1 + .../SpeckleAutomateDotnetExample.csproj | 2 +- .../TestAutomateFunction.csproj | 17 +++++++++++------ 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 1e87ee9..4bd95ed 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ This repository contains an example function that is compatible with Speckle Aut ## Getting started -This is essentially a template function, designed to serve as a starting point for creating your own function. The function targets dotnet 7.0 and uses the Speckle.Automate.SDK NuGet package, as well as the Objects Kit. +This is essentially a template function, designed to serve as a starting point for creating your own function. The function targets dotnet 8.0 and uses the Speckle.Automate.SDK NuGet package. At its core every Speckle Automate function is a CLI application with a specific, standardized set of available commands and arguments ([see below](#anatomy-of-a-function)). Each automate function is then built into a Docker image and published onto Speckle Automate. @@ -62,13 +62,14 @@ These arguments are automatically provided by the automate platform every time a ### Function Boilerplate (`Program.cs`) -In this file, you'll find a call to `AutomationRunner.Main`, which serves as your function's SDK entry point. This method handles argument parsing and accepts: +This Program.cs file is the entry point to your CLI app. +It contains boilerplate to setup the Automate SDK services, Resolve your function, and run it via the call to `IAutomationRunner.Main`. This method handles argument parsing and accepts: - `args` -> the arguments provided by Speckle Automate, and - `Func` -> Your custom function that gets executed when the automation is triggered. > [!NOTE] -> If your function requires no inputs, there is also `AutomationRunner.Main` (non-generic) which takes in a `Func` instead. +> If your function requires no inputs, there is also `IAutomationRunner.Main` (non-generic) which takes in a `Func` instead. This sets up a CLI application with two commands: diff --git a/SpeckleAutomateDotnetExample.sln b/SpeckleAutomateDotnetExample.sln index aca030a..937e3a8 100644 --- a/SpeckleAutomateDotnetExample.sln +++ b/SpeckleAutomateDotnetExample.sln @@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpeckleAutomateDotnetExampl EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestAutomateFunction", "TestAutomateFunction\TestAutomateFunction.csproj", "{8107A920-A5E2-459C-9756-04B91FB63F3F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Automate.Sdk", "..\speckle-sharp-sdk\Speckle.Automate.Sdk\Speckle.Automate.Sdk.csproj", "{8DEBC0DE-0893-4595-A268-42F90655D0F1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Automate.Sdk", "..\speckle-sharp-sdk\src\Speckle.Automate.Sdk\Speckle.Automate.Sdk.csproj", "{168306CA-D153-4FA6-AF5C-8198F6BFAA32}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,10 +23,10 @@ Global {8107A920-A5E2-459C-9756-04B91FB63F3F}.Debug|Any CPU.Build.0 = Debug|Any CPU {8107A920-A5E2-459C-9756-04B91FB63F3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {8107A920-A5E2-459C-9756-04B91FB63F3F}.Release|Any CPU.Build.0 = Release|Any CPU - {8DEBC0DE-0893-4595-A268-42F90655D0F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8DEBC0DE-0893-4595-A268-42F90655D0F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8DEBC0DE-0893-4595-A268-42F90655D0F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8DEBC0DE-0893-4595-A268-42F90655D0F1}.Release|Any CPU.Build.0 = Release|Any CPU + {168306CA-D153-4FA6-AF5C-8198F6BFAA32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {168306CA-D153-4FA6-AF5C-8198F6BFAA32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {168306CA-D153-4FA6-AF5C-8198F6BFAA32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {168306CA-D153-4FA6-AF5C-8198F6BFAA32}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SpeckleAutomateDotnetExample/Program.cs b/SpeckleAutomateDotnetExample/Program.cs index 84534cf..1f65ac5 100644 --- a/SpeckleAutomateDotnetExample/Program.cs +++ b/SpeckleAutomateDotnetExample/Program.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Speckle.Automate.Sdk; +//Boilerplate to setup Automate SDK var serviceCollection = new ServiceCollection(); serviceCollection.AddAutomateSdk(); serviceCollection.AddSingleton(); diff --git a/SpeckleAutomateDotnetExample/SpeckleAutomateDotnetExample.csproj b/SpeckleAutomateDotnetExample/SpeckleAutomateDotnetExample.csproj index 427c771..7fc4c83 100644 --- a/SpeckleAutomateDotnetExample/SpeckleAutomateDotnetExample.csproj +++ b/SpeckleAutomateDotnetExample/SpeckleAutomateDotnetExample.csproj @@ -10,7 +10,7 @@ - + diff --git a/TestAutomateFunction/TestAutomateFunction.csproj b/TestAutomateFunction/TestAutomateFunction.csproj index 9bbf298..239a2b6 100644 --- a/TestAutomateFunction/TestAutomateFunction.csproj +++ b/TestAutomateFunction/TestAutomateFunction.csproj @@ -4,16 +4,21 @@ net8.0 enable enable - false - - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive +