Skip to content

Commit

Permalink
Next ver 060 (#77)
Browse files Browse the repository at this point in the history
* update next version

* updating with new boilerplate
  • Loading branch information
darkfriend77 authored Apr 2, 2024
1 parent 9c1d9b2 commit 0780832
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 59 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ Using a terminal of your choice, create a new directory for your project and exe
```sh
dotnet new sln
dotnet new substrate \
--sdk_version 0.6.0 \
--sdk_version 0.6.1 \
--rest_service PROJECTNAME.RestService \
--net_api PROJECTNAME.NetApiExt \
--net_integration PROJECTNAME.Integration \
--rest_client PROJECTNAME.RestClient \
--metadata_websocket ws://127.0.0.1:9944 \
--generate_openapi_documentation false \
Expand All @@ -75,6 +76,7 @@ which generates a new solution and a couple of .NET projects in your project dir
├─── .substrate
├─── .config
├─── PROJECTNAME.NetApiExt
├─── PROJECTNAME.Integration
├─── PROJECTNAME.RestClient
├─── PROJECTNAME.RestClient.Mockup
├─── PROJECTNAME.RestClient.Test
Expand Down Expand Up @@ -125,9 +127,10 @@ You can also watch our short step-by-step tutorial that guides you through the e
- AstarNET
```sh
dotnet new substrate \
--sdk_version 0.6.0 \
--sdk_version 0.6.1 \
--rest_service AstarNET.RestService \
--net_api AstarNET.NetApiExt \
--net_api AstarNET.Integration \
--rest_client AstarNET.RestClient \
--metadata_websocket wss://rpc.astar.network \
--generate_openapi_documentation false \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"projects": {
"net_api": "Substrate.NetApiExt",
"net_integration": "Substrate.Integration",
"rest_service": "Substrate.RestService",
"rest_client": "Substrate.RestClient"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,68 @@
"language": "C#",
"type": "project"
},
"symbols": {
"sdk_version": {
"datatype": "string",
"defaultValue": "0.6.0",
"description": "Uses the given Substrate .NET Toolchain version.",
"replaces": "SUBSTRATE_TOOLCHAIN_VERSION",
"type": "parameter"
},
"api_version": {
"datatype": "string",
"defaultValue": "0.9.20",
"description": "Uses the given Substrate .NET API version.",
"replaces": "SUBSTRATE_NETAPI_VERSION",
"type": "parameter"
},
"net_api": {
"datatype": "string",
"defaultValue": "Substrate.NetApiExt",
"description": "Renames project name and namespace containing Substrate.NetApiExt (default).",
"fileRename": "Substrate.NetApiExt",
"replaces": "Substrate.NetApiExt",
"type": "parameter"
},
"rest_service": {
"datatype": "string",
"defaultValue": "Substrate.RestService",
"description": "Renames project name and namespace containing Substrate.RestService (default).",
"fileRename": "Substrate.RestService",
"replaces": "Substrate.RestService",
"type": "parameter"
},
"rest_client": {
"datatype": "string",
"defaultValue": "Substrate.RestClient",
"description": "Renames project name and namespace containing Substrate.RestClient (default).",
"fileRename": "Substrate.RestClient",
"replaces": "Substrate.RestClient",
"type": "parameter"
},
"metadata_websocket": {
"datatype": "string",
"defaultValue": "ws://127.0.0.1:9944",
"description": "Uses the given websocket URL to query metadata.",
"replaces": "ws://127.0.0.1:9944",
"type": "parameter"
},
"generate_openapi_documentation": {
"datatype": "bool",
"defaultValue": "false",
"description": "Activates/deactivates the OpenApi Document Generation",
"replaces": "OPENAPI_DOCUMENTATION_ENABLED",
"type": "parameter"
}
},
"symbols": {
"sdk_version": {
"datatype": "string",
"defaultValue": "0.6.1",
"description": "Uses the given Substrate .NET Toolchain version.",
"replaces": "SUBSTRATE_TOOLCHAIN_VERSION",
"type": "parameter"
},
"api_version": {
"datatype": "string",
"defaultValue": "0.9.20",
"description": "Uses the given Substrate .NET API version.",
"replaces": "SUBSTRATE_NETAPI_VERSION",
"type": "parameter"
},
"net_api": {
"datatype": "string",
"defaultValue": "Substrate.NetApiExt",
"description": "Renames project name and namespace containing Substrate.NetApiExt (default).",
"fileRename": "Substrate.NetApiExt",
"replaces": "Substrate.NetApiExt",
"type": "parameter"
},
"net_integration": {
"datatype": "string",
"defaultValue": "Substrate.Integration",
"description": "Renames project name and namespace containing Substrate.Integration (default).",
"fileRename": "Substrate.Integration",
"replaces": "Substrate.Integration",
"type": "parameter"
},
"rest_service": {
"datatype": "string",
"defaultValue": "Substrate.RestService",
"description": "Renames project name and namespace containing Substrate.RestService (default).",
"fileRename": "Substrate.RestService",
"replaces": "Substrate.RestService",
"type": "parameter"
},
"rest_client": {
"datatype": "string",
"defaultValue": "Substrate.RestClient",
"description": "Renames project name and namespace containing Substrate.RestClient (default).",
"fileRename": "Substrate.RestClient",
"replaces": "Substrate.RestClient",
"type": "parameter"
},
"metadata_websocket": {
"datatype": "string",
"defaultValue": "ws://127.0.0.1:9944",
"description": "Uses the given websocket URL to query metadata.",
"replaces": "ws://127.0.0.1:9944",
"type": "parameter"
},
"generate_openapi_documentation": {
"datatype": "bool",
"defaultValue": "false",
"description": "Activates/deactivates the OpenApi Document Generation",
"replaces": "OPENAPI_DOCUMENTATION_ENABLED",
"type": "parameter"
}
},
"primaryOutputs": [
{ "path": "Substrate.RestService/Substrate.RestService.csproj" },
{ "path": "Substrate.NetApiExt/Substrate.NetApiExt.csproj" },
Expand Down
2 changes: 1 addition & 1 deletion Tools/Substrate.DotNet/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public static class Constants
{
public const string SubstrateNetApiNugetPackage = "Substrate.NetApi";
public const string SubstrateServiceLayerNugetPackage = "Substrate.NetApi";
public const string SubstrateServiceLayerNugetPackage = "Substrate.ServiceLayer";
public const string MicrosoftAspNetCoreMvcCoreNugetPackage = "Microsoft.AspNetCore.Mvc.Core";
public const string SerilogAspNetCoreNugetPackage = "Serilog.AspNetCore";
public const string SerilogEnrichersThreadNugetPackage = "Serilog.Enrichers.Thread";
Expand Down
14 changes: 14 additions & 0 deletions Tools/Substrate.DotNet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ private static async Task<bool> UpgradeOrUpdateSubstrateEnvironmentAsync(bool fe
}

Log.Information("Using NetApi Project = {name}", configuration.Projects.NetApi);
Log.Information("Using Integration Project = {name}", configuration.Projects.Integration);
Log.Information("Using RestService Project = {name}", configuration.Projects.RestService);
Log.Information("Using RestClient Project = {name}", configuration.Projects.RestClient);
Log.Information("Using RestClient.Mockup Project = {name}", configuration.Projects.RestClientMockup);
Expand Down Expand Up @@ -303,12 +304,25 @@ private static void GenerateRestClientClasses(SubstrateConfiguration configurati
/// <summary>
/// Generates all classes for the NetApi project
/// </summary>
/// <param name="metadata"></param>
/// <param name="configuration"></param>
private static void GenerateNetApiClasses(MetaData metadata, SubstrateConfiguration configuration)
{
var generator = new NetApiGenerator(Log.Logger, configuration.Metadata.Runtime, new ProjectSettings(configuration.Projects.NetApi));
generator.Generate(metadata);
}

/// <summary>
/// Generates all classes for the Integration project
/// </summary>
/// <param name="metadata"></param>
/// <param name="configuration"></param>
private static void GenerateIntegrationClasses(MetaData metadata, SubstrateConfiguration configuration)
{
var generator = new IntegrationGenerator(Log.Logger, configuration.Metadata.Runtime, new ProjectSettings(configuration.Projects.NetApi));
generator.Generate(metadata);
}

/// <summary>
/// Returns the directory path to .substrate directory
/// </summary>
Expand Down
27 changes: 27 additions & 0 deletions Tools/Substrate.DotNet/Service/Generators/IntegrationGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Substrate.DotNet.Service.Generators.Base;
using Substrate.DotNet.Service.Node;
using Substrate.NetApi.Model.Meta;
using Serilog;
using System.Collections.Generic;

namespace Substrate.DotNet.Service.Generators
{
/// <summary>
/// Responsible for generating the NetApi Solution
/// </summary>
public class IntegrationGenerator : SolutionGeneratorBase
{
private readonly ProjectSettings _projectSettings;

public IntegrationGenerator(ILogger logger, string nodeRuntime, ProjectSettings projectSettings) : base(logger, nodeRuntime, projectSettings.ProjectName)
{
_projectSettings = projectSettings;
}

protected override void GenerateClasses(MetaData metadata)
{
GetGenericStructs(metadata.NodeMetadata.Types);
}

}
}
3 changes: 3 additions & 0 deletions Tools/Substrate.DotNet/SubstrateConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class SubstrateConfigurationProjects
[JsonProperty("net_api")]
public string NetApi { get; set; }

[JsonProperty("net_integration")]
public string Integration { get; set; }

[JsonProperty("rest_service")]
public string RestService { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<!-- Configuration -->
<VersionMajor>0</VersionMajor>
<VersionMinor>6</VersionMinor>
<VersionPatch>0</VersionPatch>
<VersionPatch>1</VersionPatch>
<AssemblyVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)</AssemblyVersion>

<SubstratePackageVersion>0.6.0</SubstratePackageVersion>
<SubstratePackageVersion>0.6.1</SubstratePackageVersion>

<!-- Variables -->
<SubstrateVersion>$(AssemblyVersion)</SubstrateVersion>
Expand Down

0 comments on commit 0780832

Please sign in to comment.