This repository has been archived by the owner on Sep 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.proj
85 lines (67 loc) · 3.55 KB
/
Build.proj
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="BuildProperties.resx" />
<Target Name="CompileCode" DependsOnTargets="CleanOutput;CompileDevCode">
<Message Text="*** CompileCode complete ***" />
</Target>
<Target Name="CompileDevCode">
<MSBuild Projects="$(SourcePath)\$(SolutionName)"
Targets="Clean;Build"
Properties="SolutionDir=$(SourcePath)\;Configuration=$(Configuration);OutDir=$(OutputFolder)\"
Condition="Exists('$(SourcePath)\$(SolutionName)')" />
</Target>
<Target Name="CleanOutput">
<Message Text="Cleaning out $(OutputFolder)" />
<ItemGroup>
<FilesToDelete Include="$(OutputFolder)\**\*" />
</ItemGroup>
<Delete Files="@(FilesToDelete)" />
<RemoveDir Directories="$(OutputFolder)" />
<MakeDir Directories="$(OutputFolder)"/>
<Message Text="Cleanup completed." />
</Target>
<!--
<Target Name="MakeInstallerBeta" DependsOnTargets="MakeInstaller">
NOTE:
* This requires conditions inside of "MakeInstaller" to allow "$(Conf)==ReleaseBeta"
* Change Squirrel output directory to $(SquirrelReleasePathBeta).
<Message Text="Creating Beta Release Package..." />
<Configuration>ReleaseBeta</Configuration>
<CallTarget Targets="MakeInstaller" />
</Target>
-->
<!-- Installer -->
<Target Name="MakeInstaller" DependsOnTargets="CompileCode" Condition="'$(Configuration)' == 'Release'">
<Message Text="Creating installer..." />
<GetAssemblyIdentity AssemblyFiles="$(MainExe)">
<Output TaskParameter="Assemblies" ItemName="AppAssembly"/>
</GetAssemblyIdentity>
<ItemGroup>
<!-- Using item group because it works with multiple-versions. Though it gets the lowest version -->
<NuGetExe Include="source\packages\NuGet.CommandLine.*\tools\nuget.exe" />
<SquirrelExe Include="source\packages\Squirrel.Windows.*\tools\squirrel.exe" />
</ItemGroup>
<PropertyGroup>
<SemanticVersion>$([System.Version]::Parse(%(AppAssembly.Version)).ToString(3))</SemanticVersion>
<NuSpecPath>$(OutputFolder)\$(ProjectName).$(SemanticVersion).nupkg</NuSpecPath>
<NuGetCmd>"%(NuGetExe.FullPath)" pack "Pomodoro.nuspec" -Version $(SemanticVersion) -Properties "Configuration=Release" -OutputDirectory "$(OutputFolder)" -BasePath "$(OutputFolder)"</NuGetCmd>
<SquirrelCmd>"%(SquirrelExe.FullPath)" --releasify "$(OutputFolder)\$(ProjectName).$(SemanticVersion).nupkg" --releaseDir="$(SquirrelReleasePath)"</SquirrelCmd>
</PropertyGroup>
<Message Text="Assembly File (MainExe): '$(MainExe)'" />
<Message Text="Assemblies: '%(AppAssembly.Version)'" />
<Message Text="Semantic Version: '$(SemanticVersion)'" />
<Message Text="Output: '$(NuSpecPath)'" />
<Message Text="--------------" />
<!--
<Message Text="$(NuGetCmd)" />
<Message Text="$(SquirrelCmd)" />
-->
<Error Condition="!Exists(%(NuGetExe.FullPath))" Text="You are trying to use the NuGet.CommandLine package, but it is not installed. Please install NuGet.CommandLine from the Package Manager." />
<Error Condition="!Exists(%(SquirrelExe.FullPath))" Text="You are trying to use the Squirrel.Windows package, but it is not installed. Please install Squirrel.Windows from the Package Manager." />
<Message Text="Creating Installer Package..." />
<Exec Command="$(NuGetCmd)" />
<Message Text="Registering with Auto-Updater..." />
<Exec Command="$(SquirrelCmd)" />
<Message Text="Done!" />
</Target>
</Project>