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

Commit 82fc62b

Browse files
authored
Merge pull request #23 from sharwell/gitversioning
Use Nerdbank.GitVersioning
2 parents 00d050b + 2957d9a commit 82fc62b

21 files changed

+279
-199
lines changed

.nuget/packages.config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Codecov" version="1.0.1" />
4-
<package id="OpenCover" version="4.6.247-rc" />
3+
<package id="Codecov" version="1.1.0" />
4+
<package id="Microsoft.DiaSymReader.Pdb2Pdb" version="1.1.0-beta1-62624-01" />
5+
<package id="OpenCover" version="4.6.519" />
56
<package id="ReportGenerator" version="2.3.5.0" targetFramework="net452" />
67
<package id="xunit.runner.console" version="2.1.0" targetFramework="net452" />
78
</packages>

LICENSE

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,3 @@ Unless required by applicable law or agreed to in writing, software distributed
1010
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
1111
CONDITIONS OF ANY KIND, either express or implied. See the License for the
1212
specific language governing permissions and limitations under the License.
13-
14-
---
15-
16-
This project uses other open source projects, which are used under the terms
17-
of the following license(s).
18-
19-
.NET Compiler Platform ("Roslyn")
20-
21-
Copyright Microsoft.
22-
23-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
24-
these files except in compliance with the License. You may obtain a copy of the
25-
License at
26-
27-
http://www.apache.org/licenses/LICENSE-2.0
28-
29-
Unless required by applicable law or agreed to in writing, software distributed
30-
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
31-
CONDITIONS OF ANY KIND, either express or implied. See the License for the
32-
specific language governing permissions and limitations under the License.
33-
34-
StyleCop Analyzers
35-
36-
Copyright 2015 Tunnel Vision Laboratories, LLC.
37-
38-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
39-
these files except in compliance with the License. You may obtain a copy of the
40-
License at
41-
42-
http://www.apache.org/licenses/LICENSE-2.0
43-
44-
Unless required by applicable law or agreed to in writing, software distributed
45-
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
46-
CONDITIONS OF ANY KIND, either express or implied. See the License for the
47-
specific language governing permissions and limitations under the License.

NuGet.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="symreader-converter" value="https://dotnet.myget.org/F/symreader-converter/api/v3/index.json" />
5+
</packageSources>
6+
</configuration>

PublicApiAnalyzer.sln

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2020
CONTRIBUTING.md = CONTRIBUTING.md
2121
LICENSE = LICENSE
2222
README.md = README.md
23+
THIRD-PARTY-NOTICES.txt = THIRD-PARTY-NOTICES.txt
2324
EndProjectSection
2425
EndProject
2526
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7B1E5C00-D8DB-41A6-AEB4-671EF3AD3586}"
2627
ProjectSection(SolutionItems) = preProject
2728
build\build.ps1 = build\build.ps1
28-
build\check-key.ps1 = build\check-key.ps1
2929
PublicApiAnalyzer\Directory.Build.props = PublicApiAnalyzer\Directory.Build.props
3030
PublicApiAnalyzer\Directory.Build.targets = PublicApiAnalyzer\Directory.Build.targets
31-
build\keys.ps1 = build\keys.ps1
3231
build\opencover-report.ps1 = build\opencover-report.ps1
33-
build\push.ps1 = build\push.ps1
34-
build\version.ps1 = build\version.ps1
3532
EndProjectSection
3633
EndProject
3734
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "documentation", "documentation", "{443032E9-3E95-4023-8E4B-51825BB94EE7}"

PublicApiAnalyzer/Directory.Build.props

Lines changed: 6 additions & 11 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>
@@ -27,13 +23,8 @@
2723
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2824
</PropertyGroup>
2925

30-
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
31-
<DebugType>full</DebugType>
32-
<DebugSymbols>true</DebugSymbols>
33-
</PropertyGroup>
34-
35-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
36-
<DebugType>pdbonly</DebugType>
26+
<PropertyGroup>
27+
<DebugType>portable</DebugType>
3728
<DebugSymbols>true</DebugSymbols>
3829
</PropertyGroup>
3930

@@ -49,6 +40,10 @@
4940
<NoWarn>$(NoWarn),1573,1591</NoWarn>
5041
</PropertyGroup>
5142

43+
<ItemGroup>
44+
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.13" PrivateAssets="all" />
45+
</ItemGroup>
46+
5247
<ItemGroup>
5348
<PackageReference Include="AsyncUsageAnalyzers" Version="1.0.0-alpha003" PrivateAssets="all" />
5449
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004" PrivateAssets="all" />

PublicApiAnalyzer/PublicApiAnalyzer.CodeFixes/PublicApiAnalyzer.CodeFixes.csproj

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66
<RootNamespace>PublicApiAnalyzer</RootNamespace>
77
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
88
<IncludeSymbols>true</IncludeSymbols>
9-
<NuspecFile>PublicApiAnalyzer.nuspec</NuspecFile>
10-
<NuspecProperties>configuration=$(Configuration);version=$(InformationalVersion)</NuspecProperties>
9+
<NuspecFile Condition="'$(MetadataPackage)' != 'true'">PublicApiAnalyzer.nuspec</NuspecFile>
10+
<NuspecFile Condition="'$(MetadataPackage)' == 'true'">PublicApiAnalyzer.Metadata.nuspec</NuspecFile>
11+
</PropertyGroup>
12+
13+
<PropertyGroup>
14+
<!-- This package intentionally uses SemVer 2. -->
15+
<NoWarn>$(NoWarn),NU5105</NoWarn>
1116
</PropertyGroup>
1217

1318
<Choose>
@@ -24,12 +29,7 @@
2429

2530
<PropertyGroup>
2631
<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>
32+
<AssemblyOriginatorKeyFile>..\..\build\keys\PublicApiAnalyzer.snk</AssemblyOriginatorKeyFile>
3333
</PropertyGroup>
3434

3535
<ItemGroup>
@@ -52,4 +52,38 @@
5252
<AdditionalFiles Include="PublicAPI.Unshipped.txt" />
5353
</ItemGroup>
5454

55+
<Target Name="SetNuspecProperties" AfterTargets="GetBuildVersion">
56+
<PropertyGroup>
57+
<BaseNuspecId>DotNetAnalyzers.PublicApiAnalyzer</BaseNuspecId>
58+
<ImplementationNuspecId>$(BaseNuspecId)</ImplementationNuspecId>
59+
<MetadataNuspecId>$(BaseNuspecId)</MetadataNuspecId>
60+
61+
<ImplementationNuspecId Condition="'$(PrereleaseVersion)' != ''">$(BaseNuspecId).Unstable</ImplementationNuspecId>
62+
<MetadataNuspecId Condition="'$(PrereleaseVersion)' == ''">$(BaseNuspecId).Unstable</MetadataNuspecId>
63+
64+
<NuspecId Condition="'$(MetadataPackage)' != 'true'">$(ImplementationNuspecId)</NuspecId>
65+
<NuspecId Condition="'$(MetadataPackage)' == 'true'">$(MetadataNuspecId)</NuspecId>
66+
67+
<NuspecUnstableVersion>$(AssemblyVersion)</NuspecUnstableVersion>
68+
<NuspecUnstableVersion Condition="'$(PublicRelease)' != 'true'">$(NuspecUnstableVersion)-g$(GitCommitIdShort)</NuspecUnstableVersion>
69+
<NuspecStableVersion>$(PackageVersion)</NuspecStableVersion>
70+
71+
<UnstablePackage Condition="('$(PrereleaseVersion)' != '' AND '$(MetadataPackage)' != 'true') OR ('$(PrereleaseVersion)' == '' AND '$(MetadataPackage)' == 'true')">true</UnstablePackage>
72+
73+
<NuspecVersion Condition="'$(UnstablePackage)' != 'true'">$(NuspecStableVersion)</NuspecVersion>
74+
<NuspecVersion Condition="'$(UnstablePackage)' == 'true'">$(NuspecUnstableVersion)</NuspecVersion>
75+
76+
<ImplementationNuspecVersion Condition="'$(PrereleaseVersion)' != ''">$(NuspecUnstableVersion)</ImplementationNuspecVersion>
77+
<ImplementationNuspecVersion Condition="'$(PrereleaseVersion)' == ''">$(NuspecStableVersion)</ImplementationNuspecVersion>
78+
79+
<NuspecProperties>id=$(NuspecId);configuration=$(Configuration);GitCommitIdShort=$(GitCommitIdShort);version=$(NuspecVersion);tag=$(NuspecStableVersion);implId=$(ImplementationNuspecId);implVersion=$(ImplementationNuspecVersion)</NuspecProperties>
80+
</PropertyGroup>
81+
</Target>
82+
83+
<Target Name="PackMetadata" AfterTargets="Pack" Condition="'$(MetadataPackage)' != 'true'">
84+
<MSBuild Projects="$(MSBuildProjectFullPath)"
85+
Targets="Pack"
86+
Properties="MetadataPackage=true;IncludeSymbols=false" />
87+
</Target>
88+
5589
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0"?>
2+
<package>
3+
<metadata minClientVersion="2.7">
4+
<id>$id$</id>
5+
<version>0.0.0</version>
6+
<title>$id$</title>
7+
<authors>Sam Harwell et. al.</authors>
8+
<owners>Sam Harwell</owners>
9+
<licenseUrl>https://raw.githubusercontent.com/DotNetAnalyzers/PublicApiAnalyzer/$GitCommitIdShort$/LICENSE</licenseUrl>
10+
<projectUrl>https://github.com/DotNetAnalyzers/PublicApiAnalyzer</projectUrl>
11+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<description>An analyzer for packages with public APIs.</description>
13+
<releaseNotes>https://github.com/DotNetAnalyzers/PublicApiAnalyzer/releases/$tag$</releaseNotes>
14+
<copyright>Copyright Sam Harwell 2015</copyright>
15+
<tags>API DotNetAnalyzers Roslyn Diagnostic Analyzer</tags>
16+
<developmentDependency>true</developmentDependency>
17+
<dependencies>
18+
<dependency id="$implId$" version="$implVersion$"/>
19+
</dependencies>
20+
</metadata>
21+
<files>
22+
23+
<!-- Additional Files -->
24+
<file src="..\..\LICENSE" />
25+
<file src="..\..\THIRD-PARTY-NOTICES.txt" />
26+
27+
</files>
28+
</package>

PublicApiAnalyzer/PublicApiAnalyzer.CodeFixes/PublicApiAnalyzer.nuspec

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0"?>
22
<package>
33
<metadata minClientVersion="2.7">
4-
<id>PublicApiAnalyzer</id>
4+
<id>$id$</id>
55
<version>0.0.0</version>
6-
<title>Public API Analyzer</title>
6+
<title>$id$</title>
77
<authors>Sam Harwell et. al.</authors>
88
<owners>Sam Harwell</owners>
99
<licenseUrl>https://raw.githubusercontent.com/DotNetAnalyzers/PublicApiAnalyzer/$version$/LICENSE</licenseUrl>
@@ -17,6 +17,10 @@
1717
</metadata>
1818
<files>
1919

20+
<!-- Additional Files -->
21+
<file src="..\..\LICENSE" />
22+
<file src="..\..\THIRD-PARTY-NOTICES.txt" />
23+
2024
<!-- Binaries and symbols -->
2125
<file src="bin\$Configuration$\netstandard1.1\PublicApiAnalyzer.dll" target="analyzers\dotnet\cs" />
2226
<file src="bin\$Configuration$\netstandard1.1\**\PublicApiAnalyzer.resources.dll" target="analyzers\dotnet\cs" />

PublicApiAnalyzer/PublicApiAnalyzer/PublicApiAnalyzer.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
<PropertyGroup>
55
<TargetFrameworks>netstandard1.1;net452</TargetFrameworks>
6-
<PackageId>PublicApiAnalyzer.NewIdRequiredDueToNuGetBug</PackageId>
76
</PropertyGroup>
87

98
<Choose>
@@ -20,12 +19,7 @@
2019

2120
<PropertyGroup>
2221
<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>
22+
<AssemblyOriginatorKeyFile>..\..\build\keys\PublicApiAnalyzer.snk</AssemblyOriginatorKeyFile>
2923
</PropertyGroup>
3024

3125
<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+
}

0 commit comments

Comments
 (0)