Skip to content
This repository was archived by the owner on Apr 8, 2019. It is now read-only.

Commit c0b984e

Browse files
committed
Use Nerdbank.GitVersioning
1 parent 00d050b commit c0b984e

File tree

11 files changed

+35
-131
lines changed

11 files changed

+35
-131
lines changed

PublicApiAnalyzer.sln

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@ EndProject
2525
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7B1E5C00-D8DB-41A6-AEB4-671EF3AD3586}"
2626
ProjectSection(SolutionItems) = preProject
2727
build\build.ps1 = build\build.ps1
28-
build\check-key.ps1 = build\check-key.ps1
2928
PublicApiAnalyzer\Directory.Build.props = PublicApiAnalyzer\Directory.Build.props
3029
PublicApiAnalyzer\Directory.Build.targets = PublicApiAnalyzer\Directory.Build.targets
31-
build\keys.ps1 = build\keys.ps1
3230
build\opencover-report.ps1 = build\opencover-report.ps1
33-
build\push.ps1 = build\push.ps1
34-
build\version.ps1 = build\version.ps1
3531
EndProjectSection
3632
EndProject
3733
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "documentation", "documentation", "{443032E9-3E95-4023-8E4B-51825BB94EE7}"

PublicApiAnalyzer/Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
<Company>Tunnel Vision Laboratories, LLC</Company>
88
<Copyright>Copyright © Tunnel Vision Laboratories, LLC 2015</Copyright>
99
<NeutralLanguage>en-US</NeutralLanguage>
10-
11-
<Version>1.0.0.2</Version>
12-
<FileVersion>1.0.0.2</FileVersion>
13-
<InformationalVersion>1.0.0-dev</InformationalVersion>
1410
</PropertyGroup>
1511

1612
<PropertyGroup>
@@ -49,6 +45,10 @@
4945
<NoWarn>$(NoWarn),1573,1591</NoWarn>
5046
</PropertyGroup>
5147

48+
<ItemGroup>
49+
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.13" PrivateAssets="all" />
50+
</ItemGroup>
51+
5252
<ItemGroup>
5353
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
5454
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004" PrivateAssets="all" />

PublicApiAnalyzer/PublicApiAnalyzer.CodeFixes/PublicApiAnalyzer.CodeFixes.csproj

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
88
<IncludeSymbols>true</IncludeSymbols>
99
<NuspecFile>PublicApiAnalyzer.nuspec</NuspecFile>
10-
<NuspecProperties>configuration=$(Configuration);version=$(InformationalVersion)</NuspecProperties>
10+
</PropertyGroup>
11+
12+
<PropertyGroup>
13+
<!-- This package intentionally uses SemVer 2. -->
14+
<NoWarn>$(NoWarn),NU5105</NoWarn>
1115
</PropertyGroup>
1216

1317
<Choose>
@@ -24,12 +28,7 @@
2428

2529
<PropertyGroup>
2630
<SignAssembly>true</SignAssembly>
27-
<AssemblyOriginatorKeyFile Condition="'$(KeyConfiguration)' == 'Final'">..\..\build\keys\PublicApiAnalyzer.snk</AssemblyOriginatorKeyFile>
28-
<AssemblyOriginatorKeyFile Condition="'$(KeyConfiguration)' != 'Final'">..\..\build\keys\PublicApiAnalyzer.dev.snk</AssemblyOriginatorKeyFile>
29-
</PropertyGroup>
30-
31-
<PropertyGroup Condition="'$(KeyConfiguration)' != 'Final'">
32-
<DefineConstants>$(DefineConstants);DEVELOPMENT_KEY</DefineConstants>
31+
<AssemblyOriginatorKeyFile>..\..\build\keys\PublicApiAnalyzer.snk</AssemblyOriginatorKeyFile>
3332
</PropertyGroup>
3433

3534
<ItemGroup>
@@ -52,4 +51,10 @@
5251
<AdditionalFiles Include="PublicAPI.Unshipped.txt" />
5352
</ItemGroup>
5453

54+
<Target Name="SetNuspecProperties" AfterTargets="GetBuildVersion">
55+
<PropertyGroup>
56+
<NuspecProperties>configuration=$(Configuration);version=$(PackageVersion)</NuspecProperties>
57+
</PropertyGroup>
58+
</Target>
59+
5560
</Project>

PublicApiAnalyzer/PublicApiAnalyzer/PublicApiAnalyzer.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020

2121
<PropertyGroup>
2222
<SignAssembly>true</SignAssembly>
23-
<AssemblyOriginatorKeyFile Condition="'$(KeyConfiguration)' == 'Final'">..\..\build\keys\PublicApiAnalyzer.snk</AssemblyOriginatorKeyFile>
24-
<AssemblyOriginatorKeyFile Condition="'$(KeyConfiguration)' != 'Final'">..\..\build\keys\PublicApiAnalyzer.dev.snk</AssemblyOriginatorKeyFile>
25-
</PropertyGroup>
26-
27-
<PropertyGroup Condition="'$(KeyConfiguration)' != 'Final'">
28-
<DefineConstants>$(DefineConstants);DEVELOPMENT_KEY</DefineConstants>
23+
<AssemblyOriginatorKeyFile>..\..\build\keys\PublicApiAnalyzer.snk</AssemblyOriginatorKeyFile>
2924
</PropertyGroup>
3025

3126
<ItemGroup>

PublicApiAnalyzer/version.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3+
"version": "1.0.0-beta.{height}",
4+
"assemblyVersion": {
5+
"precision": "revision"
6+
},
7+
"publicReleaseRefSpec": [
8+
"^refs/heads/master$"
9+
],
10+
"nugetPackageVersion": {
11+
"semVer": 2
12+
},
13+
"cloudBuild": {
14+
"buildNumber": {
15+
"enabled": true
16+
}
17+
}
18+
}

build/build.ps1

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
param (
22
[switch]$Debug,
33
[string]$VisualStudioVersion = '15.0',
4-
[switch]$SkipKeyCheck,
54
[string]$Verbosity = 'minimal',
65
[string]$Logger,
76
[switch]$Incremental
@@ -16,20 +15,12 @@ if (!(Test-Path $SolutionPath)) {
1615
exit 1
1716
}
1817

19-
. .\version.ps1
20-
2118
If ($Debug) {
2219
$BuildConfig = 'Debug'
2320
} Else {
2421
$BuildConfig = 'Release'
2522
}
2623

27-
If ($Version.Contains('-')) {
28-
$KeyConfiguration = 'Dev'
29-
} Else {
30-
$KeyConfiguration = 'Final'
31-
}
32-
3324
# download NuGet.exe if necessary
3425
$nuget = '..\.nuget\NuGet.exe'
3526
If (-not (Test-Path $nuget)) {
@@ -80,38 +71,3 @@ If (-not $?) {
8071
$host.ui.WriteErrorLine('Build failed, aborting!')
8172
exit $LASTEXITCODE
8273
}
83-
84-
if ($Incremental) {
85-
# Skip NuGet validation and copying packages to the output directory
86-
exit 0
87-
}
88-
89-
# By default, do not create a NuGet package unless the expected strong name key files were used
90-
if (-not $SkipKeyCheck) {
91-
. .\keys.ps1
92-
93-
foreach ($pair in $Keys.GetEnumerator()) {
94-
$assembly = Resolve-FullPath -Path "..\PublicApiAnalyzer\PublicApiAnalyzer.CodeFixes\bin\$BuildConfig\$($pair.Key)\PublicApiAnalyzer.dll"
95-
# Run the actual check in a separate process or the current process will keep the assembly file locked
96-
powershell -Command ".\check-key.ps1 -Assembly '$assembly' -ExpectedKey '$($pair.Value)' -Build '$($pair.Key)'"
97-
If (-not $?) {
98-
$host.ui.WriteErrorLine('Failed to verify strong name key for build, aborting!')
99-
exit $LASTEXITCODE
100-
}
101-
102-
$assembly = Resolve-FullPath -Path "..\PublicApiAnalyzer\PublicApiAnalyzer.CodeFixes\bin\$BuildConfig\$($pair.Key)\PublicApiAnalyzer.CodeFixes.dll"
103-
# Run the actual check in a separate process or the current process will keep the assembly file locked
104-
powershell -Command ".\check-key.ps1 -Assembly '$assembly' -ExpectedKey '$($pair.Value)' -Build '$($pair.Key)'"
105-
If (-not $?) {
106-
$host.ui.WriteErrorLine('Failed to verify strong name key for build, aborting!')
107-
exit $LASTEXITCODE
108-
}
109-
}
110-
}
111-
112-
if (-not (Test-Path 'nuget')) {
113-
mkdir "nuget"
114-
}
115-
116-
Copy-Item "..\PublicApiAnalyzer\PublicApiAnalyzer.CodeFixes\bin\$BuildConfig\PublicApiAnalyzer.$Version.nupkg" 'nuget'
117-
Copy-Item "..\PublicApiAnalyzer\PublicApiAnalyzer.CodeFixes\bin\$BuildConfig\PublicApiAnalyzer.$Version.symbols.nupkg" 'nuget'

build/check-key.ps1

Lines changed: 0 additions & 31 deletions
This file was deleted.

build/keys.ps1

Lines changed: 0 additions & 22 deletions
This file was deleted.

build/keys/PublicApiAnalyzer.dev.snk

-596 Bytes
Binary file not shown.

build/push.ps1

Lines changed: 0 additions & 12 deletions
This file was deleted.

build/version.ps1

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)