summaryrefslogtreecommitdiffstats
path: root/win/CS/build.xml
blob: bd77cb5d98323c72848548214fd807999f551b78 (plain)
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
86
87
88
89
<!--
  build.xml
  This file is part of the HandBrake source code.
  Homepage: <http://handbrake.fr>.
  It may be used under the terms of the GNU General Public License
  
  HandBrake Build Scipt for usage with Jenkins.
  Usage: msbuild build.xml /p:Platform=x86 /t:ReleaseInstaller
  Reuqires: HandBrakeCli.exe to be in the release folder.
-->
<Project DefaultTargets="NightlyBuild" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  
  <!-- Setup -->
  <PropertyGroup>
    <Configuration>Release</Configuration>
  </PropertyGroup>
  
  <!-- Build all the main cproj files.-->
  <ItemGroup>
    <ProjectsToBuild Include="HandBrake.Interop\HandBrakeInterop\*proj" Exclude="$(MSBuildProjectFile)"/>
    <ProjectsToBuild Include="HandBrake.ApplicationServices\*proj" Exclude="$(MSBuildProjectFile)"/>
    <ProjectsToBuild Include="HandBrakeCS.*proj" Exclude="$(MSBuildProjectFile)"/>
    <ProjectsToBuild Include="HandBrakeWPF\HandBrakeWPF.*proj" Exclude="$(MSBuildProjectFile)"/>
  </ItemGroup>

  <!-- Dependencies -->
  <PropertyGroup>
    <NightlyDependsOn>BuildRelease;NightlyPostBuildEvent</NightlyDependsOn>
  </PropertyGroup>

  <PropertyGroup>
    <InstallDependsOn>BuildRelease;CreateReleasePostBuildEvent</InstallDependsOn>
  </PropertyGroup>

  <PropertyGroup>
    <AlphaDependsOn>AlphaPreBuild;BuildRelease;CreateAlphaPostBuildEvent</AlphaDependsOn>
  </PropertyGroup>
  
  <!-- Builds /t: -->
  <Target Name="NightlyBuild" DependsOnTargets="$(NightlyDependsOn)"/>
  <Target Name="ReleaseInstaller" DependsOnTargets="$(InstallDependsOn)"/>
  <Target Name="AlphaRelease" DependsOnTargets="$(AlphaDependsOn)"/>
  
  <!-- Build All Components (Forms, WPF, ApplicationServices, Interop -->
  <Target Name="BuildRelease">
    <MSBuild Projects ="@(ProjectsToBuild)"
             ContinueOnError ="false"
             Properties="Configuration=$(Configuration)" >
      <Output ItemName="OutputFiles" TaskParameter="TargetOutputs"/>
    </MSBuild>
  </Target>
  
  <!-- Pre Build Events -->
  <Target Name="AlphaPreBuild">
    <Exec Command="subwcrev.exe $(ProjectDir). $(ProjectDir)HandBrakeWPF\Properties\AssemblyInfo.cs.tmpl $(ProjectDir)HandBrakeWPF\Properties\AssemblyInfo.cs" />
    <Exec Command="subwcrev.exe $(ProjectDir). $(ProjectDir)HandBrakeWPF\Installer\MakeAlpha.nsi.tmpl $(ProjectDir)HandBrakeWPF\Installer\MakeAlpha.nsi" />
  </Target>

  <!-- Post Build Events -->
  <Target Name="NightlyPostBuildEvent">
    <Exec Command="copy $(ProjectDir)Installer\MakeNightly.nsi $(ProjectDir)bin\$(Platform)\Release /Y" Condition="$(Platform) == 'x86'" />
    <Exec Command="copy $(ProjectDir)Installer\MakeNightly64.nsi $(ProjectDir)bin\$(Platform)\Release /Y" Condition="$(Platform) == 'x64'" />
    
    <Exec Command="copy $(ProjectDir)handbrakepineapple.ico $(ProjectDir)bin\$(Platform)\Release /Y" />
    <Exec Command="xcopy $(ProjectDir)doc $(ProjectDir)bin\$(Platform)\Release\doc /I /Y" />
    
    <Exec Command="makensis $(ProjectDir)bin\$(Platform)\Release\MakeNightly.nsi" Condition="$(Platform) == 'x86'" />
    <Exec Command="makensis $(ProjectDir)bin\$(Platform)\Release\MakeNightly64.nsi" Condition="$(Platform) == 'x64'" />
  </Target>

  <Target Name="CreateReleasePostBuildEvent">
    <Exec Command="copy $(ProjectDir)Installer\Installer.nsi $(ProjectDir)bin\$(Platform)\Release /Y" Condition="$(Platform) == 'x86'" />
    <Exec Command="copy $(ProjectDir)Installer\Installer64.nsi $(ProjectDir)bin\$(Platform)\Release /Y" Condition="$(Platform) == 'x64'" />

    <Exec Command="copy $(ProjectDir)handbrakepineapple.ico $(ProjectDir)bin\$(Platform)\Release /Y" />
    <Exec Command="xcopy $(ProjectDir)doc $(ProjectDir)bin\$(Platform)\Release\doc /I /Y" />

    <Exec Command="makensis $(ProjectDir)bin\$(Platform)\Release\Installer.nsi" Condition="$(Platform) == 'x86'" />
    <Exec Command="makensis $(ProjectDir)bin\$(Platform)\Release\Installer64.nsi" Condition="$(Platform) == 'x64'" />
  </Target>

  <Target Name="CreateAlphaPostBuildEvent">
    <Exec Command="copy $(ProjectDir)HandBrakeWPF\Installer\MakeAlpha.nsi $(ProjectDir)HandBrakeWPF\bin\Release /Y" />
    <Exec Command="copy $(ProjectDir)handbrakepineapple.ico $(ProjectDir)HandBrakeWPF\bin\Release /Y" />
    <Exec Command="xcopy $(ProjectDir)doc $(ProjectDir)HandBrakeWPF\bin\Release\doc /I /Y" />
    <Exec Command="makensis $(ProjectDir)HandBrakeWPF\bin\Release\MakeAlpha.nsi"/>
  </Target>

</Project>