From c9874562928da13bb9b4448cb3851d414c4c0689 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Wed, 3 Jul 2024 09:57:45 -0500 Subject: [PATCH 1/6] Update SdkGen to .NET 8 --- .../EdFi.SdkGen.Console.csproj | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.SdkGen.Console.csproj b/Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.SdkGen.Console.csproj index b62da3e1b0..00cc76f7ac 100644 --- a/Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.SdkGen.Console.csproj +++ b/Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.SdkGen.Console.csproj @@ -1,29 +1,29 @@  - + Exe - net6.0 - false - false + net8.0 + false + false - - - - - - + + + + + + - + PreserveNewest - + - + PreserveNewest @@ -31,4 +31,4 @@ Always - + \ No newline at end of file From 89ae80dd6ae1e8973143f1d4aeba187cf3871e6c Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Wed, 3 Jul 2024 09:58:41 -0500 Subject: [PATCH 2/6] Add JavaPath parameter to SdkGen cli --- .../SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs | 5 ++--- Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs b/Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs index b271cb7ca1..3423f6f51f 100644 --- a/Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs +++ b/Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs @@ -20,7 +20,6 @@ public class OpenApiCodeGenCliRunner private const string Profiles = "Profiles"; private const string Composites = "Composites"; private const string Identity = "Identity"; - private const string Java = "java"; private const string All = "All"; private readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly Options _options; @@ -70,13 +69,13 @@ private void RunCliCodegen(IEnumerable apiEndpoints) { $"-Xms3g -jar {_options.CliExecutableFullName()}", "generate", "-g csharp-netcore", $"-i {apiEndpoint.EndpointUri}", $"--api-package {apiPackage}", $"--model-package {modelPackage}", $"-o {_options.OutputFolder}", - $"--additional-properties packageName={_options.Namespace},targetFramework=net6.0,netCoreProjectFile=true", + $"--additional-properties packageName={_options.Namespace},targetFramework=net8.0,netCoreProjectFile=true", "--global-property modelTests=false --global-property apiTests=false --global-property apiDocs=false --global-property modelDocs=false --skip-validate-spec" }; _log.Info($"Generating C# SDK for {apiEndpoint.EndpointUri}"); - ShellProcess(Java, @params); + ShellProcess(_options.JavaPath, @params); } } diff --git a/Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs b/Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs index 6768aedb0e..a17ed32ea5 100644 --- a/Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs +++ b/Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs @@ -74,6 +74,13 @@ public sealed class Options HelpText = "include identity in the generation of the assembly")] public bool IncludeIdentity { get; set; } + [Option( + 'j', + "java-path", + Default = "java", + HelpText = "the path to the java executable")] + public string JavaPath { get; set; } + [Option( 'k', "core-only", From d80e866f8f0bffea4a5ad70c7fcae60f1a52c209 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Wed, 3 Jul 2024 09:59:16 -0500 Subject: [PATCH 3/6] Update SdkGen java cli parameter to 7.2.0 --- Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs b/Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs index a17ed32ea5..432f630e52 100644 --- a/Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs +++ b/Utilities/SdkGen/EdFi.SdkGen.Console/Options.cs @@ -28,7 +28,7 @@ public sealed class Options [Option( 'v', "cliVersion", - Default = "6.6.0", + Default = "7.2.0", HelpText = "the version of openapi-codegen-cli to download")] public string CliVersion { get; set; } From 3ecd1037535a8d2eb9d9bef89f8f3257a1b407a0 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Wed, 3 Jul 2024 16:06:36 -0500 Subject: [PATCH 4/6] Fix java CodeGen parameter --- Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs b/Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs index 3423f6f51f..c11741bfa1 100644 --- a/Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs +++ b/Utilities/SdkGen/EdFi.SdkGen.Console/OpenApiCodeGenCliRunner.cs @@ -67,7 +67,7 @@ private void RunCliCodegen(IEnumerable apiEndpoints) // code-gen paramaters string[] @params = { - $"-Xms3g -jar {_options.CliExecutableFullName()}", "generate", "-g csharp-netcore", $"-i {apiEndpoint.EndpointUri}", + $"-Xms3g -jar {_options.CliExecutableFullName()}", "generate", "-g csharp", $"-i {apiEndpoint.EndpointUri}", $"--api-package {apiPackage}", $"--model-package {modelPackage}", $"-o {_options.OutputFolder}", $"--additional-properties packageName={_options.Namespace},targetFramework=net8.0,netCoreProjectFile=true", "--global-property modelTests=false --global-property apiTests=false --global-property apiDocs=false --global-property modelDocs=false --skip-validate-spec" From 3b7c67abef845b0341e4dd3c5ffb6bb374dc6b10 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Wed, 3 Jul 2024 16:08:15 -0500 Subject: [PATCH 5/6] Update SdkGen nuspec --- Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.OdsApi.Sdk.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.OdsApi.Sdk.nuspec b/Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.OdsApi.Sdk.nuspec index ae52d498e1..7e5ea1c1f8 100644 --- a/Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.OdsApi.Sdk.nuspec +++ b/Utilities/SdkGen/EdFi.SdkGen.Console/EdFi.OdsApi.Sdk.nuspec @@ -21,6 +21,6 @@ - + \ No newline at end of file From fb7c03b730ae08f737327175b83802ad9b0f1cd7 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 5 Jul 2024 08:00:23 -0500 Subject: [PATCH 6/6] Update SmokeTest to handle Var prefixes on reserved words --- .../SmokeTest/PropertyBuilders/DescriptorPropertyBuilder.cs | 2 +- .../SmokeTest/PropertyBuilders/NamespacePropertyBuilder.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Utilities/DataLoading/EdFi.LoadTools/SmokeTest/PropertyBuilders/DescriptorPropertyBuilder.cs b/Utilities/DataLoading/EdFi.LoadTools/SmokeTest/PropertyBuilders/DescriptorPropertyBuilder.cs index 50042fd405..b57fc01b86 100644 --- a/Utilities/DataLoading/EdFi.LoadTools/SmokeTest/PropertyBuilders/DescriptorPropertyBuilder.cs +++ b/Utilities/DataLoading/EdFi.LoadTools/SmokeTest/PropertyBuilders/DescriptorPropertyBuilder.cs @@ -60,7 +60,7 @@ public override bool BuildProperty(object obj, PropertyInfo propertyInfo) .GetValue(lookup).ToString(); var uri = lookup.GetType() - .GetProperty(EdFiConstants.Namespace) + .GetProperty($"Var{EdFiConstants.Namespace}") .GetValue(lookup); var descriptorValue = uri != null && !string.IsNullOrEmpty(uri.ToString()) diff --git a/Utilities/DataLoading/EdFi.LoadTools/SmokeTest/PropertyBuilders/NamespacePropertyBuilder.cs b/Utilities/DataLoading/EdFi.LoadTools/SmokeTest/PropertyBuilders/NamespacePropertyBuilder.cs index 25b89e555e..ea006d2b7b 100644 --- a/Utilities/DataLoading/EdFi.LoadTools/SmokeTest/PropertyBuilders/NamespacePropertyBuilder.cs +++ b/Utilities/DataLoading/EdFi.LoadTools/SmokeTest/PropertyBuilders/NamespacePropertyBuilder.cs @@ -27,7 +27,7 @@ public override bool BuildProperty(object obj, PropertyInfo propertyInfo) { var typeName = obj.GetType().Name; - if (propertyInfo.PropertyType != typeof(string) || propertyInfo.Name != EdFiConstants.Namespace) + if (propertyInfo.PropertyType != typeof(string) || propertyInfo.Name != $"Var{EdFiConstants.Namespace}") { return false; }