forked from fluentribbon/Fluent.Ribbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fluent.Ribbon.msbuild
64 lines (54 loc) · 3.37 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Root>$(MSBuildProjectDirectory)</Root>
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
<PublishDirectory>$(Root)/Publish</PublishDirectory>
<Version Condition="$(Version) == ''">$(appveyor_build_version)</Version>
</PropertyGroup>
<Target Name="Restore">
<Exec Command="$(Root)/Tools/NuGet.exe restore "$(Root)/Fluent.Ribbon.sln"" />
<Exec Command="$(Root)/Tools/NuGet.exe restore "$(Root)/Tools/packages.config" -OutputDirectory "$(Root)/Tools"" />
</Target>
<Target Name="Build" DependsOnTargets="Restore">
<MSBuild Projects="$(Root)/Fluent.Ribbon.sln" Properties="Configuration=$(Configuration);" />
</Target>
<Target Name="ReadVersion">
<!-- Read assembly version from the DLL -->
<GetAssemblyIdentity AssemblyFiles="$(Root)/bin/Fluent/$(Configuration)v4.5/Fluent.dll">
<Output TaskParameter="Assemblies" ItemName="FluentAssembly"/>
</GetAssemblyIdentity>
<PropertyGroup>
<!-- Construct NuGet package version according to SemVer -->
<PrereleaseSuffix Condition="$(Prerelease) != ''">-dev$(Prerelease)</PrereleaseSuffix>
<Version Condition="$(Version) == ''">$([System.String]::new(%(FluentAssembly.Version)).TrimEnd('0').TrimEnd('.'))$(PrereleaseSuffix)</Version>
</PropertyGroup>
<Message Text="Version: $(Version)"
Importance="High" />
</Target>
<Target Name="EnsurePublishDir">
<MakeDir Directories="$(PublishDirectory)" />
</Target>
<Target Name="RunTests">
<Exec Command="$(Root)/Tools/NUnit.ConsoleRunner.3.5.0/tools/nunit3-console.exe --noheader "$(Root)/bin/Fluent.Tests/$(Configuration)v4.5/Fluent.Tests.dll"" />
</Target>
<Target Name="RunGitLink">
<Exec Command="$(Root)/Tools/GitLink.2.3.0/lib/net45/GitLink.exe "$(Root)" -u https://github.com/fluentribbon/Fluent.Ribbon" />
</Target>
<Target Name="CreateNuGetPackage" DependsOnTargets="ReadVersion; EnsurePublishDir">
<!-- Build NuGet package -->
<Exec Command="$(Root)/Tools/NuGet.exe pack $(Root)/Fluent.Ribbon.nuspec -Version $(Version) -OutputDirectory "$(PublishDirectory)" -Properties Configuration=$(Configuration)" />
</Target>
<Target Name="CreateZipPackages" DependsOnTargets="ReadVersion; EnsurePublishDir">
<!-- Create dll zip package -->
<Exec Command="$(Root)/Tools/7-Zip.CommandLine.9.20.0/tools/7za.exe a -tzip -mx9 -r "$(PublishDirectory)/Fluent.Ribbon.$(Version).zip" *.dll *.pdb *.exe *.xml"
WorkingDirectory="$(Root)/bin/Fluent" />
<!-- Create showcase zip package -->
<Exec Command="$(Root)/Tools/7-Zip.CommandLine.9.20.0/tools/7za.exe a -tzip -mx9 -r "$(PublishDirectory)/Fluent.Ribbon.Showcase.$(Version).zip" *.dll *.pdb *.exe *.xml"
WorkingDirectory="$(Root)/bin/Fluent.Ribbon.Showcase" />
</Target>
<Target Name="Test" DependsOnTargets="Build; RunTests" />
<Target Name="Pack" DependsOnTargets="Build; RunPack" />
<Target Name="RunPack" DependsOnTargets="RunGitLink; CreateNuGetPackage; CreateZipPackages" />
<Target Name="CI" DependsOnTargets="Build; RunTests; RunPack" />
</Project>