Skip to content

Commit 6e5bee4

Browse files
committed
Use MinVer; Roll to 2019
1 parent 530ab34 commit 6e5bee4

File tree

6 files changed

+31
-16
lines changed

6 files changed

+31
-16
lines changed

Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<Project ToolsVersion="15.0">
22
<PropertyGroup>
3-
<VersionPrefix>0.2.1</VersionPrefix>
43
<Authors>@jet @amjjd @eiriktsarpalis and contributors</Authors>
54
<Company>Jet.com</Company>
65
<Description>Simple version-tolerant Newtonsoft.Json Converters for F# types</Description>
76
<PackageProjectUrl>https://github.com/jet/Jet.JsonNet.Converters</PackageProjectUrl>
87
<PackageTags>fsharp unionconverter JsonPickler json converters</PackageTags>
98
<PackageLicenseUrl>https://github.com/jet/Jet.JsonNet.Converters/blob/master/LICENSE</PackageLicenseUrl>
10-
<Copyright>Copyright © 2016-8</Copyright>
9+
<Copyright>Copyright © 2016-9</Copyright>
1110

1211
<!-- SourceLink related properties https://github.com/dotnet/SourceLink#using-sourcelink -->
1312
<PublishRepositoryUrl>true</PublishRepositoryUrl>

Directory.Build.targets

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project ToolsVersion="15.0">
2+
<Target Name="ComputePackageVersion" AfterTargets="MinVer" Condition=" '$(BUILD_PR)' != '' AND '$(BUILD_PR)' != '%24(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)' ">
3+
<PropertyGroup>
4+
<PackageVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-pr.$(BUILD_PR)</PackageVersion>
5+
<PackageVersion Condition="'$(MinVerPreRelease)' != ''">$(PackageVersion).$(MinVerPreRelease)</PackageVersion>
6+
<PackageVersion Condition="'$(MinVerBuildMetadata)' != ''">$(PackageVersion)+$(MinVerBuildMetadata)</PackageVersion>
7+
<Version>$(PackageVersion)</Version>
8+
</PropertyGroup>
9+
</Target>
10+
<Target Name="ComputeFileVersion" AfterTargets="MinVer">
11+
<PropertyGroup>
12+
<BUILD_ID Condition="'$(BUILD_ID)' == ''">0</BUILD_ID>
13+
<FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BUILD_ID)</FileVersion>
14+
</PropertyGroup>
15+
</Target>
16+
</Project>

Jet.JsonNet.Converters.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".project", ".project", "{1D
1313
build.proj = build.proj
1414
build.ps1 = build.ps1
1515
Directory.Build.props = Directory.Build.props
16+
Directory.Build.targets = Directory.Build.targets
1617
global.json = global.json
1718
LICENSE = LICENSE
1819
README.md = README.md

azure-pipelines.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
name: $(Rev:r)
2+
trigger:
3+
- master
4+
- refs/tags/*
25
jobs:
36
- job: Windows
47
pool:
@@ -11,20 +14,11 @@ jobs:
1114
testResultsFormat: 'VSTest'
1215
testResultsFiles: 'tests/**/*.trx'
1316
condition: succeededOrFailed()
14-
- powershell: |
15-
$buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0');
16-
$versionSuffixPR = "ci-$buildId-pr$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)";
17-
$branchName = "$env:BUILD_SOURCEBRANCHNAME".Replace("_","");
18-
$versionSuffixBRANCH = "$branchName-$buildId";
19-
$isTag = "$env:BUILD_SOURCEBRANCH".StartsWith('refs/tags/');
20-
$isPR = "$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" -ne ""
21-
$versionSuffix = if ($isTag) { "" } else { if ($isPR) { $versionSuffixPR } else { $versionSuffixBRANCH } };
22-
Write-Host "##vso[task.setvariable variable=VersionSuffix]$versionSuffix";
23-
displayName: compute VersionSuffix
2417
- script: dotnet pack build.proj
25-
displayName: dotnet pack
18+
displayName: dotnet pack build.proj
2619
env:
27-
VersionSuffix: '$(VersionSuffix)'
20+
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)
21+
BUILD_ID: $(BUILD.BUILDNUMBER)
2822
- task: PublishBuildArtifacts@1
2923
inputs:
3024
pathtoPublish: 'bin'

build.proj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
<Cfg>--configuration Release</Cfg>
77

88
<ThisDirAbsolute>$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)"))</ThisDirAbsolute>
9-
<PackOptions>-o $(ThisDirAbsolute)bin --version-suffix "$(VersionSuffix)"</PackOptions>
9+
10+
<PrOption Condition =" '$(BUILD_PR)' != '%24(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)' ">/p:BUILD_PR=$(BUILD_PR) </PrOption>
11+
<PackOptions>/p:BUILD_ID=$(BUILD_ID) $(PrOption) -o $(ThisDirAbsolute)bin</PackOptions>
12+
1013
<TestOptions>--logger:trx</TestOptions>
1114
</PropertyGroup>
1215

src/Jet.JsonNet.Converters/Jet.JsonNet.Converters.fsproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818

1919
<ItemGroup>
2020
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
21+
<PackageReference Include="MinVer" Version="1.0.0-beta.2" PrivateAssets="All" />
22+
2123
<PackageReference Include="FSharp.Core" Version="3.1.2.5" Condition=" '$(TargetFramework)' != 'netstandard2.0' " />
2224
<PackageReference Include="FSharp.Core" Version="4.3.4" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
2325
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
2426
</ItemGroup>
2527

26-
</Project>
28+
</Project>

0 commit comments

Comments
 (0)