File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
java/io/swagger/codegen/v3/generators/dotnet
resources/handlebars/csharp-dotnet2 Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 9
9
10
10
public class CsharpDotNet2ClientCodegen extends AbstractCSharpCodegen {
11
11
public static final String CLIENT_PACKAGE = "clientPackage" ;
12
+ public static final String USE_CSPROJ_FILE = "useCsProjFile" ;
12
13
protected String clientPackage = "IO.Swagger.Client" ;
13
14
protected String apiDocPath = "docs/" ;
14
15
protected String modelDocPath = "docs/" ;
@@ -68,6 +69,9 @@ public void processOpts() {
68
69
supportingFiles .add (new SupportingFile ("packages.config.mustache" , "vendor" , "packages.config" ));
69
70
supportingFiles .add (new SupportingFile ("compile-mono.sh.mustache" , "" , "compile-mono.sh" ));
70
71
supportingFiles .add (new SupportingFile ("README.mustache" , "" , "README.md" ));
72
+ if (additionalProperties .containsKey (USE_CSPROJ_FILE ) && Boolean .parseBoolean (additionalProperties .get (USE_CSPROJ_FILE ).toString ())) {
73
+ supportingFiles .add (new SupportingFile ("csproj.mustache" , "" , clientPackage + ".csproj" ));
74
+ }
71
75
72
76
}
73
77
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+
3
+ <PropertyGroup >
4
+ <TargetFramework >netstandard2.0</TargetFramework >
5
+ <RootNamespace >{ {clientPackage} }</RootNamespace >
6
+ </PropertyGroup >
7
+
8
+ <PropertyGroup >
9
+ <!-- Nuget Package Metadata -->
10
+ <PackageId >{ {packageName} }</PackageId >
11
+ <PackageVersion >{ {packageVersion} }</PackageVersion >
12
+ <Authors >{ {packageAuthors} }</Authors >
13
+ <Owners >{ {packageCompany} }</Owners >
14
+ <Title >{ {packageTitle} }</Title >
15
+ <Description >{ {packageDescription} }</Description >
16
+ <Copyright >{ {packageCopyright} }</Copyright >
17
+ </PropertyGroup >
18
+
19
+ <ItemGroup >
20
+ <PackageReference Include =" Newtonsoft.Json" Version =" 12.0.1" />
21
+ <PackageReference Include =" RestSharp" Version =" 105.0.1" />
22
+ </ItemGroup >
23
+ </Project >
You can’t perform that action at this time.
0 commit comments