forked from fluentribbon/Fluent.Ribbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fluent.Ribbon.msbuild
47 lines (40 loc) · 2.24 KB
/
Fluent.Ribbon.msbuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Root>$(MSBuildProjectDirectory)/</Root>
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
<PublishDirectory>$(Root)/Publish/</PublishDirectory>
</PropertyGroup>
<Target Name="Build">
<MSBuild Projects="$(Root)Fluent.Ribbon.sln" Properties="Configuration=$(Configuration);" />
</Target>
<Target Name="ReadVersion" DependsOnTargets="Build">
<!-- Read assembly version from the DLL -->
<GetAssemblyIdentity AssemblyFiles="$(Root)build/bin/NET 4.5/$(Configuration)/Fluent.dll">
<Output TaskParameter="Assemblies" ItemName="FluentAssembly"/>
</GetAssemblyIdentity>
<PropertyGroup>
<!-- Construct NuGet package version according to SemVer -->
<PrereleaseSuffix Condition="$(Prerelease) != ''">-$(Prerelease)</PrereleaseSuffix>
<Version>$([System.String]::new(%(FluentAssembly.Version)).TrimEnd('0').TrimEnd('.'))$(PrereleaseSuffix)</Version>
</PropertyGroup>
</Target>
<Target Name="EnsurePublishDir">
<MakeDir Directories="$(PublishDirectory)" />
</Target>
<Target Name="RunGitLink" DependsOnTargets="Build">
<Exec Command="$(Root)\Tools\GitLink.exe "$(Root)" -u https://github.com/fluentribbon/Fluent.Ribbon" />
</Target>
<Target Name="MakeNuGetPackage" DependsOnTargets="ReadVersion; EnsurePublishDir">
<!-- Update nuget -->
<Exec Command="$(Root)\Tools\NuGet.exe update -self" />
<!-- Build NuGet package -->
<Exec Command="$(Root)\Tools\NuGet.exe pack $(Root)Fluent.Ribbon.nuspec -Version $(Version) -OutputDirectory Publish -Properties Configuration=$(Configuration)" />
</Target>
<Target Name="CreateZipPackages" DependsOnTargets="ReadVersion; EnsurePublishDir">
<!-- Create dll zip package -->
<Exec Command="$(Root)\Tools\7za.exe a -tzip -mx9 -r "$(PublishDirectory)/Fluent.Ribbon.$(Version).zip" *.dll *.pdb *.exe *.xml"
WorkingDirectory="$(Root)/build/bin" />
</Target>
<Target Name="PublishVersion" DependsOnTargets="RunGitLink; MakeNuGetPackage; CreateZipPackages" />
</Project>