Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Use MinVer; Update copyright year
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Jan 22, 2019
1 parent dbc466a commit 6aa2aaf
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 18 deletions.
3 changes: 1 addition & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Project ToolsVersion="15.0">
<PropertyGroup>
<VersionPrefix>0.0.7</VersionPrefix>
<Authors>@jet @bartelink and contributors</Authors>
<Company>Jet.com</Company>
<Description>Apply systemwide resilience strategies consistently across subsystems, standing on Polly's shoulders</Description>
<PackageProjectUrl>https://github.com/jet/callpolly</PackageProjectUrl>
<PackageTags>polly bulkhead circuitbreaker timeout fsharp</PackageTags>
<PackageLicenseUrl>https://github.com/jet/callpolly/blob/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright © 2018</Copyright>
<Copyright>Copyright © 2018-9</Copyright>

<!-- SourceLink related properties https://github.com/dotnet/SourceLink#using-sourcelink -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down
14 changes: 14 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@
<Target Name="VSTestIfTestProject">
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
<Target Name="ComputePackageVersion" AfterTargets="MinVer" Condition=" '$(BUILD_PR)' != '' AND '$(BUILD_PR)' != '%24(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)' ">
<PropertyGroup>
<PackageVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-pr.$(BUILD_PR)</PackageVersion>
<PackageVersion Condition="'$(MinVerPreRelease)' != ''">$(PackageVersion).$(MinVerPreRelease)</PackageVersion>
<PackageVersion Condition="'$(MinVerBuildMetadata)' != ''">$(PackageVersion)+$(MinVerBuildMetadata)</PackageVersion>
<Version>$(PackageVersion)</Version>
</PropertyGroup>
</Target>
<Target Name="ComputeFileVersion" AfterTargets="MinVer">
<PropertyGroup>
<BUILD_ID Condition="'$(BUILD_ID)' == ''">0</BUILD_ID>
<FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BUILD_ID)</FileVersion>
</PropertyGroup>
</Target>
</Project>
24 changes: 12 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: $(Rev:r)
trigger:
- master
- refs/tags/*
jobs:
- job: Windows
pool:
Expand Down Expand Up @@ -26,18 +29,15 @@ jobs:
testResultsFormat: 'VSTest'
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- powershell: |
$buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0');
$versionSuffixPR = "ci-$buildId-pr$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)";
$branchName = "$env:BUILD_SOURCEBRANCHNAME".Replace("_","");
$versionSuffixBRANCH = "$branchName-$buildId";
$isTag = "$env:BUILD_SOURCEBRANCH".StartsWith('refs/tags/');
$isPR = "$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" -ne ""
$versionSuffix = if ($isTag) { "" } else { if ($isPR) { $versionSuffixPR } else { $versionSuffixBRANCH } };
Write-Host "##vso[task.setvariable variable=VersionSuffix]$versionSuffix";
displayName: compute VersionSuffix
- script: dotnet pack build.proj
displayName: dotnet pack
displayName: dotnet pack build.proj
env:
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)
BUILD_ID: $(BUILD.BUILDNUMBER)
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'bin'
artifactName: 'nupkgs'
- task: NuGetCommand@2
condition: succeededOrFailed()
inputs:
Expand All @@ -61,4 +61,4 @@ jobs:
testResultsFiles: 'tests/**/*.trx'
condition: succeededOrFailed()
- script: dotnet pack build.proj
displayName: dotnet pack
displayName: dotnet pack
6 changes: 4 additions & 2 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
<Cfg>--configuration Release</Cfg>

<ThisDirAbsolute>$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)"))</ThisDirAbsolute>
<PackOptions>-o $(ThisDirAbsolute)bin --version-suffix "$(VersionSuffix)"</PackOptions>
<TestOptions>--logger:trx</TestOptions>

<PrOption Condition =" '$(BUILD_PR)' != '%24(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)' ">/p:BUILD_PR=$(BUILD_PR) </PrOption>
<PackOptions>/p:BUILD_ID=$(BUILD_ID) $(PrOption) -o $(ThisDirAbsolute)bin</PackOptions>

<TestOptions>--logger:trx</TestOptions>
</PropertyGroup>

<Target Name="Pack">
Expand Down
4 changes: 3 additions & 1 deletion src/CallPolly.Core/CallPolly.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="1.0.0-beta.2" PrivateAssets="All" />

<PackageReference Include="FSharp.Core" Version="3.1.2.5" Condition=" '$(TargetFramework)' != 'netstandard2.0' " />
<PackageReference Include="FSharp.Core" Version="4.3.4" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Polly" Version="6.1.0" />
<PackageReference Include="Serilog" Version="2.7.1" />
</ItemGroup>

</Project>
</Project>
4 changes: 3 additions & 1 deletion src/CallPolly/CallPolly.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="1.0.0-beta.2" PrivateAssets="All" />

<PackageReference Include="FSharp.Core" Version="3.1.2.5" Condition=" '$(TargetFramework)' != 'netstandard2.0' " />
<PackageReference Include="FSharp.Core" Version="4.3.4" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
<PackageReference Include="Jet.JsonNet.Converters" Version="0.0.3-CI69140" />
Expand All @@ -29,4 +31,4 @@
<PackageReference Include="Serilog" Version="2.7.1" />
</ItemGroup>

</Project>
</Project>

0 comments on commit 6aa2aaf

Please sign in to comment.