Skip to content

Commit

Permalink
Netstandard2 (#484)
Browse files Browse the repository at this point in the history
* Add none trigger

* remove appveyor

* add netstandard 2 and update to net461

* Update readme
  • Loading branch information
Oren Novotny authored May 23, 2018
1 parent cd196d7 commit 9dafef3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 61 deletions.
1 change: 1 addition & 0 deletions .vsts-pr.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
trigger: none
variables:
BuildConfiguration: Release

Expand Down
19 changes: 3 additions & 16 deletions Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,14 @@
</PropertyGroup>

<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.7.6" PrivateAssets="All" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="15.5.24" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="15.7.18" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
<NerdbankGitVersioningVersion>2.1.16</NerdbankGitVersioningVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.1.16" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="2.1.23" PrivateAssets="all" />
</ItemGroup>

<!-- https://github.com/NuGet/Home/issues/4337 -->
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' == 'true' ">
<Import Project="$(NuGetPackageRoot)nerdbank.gitversioning\$(NerdbankGitVersioningVersion)\buildCrossTargeting\Nerdbank.GitVersioning.targets"
Condition="Exists('$(NuGetPackageRoot)nerdbank.gitversioning\$(NerdbankGitVersioningVersion)\buildCrossTargeting\Nerdbank.GitVersioning.targets')" />
</ImportGroup>
<Target Name="FixUpVersion"
BeforeTargets="_GenerateRestoreProjectSpec"
DependsOnTargets="GetBuildVersion"
Condition=" '$(NerdbankGitVersioningTasksPath)' != '' " />
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Refit currently supports the following platforms and any .NET Standard 1.4 targe
* Xamarin.Android
* Xamarin.Mac
* Xamarin.iOS
* Desktop .NET 4.5
* Desktop .NET 4.6.1
* .NET Core

#### Note about .NET Core
Expand Down
18 changes: 9 additions & 9 deletions Refit.Tests/Refit.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="Test Files\Test.pdf" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
Expand All @@ -19,17 +19,17 @@
</ItemGroup>

<ItemGroup>
<Reference Condition="'$(TargetFramework)' == 'net46' " Include="System.Net.Http" />
<Reference Condition="'$(TargetFramework)' == 'net461' " Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<None Include="RefitStubs.*.cs" />
<Compile Condition="'$(TargetFramework)' == 'net46' " Remove="RefitStubs.NetCore2.cs" />
<Compile Condition="'$(TargetFramework)' == 'net461' " Remove="RefitStubs.NetCore2.cs" />
<Compile Condition="'$(TargetFramework)' == 'netcoreapp2.0' " Remove="RefitStubs.Net46.cs" />
</ItemGroup>

<Target Name="GenerateRefitStubsFull" Condition="'$(DesignTimeBuild)' != 'true' and '$(MSBuildRuntimeType)' != 'Core' " BeforeTargets="CoreCompile">
<PropertyGroup>
<OutputStubsFile Condition="'$(TargetFramework)' == 'net46' ">$(MSBuildThisFileDirectory)RefitStubs.Net46.cs</OutputStubsFile>
<OutputStubsFile Condition="'$(TargetFramework)' == 'net461' ">$(MSBuildThisFileDirectory)RefitStubs.Net46.cs</OutputStubsFile>
<OutputStubsFile Condition="'$(TargetFramework)' == 'netcoreapp2.0' ">$(MSBuildThisFileDirectory)RefitStubs.NetCore2.cs</OutputStubsFile>
<RefitParameterFile>$(MSBuildThisFileDirectory)$(IntermediateOutputPath)RefitParams.rsp</RefitParameterFile>
</PropertyGroup>
Expand All @@ -40,14 +40,14 @@
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<RefitExecCmd>mono "$(MSBuildThisFileDirectory)../InterfaceStubGenerator.App/bin/$(Configuration)/net46/InterfaceStubGenerator.App.exe" "$(OutputStubsFile)" "$(MSBuildProjectDirectory)" "$(RefitParameterFile)"</RefitExecCmd>
</PropertyGroup>
<Message Text="Executing: $(RefitExecCmd)" Importance="High" />
<Message Text="Executing: $(RefitExecCmd)" Importance="High" />
<Exec Command="$(RefitExecCmd)" />
<Message Text="Processed Refit Stubs" />
</Target>

<Target Name="GenerateRefitStubsCore" Condition="'$(DesignTimeBuild)' != 'true' and '$(MSBuildRuntimeType)' == 'Core' " BeforeTargets="CoreCompile">
<PropertyGroup>
<OutputStubsFile Condition="'$(TargetFramework)' == 'net46' ">$(MSBuildThisFileDirectory)RefitStubs.Net46.cs</OutputStubsFile>
<OutputStubsFile Condition="'$(TargetFramework)' == 'net461' ">$(MSBuildThisFileDirectory)RefitStubs.Net46.cs</OutputStubsFile>
<OutputStubsFile Condition="'$(TargetFramework)' == 'netcoreapp2.0' ">$(MSBuildThisFileDirectory)RefitStubs.NetCore2.cs</OutputStubsFile>
<RefitParameterFile>$(MSBuildThisFileDirectory)$(IntermediateOutputPath)RefitParams.rsp</RefitParameterFile>
</PropertyGroup>
Expand All @@ -58,7 +58,7 @@
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<RefitExecCmd>dotnet "$(MSBuildThisFileDirectory)../InterfaceStubGenerator.App/bin/$(Configuration)/netcoreapp2.0/InterfaceStubGenerator.App.dll" "$(OutputStubsFile)" "$(MSBuildProjectDirectory)" "$(RefitParameterFile)"</RefitExecCmd>
</PropertyGroup>
<Message Text="Executing: $(RefitExecCmd)" Importance="High" />
<Message Text="Executing: $(RefitExecCmd)" Importance="High" />
<Exec Command="$(RefitExecCmd)" />
<Message Text="Processed Refit Stubs" />
</Target>
Expand Down
5 changes: 4 additions & 1 deletion Refit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4F1C8991-7097-4471-A9A6-A72005AB594D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
appveyor.yml = appveyor.yml
.vsts-ci.yml = .vsts-ci.yml
.vsts-pr.yml = .vsts-pr.yml
.vsts-shared.yml = .vsts-shared.yml
Directory.build.props = Directory.build.props
README.md = README.md
Refit.ruleset = Refit.ruleset
version.json = version.json
EndProjectSection
Expand Down
10 changes: 5 additions & 5 deletions Refit/Refit.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Product>Refit ($(TargetFramework))</Product>
<TargetFrameworks>netstandard1.4;net45</TargetFrameworks>
<TargetFrameworks>netstandard1.4;net461;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<DebugType>embedded</DebugType>
</PropertyGroup>

<ItemGroup>

<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Condition="'$(TargetFramework)' != 'net45' " Include="System.Net.Http" Version="4.3.3" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Condition="'$(TargetFramework)' == 'netstandard1.4' " Include="System.Net.Http" Version="4.3.3" />
<Compile Remove="Features\**\*.*" />
<None Include="Features\**\*.*" />
</ItemGroup>
Expand All @@ -20,7 +20,7 @@
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
</ItemGroup>
Expand Down
29 changes: 0 additions & 29 deletions appveyor.yml

This file was deleted.

0 comments on commit 9dafef3

Please sign in to comment.