Moved projects 1 folder down. Added project for reading the code model and turning into C# code.
This commit is contained in:
Родитель
24b2cdb5de
Коммит
ad406980ec
|
@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29230.61
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoRest.CSharp.V3", "src\AutoRest.CSharp.V3.csproj", "{D1018BFE-551F-4EFD-B5C7-D3FF7A82351D}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoRest.CSharp.V3", "src\AutoRest.CSharp.V3\AutoRest.CSharp.V3.csproj", "{D1018BFE-551F-4EFD-B5C7-D3FF7A82351D}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoRest.CodeModel", "src\AutoRest.CodeModel\AutoRest.CodeModel.csproj", "{FD9339E6-A987-4506-977F-C294A31D0D53}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -15,6 +17,10 @@ Global
|
|||
{D1018BFE-551F-4EFD-B5C7-D3FF7A82351D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D1018BFE-551F-4EFD-B5C7-D3FF7A82351D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D1018BFE-551F-4EFD-B5C7-D3FF7A82351D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FD9339E6-A987-4506-977F-C294A31D0D53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FD9339E6-A987-4506-977F-C294A31D0D53}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FD9339E6-A987-4506-977F-C294A31D0D53}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FD9339E6-A987-4506-977F-C294A31D0D53}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<AssemblyName>AutoRest.CSharp.V3</AssemblyName>
|
||||
<RootNamespace>AutoRest.CSharp.V3</RootNamespace>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<OutputPath>../bin</OutputPath>
|
||||
<OutputPath>../../bin</OutputPath>
|
||||
<PublishDir>$(OutputPath)</PublishDir>
|
||||
<!-- Some methods are marked async and don't have an await in them -->
|
||||
<NoWarn>1998</NoWarn>
|
|
@ -0,0 +1,18 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NJsonSchema.CodeGeneration.CSharp" Version="10.0.23" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="code-model.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,25 @@
|
|||
using System.IO;
|
||||
using NJsonSchema;
|
||||
using NJsonSchema.CodeGeneration.CSharp;
|
||||
|
||||
namespace AutoRest.CodeModel
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
private static void Main()
|
||||
{
|
||||
//var codeModelJson = File.ReadAllText("code-model.json");
|
||||
//var schema = JsonSchema.FromJsonAsync(codeModelJson).Result;
|
||||
var schema = JsonSchema.FromFileAsync("code-model.json").Result;
|
||||
var settings = new CSharpGeneratorSettings
|
||||
{
|
||||
HandleReferences = true,
|
||||
GenerateOptionalPropertiesAsNullable = true
|
||||
};
|
||||
var generator = new CSharpGenerator(schema, settings);
|
||||
var file = generator.GenerateFile();
|
||||
File.WriteAllText("CodeModel.cs", file);
|
||||
//var types = generator.GenerateTypes();
|
||||
}
|
||||
}
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче