This commit is contained in:
Oren Novotny 2017-08-26 23:34:55 -04:00
Родитель 87e7a1ed16
Коммит 6c8418f12c
15 изменённых файлов: 140 добавлений и 158 удалений

Просмотреть файл

@ -9,7 +9,35 @@
<PackageLicenseUrl>https://github.com/Microsoft/UWPCommunityToolkit/blob/master/license.md</PackageLicenseUrl>
<PackageReleaseNotes>v2.0: https://github.com/Microsoft/UWPCommunityToolkit/releases/tag/v2.0.0 </PackageReleaseNotes>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Toolkit.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.2.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="15.3.83" PrivateAssets="All" />
</ItemGroup>
<PropertyGroup>
<NerdbankGitVersioningVersion>2.0.37-beta</NerdbankGitVersioningVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.0.37-beta" PrivateAssets="all" />
</ItemGroup>
<!-- https://github.com/NuGet/Home/issues/4337 -->
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' == 'true' ">
<Import Project="$(UserProfile)\.nuget\packages\nerdbank.gitversioning\$(NerdbankGitVersioningVersion)\buildCrossTargeting\Nerdbank.GitVersioning.targets"
Condition="Exists('$(UserProfile)\.nuget\packages\nerdbank.gitversioning\$(NerdbankGitVersioningVersion)\buildCrossTargeting\Nerdbank.GitVersioning.targets')" />
</ImportGroup>
<Target Name="FixUpVersion"
BeforeTargets="_GenerateRestoreProjectSpec"
DependsOnTargets="GetBuildVersion"
Condition=" '$(NerdbankGitVersioningTasksPath)' != '' " />
</Project>

Просмотреть файл

@ -1,55 +0,0 @@
mode: ContinuousDeployment
next-version: 0.9.0
tag-prefix: '[vV]'
continuous-delivery-fallback-tag: ci
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
legacy-semver-padding: 5
build-metadata-padding: 5
commits-since-version-source-padding: 5
commit-message-incrementing: Enabled
branches:
master:
mode: ContinuousDeployment
tag: build
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
releases?[/-]:
mode: ContinuousDeployment
tag: rc
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
features?[/-]:
mode: ContinuousDeployment
tag: useBranchName
increment: Inherit
prevent-increment-of-merged-branch-version: false
track-merge-target: false
(pull|pull\-requests|pr)[/-]:
mode: ContinuousDeployment
tag: PullRequest
increment: Inherit
prevent-increment-of-merged-branch-version: false
tag-number-pattern: '[/-](?<number>\d+)[-/]'
track-merge-target: false
hotfix(es)?[/-]:
mode: ContinuousDeployment
tag: beta
increment: Patch
prevent-increment-of-merged-branch-version: false
track-merge-target: false
support[/-]:
mode: ContinuousDeployment
tag: ''
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
dev(elop)?(ment)?$:
mode: ContinuousDeployment
tag: dev
increment: Minor
prevent-increment-of-merged-branch-version: false
track-merge-target: true

Просмотреть файл

@ -25,16 +25,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -25,7 +25,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: AssemblyInformationalVersion("1.2.1-developerTools.821+Branch.developerTools.Sha.9a3bfd5760c1cb9e03a099728d013fe40c4e7c53")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -25,14 +25,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -25,16 +25,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -25,7 +25,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyInformationalVersion("0.0.1-local")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -25,14 +25,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -26,15 +26,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("UniversalMarkdownUnitTests")]

Просмотреть файл

@ -25,14 +25,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -25,14 +25,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: ComVisible(false)]

80
Toolkit.ruleset Normal file
Просмотреть файл

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Microsoft Managed Recommended Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects." ToolsVersion="10.0">
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
<Name Resource="MinimumRecommendedRules_Name" />
<Description Resource="MinimumRecommendedRules_Description" />
</Localization>
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1001" Action="Warning" />
<Rule Id="CA1009" Action="Warning" />
<Rule Id="CA1016" Action="Warning" />
<Rule Id="CA1033" Action="Warning" />
<Rule Id="CA1049" Action="Warning" />
<Rule Id="CA1060" Action="Warning" />
<Rule Id="CA1061" Action="Warning" />
<Rule Id="CA1063" Action="Warning" />
<Rule Id="CA1065" Action="Warning" />
<Rule Id="CA1301" Action="Warning" />
<Rule Id="CA1400" Action="Warning" />
<Rule Id="CA1401" Action="Warning" />
<Rule Id="CA1403" Action="Warning" />
<Rule Id="CA1404" Action="Warning" />
<Rule Id="CA1405" Action="Warning" />
<Rule Id="CA1410" Action="Warning" />
<Rule Id="CA1415" Action="Warning" />
<Rule Id="CA1821" Action="Warning" />
<Rule Id="CA1900" Action="Warning" />
<Rule Id="CA1901" Action="Warning" />
<Rule Id="CA2002" Action="Warning" />
<Rule Id="CA2100" Action="Warning" />
<Rule Id="CA2101" Action="Warning" />
<Rule Id="CA2108" Action="Warning" />
<Rule Id="CA2111" Action="Warning" />
<Rule Id="CA2112" Action="Warning" />
<Rule Id="CA2114" Action="Warning" />
<Rule Id="CA2116" Action="Warning" />
<Rule Id="CA2117" Action="Warning" />
<Rule Id="CA2122" Action="Warning" />
<Rule Id="CA2123" Action="Warning" />
<Rule Id="CA2124" Action="Warning" />
<Rule Id="CA2126" Action="Warning" />
<Rule Id="CA2131" Action="Warning" />
<Rule Id="CA2132" Action="Warning" />
<Rule Id="CA2133" Action="Warning" />
<Rule Id="CA2134" Action="Warning" />
<Rule Id="CA2137" Action="Warning" />
<Rule Id="CA2138" Action="Warning" />
<Rule Id="CA2140" Action="Warning" />
<Rule Id="CA2141" Action="Warning" />
<Rule Id="CA2146" Action="Warning" />
<Rule Id="CA2147" Action="Warning" />
<Rule Id="CA2149" Action="Warning" />
<Rule Id="CA2200" Action="Warning" />
<Rule Id="CA2202" Action="Warning" />
<Rule Id="CA2207" Action="Warning" />
<Rule Id="CA2212" Action="Warning" />
<Rule Id="CA2213" Action="Warning" />
<Rule Id="CA2214" Action="Warning" />
<Rule Id="CA2216" Action="Warning" />
<Rule Id="CA2220" Action="Warning" />
<Rule Id="CA2229" Action="Warning" />
<Rule Id="CA2231" Action="Warning" />
<Rule Id="CA2232" Action="Warning" />
<Rule Id="CA2235" Action="Warning" />
<Rule Id="CA2236" Action="Warning" />
<Rule Id="CA2237" Action="Warning" />
<Rule Id="CA2238" Action="Warning" />
<Rule Id="CA2240" Action="Warning" />
<Rule Id="CA2241" Action="Warning" />
<Rule Id="CA2242" Action="Warning" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1633" Action="None" />
<Rule Id="SA1200" Action="None" />
<Rule Id="SA1201" Action="None" />
<Rule Id="SA1309" Action="None" />
<Rule Id="SA1634" Action="None" />
<Rule Id="SA1652" Action="None" />
</Rules>
</RuleSet>

Просмотреть файл

@ -50,6 +50,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests.Notifications.Win
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CFA75BE0-5A44-45DE-8114-426A605B062B}"
ProjectSection(SolutionItems) = preProject
build\default.ps1 = build\default.ps1
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
EndProjectSection

Просмотреть файл

@ -14,7 +14,6 @@ properties {
$nupkgDir = "$binDir\nupkg"
$nuget = "$toolsDir\nuget\nuget.exe"
$gitversion = "$toolsDir\gitversion\gitversion.exe"
$signClientSettings = "$buildDir\SignClientSettings.json"
$hasSignClientSecret = !([string]::IsNullOrEmpty($env:SignClientSecret))
@ -101,38 +100,27 @@ task Verify -description "Run pre-build verifications" {
task Version -description "Updates the version entries in AssemblyInfo.cs files" {
WriteColoredOutput -ForegroundColor Green "Downloading GitVersion...`n"
Exec { .$nuget install -excludeversion gitversion.commandline -outputdirectory $tempDir } "Error downloading GitVersion"
WriteColoredOutput -ForegroundColor Green "Restoring AssemblyInfo.cs files...`n"
Get-ChildItem $sourceDir -re -in AssemblyInfo.cs | % {
git checkout $_
}
WriteColoredOutput -ForegroundColor Green "Updating AssemblyInfo.cs files...`n"
Exec { .$tempDir\gitversion.commandline\tools\gitversion.exe $sourceDir /l console /output buildserver /updateassemblyinfo /nofetch } "Error updating GitVersion"
Exec { .$nuget install -excludeversion nerdbank.gitversioning -pre -Version 2.0.37-beta -outputdirectory $tempDir } "Error downloading Nerdbank.GitVersion"
WriteColoredOutput -ForegroundColor Green "Retrieving version...`n"
$versionObj = .$tempDir\gitversion.commandline\tools\gitversion.exe /nofetch | ConvertFrom-Json
$versionObj = .$tempDir\nerdbank.gitversioning\tools\Get-Version.ps1
$script:version = $versionObj.NuGetVersionV2
$script:version = $versionObj.NuGetPackageVersion
WriteColoredOutput -ForegroundColor Green "Build version: $script:version`n"
}
task Build -depends Clean, Setup, Verify, Version -description "Build all projects and get the assemblies" {
New-Item -Path $binariesDir -ItemType Directory | Out-Null
Exec { msbuild "/t:Restore" /p:Configuration=Release "/p:OutDir=$binariesDir" "/p:PackageOutputPath=$nupkgDir" /p:GeneratePackageOnBuild=true /p:GenerateProjectSpecificOutputFolder=true /p:TreatWarningsAsErrors=false /p:GenerateLibraryLayout=true /m "$sourceDir\UWP Community Toolkit.sln" } "Error restoring $solutionFile"
Exec { msbuild "/t:Build" /p:Configuration=Release "/p:OutDir=$binariesDir" "/p:PackageOutputPath=$nupkgDir" /p:GeneratePackageOnBuild=true /p:GenerateProjectSpecificOutputFolder=true /p:TreatWarningsAsErrors=false /p:GenerateLibraryLayout=true /m "$sourceDir\UWP Community Toolkit.sln" } "Error building $solutionFile"
WriteColoredOutput -ForegroundColor Green "Restoring AssemblyInfo.cs files...`n"
# Force a restore again to get proper version numbers https://github.com/NuGet/Home/issues/4337
Exec { msbuild "/t:Restore" /p:Configuration=Release "/p:OutDir=$binariesDir" "/p:PackageOutputPath=$nupkgDir" /p:GeneratePackageOnBuild=true /p:GenerateProjectSpecificOutputFolder=true /p:TreatWarningsAsErrors=false /p:GenerateLibraryLayout=true /m "$sourceDir\UWP Community Toolkit.sln" } "Error restoring $solutionFile"
Exec { msbuild "/t:Restore" /p:Configuration=Release "/p:OutDir=$binariesDir" "/p:PackageOutputPath=$nupkgDir" /p:GeneratePackageOnBuild=true /p:GenerateProjectSpecificOutputFolder=true /p:TreatWarningsAsErrors=false /p:GenerateLibraryLayout=true /m "$sourceDir\UWP Community Toolkit.sln" } "Error restoring $solutionFile"
Get-ChildItem $sourceDir -re -in AssemblyInfo.cs | % {
git checkout $_
}
Exec { msbuild "/t:Build" /p:Configuration=Release "/p:OutDir=$binariesDir" "/p:PackageOutputPath=$nupkgDir" /p:GeneratePackageOnBuild=true /p:GenerateProjectSpecificOutputFolder=true /p:TreatWarningsAsErrors=false /p:GenerateLibraryLayout=true /m "$sourceDir\UWP Community Toolkit.sln" } "Error building $solutionFile"
}
task PackNuGet -depends Build -description "Create the NuGet packages" {
@ -147,9 +135,9 @@ task PackNuGet -depends Build -description "Create the NuGet packages" {
task PackNuGetNoBuild -description "Create the NuGet packages with existing binaries" {
New-Item -Path $nupkgDir -ItemType Directory | Out-Null
$versionObj = .$tempDir\gitversion.commandline\tools\gitversion.exe | ConvertFrom-Json
$versionObj = .$tempDir\nerdbank.gitversioning\tools\Get-Version.ps1
$version = $versionObj.NuGetVersionV2
$version = $versionObj.NuGetPackageVersion
Get-ChildItem $buildDir\*.nuspec | % {
$fullFilename = $_.FullName

16
version.json Normal file
Просмотреть файл

@ -0,0 +1,16 @@
{
"version": "2.1.0-build.{height}",
"publicReleaseRefSpec": [
"^refs/heads/master$", // we release out of master
"^refs/heads/dev$", // we release out of dev
"^refs/heads/v\\d+\\.\\d+" // we also release branches starting with vN.N
],
"nugetPackageVersion":{
"semVer": 2
},
"cloudBuild": {
"buildNumber": {
"enabled": true
}
}
}