forked from fluentribbon/Fluent.Ribbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fluent.Ribbon.msbuild
40 lines (34 loc) · 1.86 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
<?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>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="MakeNuGetPackage" DependsOnTargets="ReadVersion; EnsurePublishDir">
<!-- Build NuGet package -->
<Exec Command="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="7za a -tzip -mx9 -r "$(PublishDirectory)/Fluent.Ribbon.$(Version).zip" build/bin/*" />
</Target>
<Target Name="PublishVersion" DependsOnTargets="MakeNuGetPackage; CreateZipPackages" />
</Project>