Skip to content

Commit

Permalink
Fix build RicoSuter#3418
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Apr 25, 2021
1 parent d2eacc0 commit a40c82a
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 58 deletions.
34 changes: 17 additions & 17 deletions build/03_RunIntegrationTests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@ pushd "%~dp0\..\samples"
cmd /c call powershell .\run.ps1 Release || goto :error
popd

pushd "%~dp0\..\src\NSwag.Sample.NETCore11"
dotnet restore || goto :error
dotnet publish || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore21 || goto :error
popd
REM pushd "%~dp0\..\src\NSwag.Sample.NETCore11"
REM dotnet restore || goto :error
REM dotnet publish || goto :error
REM cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore21 || goto :error
REM popd

pushd "%~dp0\..\src\NSwag.Sample.NETCore20"
dotnet restore || goto :error
dotnet publish || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore21 || goto :error
popd
REM pushd "%~dp0\..\src\NSwag.Sample.NETCore20"
REM dotnet restore || goto :error
REM dotnet publish || goto :error
REM cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore21 || goto :error
REM popd

pushd "%~dp0\..\src\NSwag.Sample.NETCore21"
dotnet restore || goto :error
dotnet build /p:CopyLocalLockFileAssemblies=true || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore21 || goto :error
popd

pushd "%~dp0\..\src\NSwag.Sample.NETCore22"
dotnet restore || goto :error
dotnet build /p:CopyLocalLockFileAssemblies=true || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore22 || goto :error
popd
REM pushd "%~dp0\..\src\NSwag.Sample.NETCore22"
REM dotnet restore || goto :error
REM dotnet build /p:CopyLocalLockFileAssemblies=true || goto :error
REM cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore22 || goto :error
REM popd

pushd "%~dp0\..\src\NSwag.Sample.NETCore30"
pushd "%~dp0\..\src\NSwag.Sample.NETCore31"
dotnet restore || goto :error
dotnet build /p:CopyLocalLockFileAssemblies=true || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore30 || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore31 || goto :error
popd

pushd "%~dp0\..\src\NSwag.Sample.NetGlobalAsax"
Expand Down
4 changes: 2 additions & 2 deletions samples/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ function NSwagRun([string]$projectDirectory, [string]$configurationFile, [string
}

# WithoutMiddleware/Sample.AspNetCore20
NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_project" "NetCore21" "Release" false
# NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_project" "NetCore21" "Release" false
# NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_assembly" "NetCore21" "Release" true

NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_project" "NetCore21" "Debug" false
# NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_project" "NetCore21" "Debug" false
# NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_assembly" "NetCore21" "Debug" true

# WithoutMiddleware/Sample.AspNetCore21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,18 @@ public override async Task<object> RunAsync(CommandLineProcessor processor, ICon

var binaryName = LauncherBinaryName + ".dll";
var executorBinary = Path.Combine(toolDirectory, binaryName);

if (!File.Exists(executorBinary))
{
binaryName = LauncherBinaryName + ".exe";
executorBinary = Path.Combine(toolDirectory, binaryName);
}

if (!File.Exists(executorBinary))
{
throw new InvalidOperationException($"Unable to locate {binaryName} in {toolDirectory}.");
}

args.Add(executorBinary);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Console.x86/NSwag.Console.x86.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
<PackageReference Include="NConsole" Version="3.9.6519.30868" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.1" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.1.3" />
Expand Down
1 change: 1 addition & 0 deletions src/NSwag.Demo.Web/NSwag.Demo.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<RootNamespace>NSwag.Demo.Web</RootNamespace>
<AssemblyName>NSwag.Demo.Web</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<AssemblyName>NSwag.Generation.WebApi.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
Expand Down
4 changes: 2 additions & 2 deletions src/NSwag.Integration.ClientPCL/PetStoreClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace PetStore
{
using System = global::System;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.10.9.0 (NJsonSchema v10.4.1.0 (Newtonsoft.Json v11.0.0.0))")]
public partial interface IPetStoreClient
{
Expand Down Expand Up @@ -2703,7 +2703,7 @@ public SwaggerException(string message, int statusCode, string response, System.
: base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
{
StatusCode = statusCode;
Response = response;
Response = response;
Headers = headers;
}

Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Integration.ClientPCL/ServiceClients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace NSwag.Integration.ClientPCL
{
using System = global::System;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.10.9.0 (NJsonSchema v10.4.1.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class GeoClient : ClientBase
{
Expand Down
26 changes: 13 additions & 13 deletions src/NSwag.Integration.ClientPCL/ServiceClientsContracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace NSwag.Integration.ClientPCL.Contracts
{
using System = global::System;



[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.1.0 (Newtonsoft.Json v11.0.0.0)")]
Expand Down Expand Up @@ -336,14 +336,14 @@ public bool IsPartial

public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response)
{
StatusCode = statusCode;
Headers = headers;
Stream = stream;
_client = client;
StatusCode = statusCode;
Headers = headers;
Stream = stream;
_client = client;
_response = response;
}

public void Dispose()
public void Dispose()
{
Stream.Dispose();
if (_response != null)
Expand All @@ -359,10 +359,10 @@ public partial class SwaggerResponse
public int StatusCode { get; private set; }

public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }
public SwaggerResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers)

public SwaggerResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers)
{
StatusCode = statusCode;
StatusCode = statusCode;
Headers = headers;
}
}
Expand All @@ -371,8 +371,8 @@ public SwaggerResponse(int statusCode, System.Collections.Generic.IReadOnlyDicti
public partial class SwaggerResponse<TResult> : SwaggerResponse
{
public TResult Result { get; private set; }
public SwaggerResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result)

public SwaggerResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result)
: base(statusCode, headers)
{
Result = result;
Expand All @@ -392,7 +392,7 @@ public GeoClientException(string message, int statusCode, string response, Syste
: base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
{
StatusCode = statusCode;
Response = response;
Response = response;
Headers = headers;
}

Expand Down Expand Up @@ -427,7 +427,7 @@ public PersonsClientException(string message, int statusCode, string response, S
: base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
{
StatusCode = statusCode;
Response = response;
Response = response;
Headers = headers;
}

Expand Down
4 changes: 2 additions & 2 deletions src/NSwag.Integration.ClientPCL/UberClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Uber
{
using System = global::System;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.10.9.0 (NJsonSchema v10.4.1.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class Client
{
Expand Down Expand Up @@ -1133,7 +1133,7 @@ public SwaggerException(string message, int statusCode, string response, System.
: base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
{
StatusCode = statusCode;
Response = response;
Response = response;
Headers = headers;
}

Expand Down
12 changes: 6 additions & 6 deletions src/NSwag.Integration.Console/Controllers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace MyNamespace
{
using System = global::System;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.10.9.0 (NJsonSchema v10.4.1.0 (Newtonsoft.Json v11.0.0.0))")]
public interface IGeoController
{
Expand Down Expand Up @@ -552,14 +552,14 @@ public bool IsPartial

public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response)
{
StatusCode = statusCode;
Headers = headers;
Stream = stream;
_client = client;
StatusCode = statusCode;
Headers = headers;
Stream = stream;
_client = client;
_response = response;
}

public void Dispose()
public void Dispose()
{
Stream.Dispose();
if (_response != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<RuntimeIdentifiers>win</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Integration.Console/ServiceClients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace NSwag.Integration.Console
{
using System = global::System;

[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.10.9.0 (NJsonSchema v10.4.1.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class GeoClient
{
Expand Down
14 changes: 7 additions & 7 deletions src/NSwag.Integration.Console/ServiceClientsContracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace NSwag.Integration.Console.Contracts
{
using System = global::System;



[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.1.0 (Newtonsoft.Json v11.0.0.0)")]
Expand Down Expand Up @@ -336,14 +336,14 @@ public bool IsPartial

public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response)
{
StatusCode = statusCode;
Headers = headers;
Stream = stream;
_client = client;
StatusCode = statusCode;
Headers = headers;
Stream = stream;
_client = client;
_response = response;
}

public void Dispose()
public void Dispose()
{
Stream.Dispose();
if (_response != null)
Expand All @@ -366,7 +366,7 @@ public SwaggerException(string message, int statusCode, string response, System.
: base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
{
StatusCode = statusCode;
Response = response;
Response = response;
Headers = headers;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<RootNamespace>NSwag.Integration.WebAPI</RootNamespace>
<AssemblyName>NSwag.Integration.WebAPI</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
Expand Down
18 changes: 15 additions & 3 deletions src/NSwag.Sample.NETCore31/openapi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v13.1.4.0 (NJsonSchema v10.0.27.0 (Newtonsoft.Json v9.0.0.0))",
{
"x-generator": "NSwag v13.10.9.0 (NJsonSchema v10.4.1.0 (Newtonsoft.Json v12.0.0.0))",
"openapi": "3.0.0",
"info": {
"title": "My Title",
Expand Down Expand Up @@ -77,7 +77,7 @@
"content": {
"application/json": {
"schema": {
"type": "string"
"$ref": "#/components/schemas/TestEnum"
}
}
}
Expand Down Expand Up @@ -197,6 +197,18 @@
"format": "date-time"
}
}
},
"TestEnum": {
"type": "string",
"description": "",
"x-enumNames": [
"Foo",
"Bar"
],
"enum": [
"Foo",
"Bar"
]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NSwag.Sample.NetGlobalAsax</RootNamespace>
<AssemblyName>NSwag.Sample.NetGlobalAsax</AssemblyName>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<AssemblyName>NSwag.VersionMissmatchTest</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RuntimeIdentifiers>win</RuntimeIdentifiers>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down
Loading

0 comments on commit a40c82a

Please sign in to comment.