Skip to content

Commit

Permalink
Fix build (RicoSuter#3436)
Browse files Browse the repository at this point in the history
* Fix build

* k

* x86

* netstd

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines
  • Loading branch information
RicoSuter authored Apr 25, 2021
1 parent fa4d55b commit fe804fb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 122 deletions.
52 changes: 28 additions & 24 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,46 +25,41 @@ steps:
- task: CmdLine@2
displayName: 'Install DNT'
inputs:
script: 'npm i -g dotnettools@1.2.5'
script: 'npm i -g dotnettools'

# Patch project versions (on master only)
# - task: CmdLine@2
# displayName: 'Update project version patch'
# condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# inputs:
# script: 'dnt bump-versions patch'
# failOnStderr: true
- task: CmdLine@2
displayName: 'Patch project version preview'
displayName: 'Patch project version (preview)'
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs:
script: 'dnt bump-versions preview "$(Build.BuildNumber)"'
failOnStderr: true

- task: DotNetCoreCLI@2
displayName: 'Restoring code using dotnet restore'
displayName: 'Restore packages'
inputs:
command: 'restore'
projects: '$(Projects)'
includeNuGetOrg: true

# Build and test
- task: DotNetCoreCLI@2
- task: MSBuild@1
displayName: 'Build solution'
inputs:
command: 'build'
projects: '$(Projects)'
arguments: '--configuration $(BuildConfiguration)'
feedsToUse: 'select'
versioningScheme: 'off'
# - task: DotNetCoreCLI@2
# displayName: 'Run tests'
# inputs:
# command: 'test'
# projects: '$(Projects)'
# arguments: '--configuration $(BuildConfiguration)'
# feedsToUse: 'select'
# versioningScheme: 'off'
solution: '$(Projects)'
msbuildArchitecture: 'x86'
configuration: '$(BuildConfiguration)'

- task: VSTest@2
displayName: 'Run tests'
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\*Integration*.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
configuration: '$(BuildConfiguration)'

# Publish artifacts
- task: CopyFiles@2
Expand All @@ -74,6 +69,15 @@ steps:
Contents: '**/*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true

- task: CopyFiles@2
displayName: 'Copy MSI'
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
Contents: '**/*.msi'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true

- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
# condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NSwag.Integration.ClientPCL.Tests</RootNamespace>
<AssemblyName>NSwag.Integration.ClientPCL.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
Expand Down
72 changes: 5 additions & 67 deletions src/NSwag.Integration.ClientPCL/NSwag.Integration.ClientPCL.csproj
Original file line number Diff line number Diff line change
@@ -1,72 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ECD41518-A92C-4706-8E74-9707AFA554B7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NSwag.Integration.ClientPCL</RootNamespace>
<AssemblyName>NSwag.Integration.ClientPCL</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFramework>netstandard1.4</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<!-- A reference to the entire .NET Framework is automatically included -->
<None Include="swagger.json" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClientBase.cs" />
<Compile Include="PetStoreClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServiceClients.cs" />
<Compile Include="ServiceClientsContracts.cs" />
<Compile Include="UberClient.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Net.Http" Version="2.2.29" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Portable.DataAnnotations" Version="1.0.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.3.0" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
</Project>
30 changes: 0 additions & 30 deletions src/NSwag.Integration.ClientPCL/Properties/AssemblyInfo.cs

This file was deleted.

5 changes: 5 additions & 0 deletions src/NSwag.sln
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NETCore31", "N
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Generation.AspNetCore3.Tests", "NSwag.Generation.AspNetCore3.Tests\NSwag.Generation.AspNetCore3.Tests.csproj", "{2333521E-F537-4F4F-98B9-7CD22B20A5D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00 Build", "00 Build", "{6F5E4FDF-0A82-42D5-94AC-A9CD43CC931D}"
ProjectSection(SolutionItems) = preProject
..\azure-pipelines.yml = ..\azure-pipelines.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down

0 comments on commit fe804fb

Please sign in to comment.