Skip to content

Commit

Permalink
Add Nerdbank.GitVersining
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Dec 17, 2018
1 parent 71096ba commit 0a85dfc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 28 deletions.
21 changes: 21 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>

<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
<_Parameter1>CommitHash</_Parameter1>
<_Parameter2>$(SourceRevisionId)</_Parameter2>
</AssemblyAttribute>

<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(PublicRelease)' == 'true' ">
<_Parameter1>CloudBuildNumber</_Parameter1>
<_Parameter2>$(BuildVersionSimple)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(PublicRelease)' == 'false' ">
<_Parameter1>CloudBuildNumber</_Parameter1>
<_Parameter2>$(BuildVersionSimple)$(SemVerBuildSuffix)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>

</Target>
</Project>
6 changes: 4 additions & 2 deletions src/BehaviorsSdk.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26222.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.28407.52
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Xaml.Behaviors", "Microsoft.Xaml.Behaviors\Microsoft.Xaml.Behaviors.csproj", "{8620C598-B704-429E-BCA5-7E5DDE506923}"
EndProject
Expand All @@ -12,7 +12,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\.editorconfig = ..\.editorconfig
..\azure-pipelines.yml = ..\azure-pipelines.yml
..\Directory.Build.props = ..\Directory.Build.props
..\Directory.Build.targets = ..\Directory.Build.targets
..\README.md = ..\README.md
..\version.json = ..\version.json
EndProjectSection
EndProject
Global
Expand Down
27 changes: 1 addition & 26 deletions src/Microsoft.Xaml.Behaviors/Microsoft.Xaml.Behaviors.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net45</TargetFrameworks>
<OutputType>Library</OutputType>
<PackageId>Microsoft.Xaml.Behaviors.Wpf</PackageId>
<Version>1.0.1</Version>
<Title>Microsoft.Xaml.Behaviors.Wpf</Title>
<Authors>Microsoft</Authors>
<Description>Easily add interactivity to your apps using XAML Behaviors for WPF. Behaviors encapsulate reusable functionalities for elements that can be easily added to your XAML without the need for more imperative code.</Description>
Expand All @@ -17,12 +15,10 @@
<PackageTags>Behavior Action Behaviors Actions Blend Managed C# Interaction Interactivity Interactions</PackageTags>
<PackageProjectUrl>https://github.com/Microsoft/XamlBehaviorsWpf</PackageProjectUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);TimestampNugetPackage</GenerateNuspecDependsOn>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Expression_CodeCoverageSubdirectory>$(Blend_ExtensionRoot)\</Expression_CodeCoverageSubdirectory>
<DefineConstants>WPF;$(DefineConstants)</DefineConstants>
</PropertyGroup>

Expand All @@ -42,16 +38,7 @@
</Reference>
</ItemGroup>

<ItemGroup Condition="'$(SignType)' == 'real'">
<FilesToSign Include="$(OutputPath)$(AssemblyName).dll">
<Authenticode>Microsoft</Authenticode>
<StrongName>67</StrongName>
</FilesToSign>
</ItemGroup>

<ItemGroup>
<Compile Include="..\RuntimeVersion.cs" Link="RuntimeVersion.cs" />
<Compile Include="..\Version\Version.cs" Link="Version.cs" />

<Compile Update="ExceptionStringTable.Designer.cs">
<SubType>Code</SubType>
Expand All @@ -68,19 +55,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
<PackageReference Include="MicroBuild.Core">
<Version>0.3.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Nerdbank.GitVersioning" Version=" 2.3.38" PrivateAssets="All" />
</ItemGroup>

<Target Name="TimestampNugetPackage">
<PropertyGroup>
<CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd-HHmm))</CurrentDate>
<PackageVersion Condition="'$(TimestampPackage)' == 'true'">$(PackageVersion)-CI-$(CurrentDate)</PackageVersion>
<NuspecProperties>version=$(PackageVersion)</NuspecProperties>
</PropertyGroup>
</Target>

</Project>
10 changes: 10 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": "1.0",
"publicReleaseRefSpec": [
"^refs/heads/master$", // we release out of master
"^refs/heads/rel/v\\d+\\.\\d+" // we also release branches starting with vN.N
],
"nugetPackageVersion":{
"semVer": 2
}
}

0 comments on commit 0a85dfc

Please sign in to comment.