mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
6.0 KiB
125 lines
6.0 KiB
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="go"> |
|
<!-- This file is called by the build server. --> |
|
<!-- Expected properties: |
|
ArtefactsOutputDir : full path of directory to write the build artefacts to. |
|
TestReportsDir : full path of directory to write CC.net report files to |
|
--> |
|
|
|
<PropertyGroup> |
|
<ProjectDir Condition=" '$(ProjectDir)' == '' ">$(MSBuildProjectDirectory)\..</ProjectDir> |
|
|
|
<ILSpyBin>$(ProjectDir)\ILSpy\bin\Release</ILSpyBin> |
|
<VsixBin>$(ProjectDir)\ILSpy.AddIn\bin\Release</VsixBin> |
|
<MSBuildCommunityTasksPath>$(ProjectDir)\BuildTools\MSBuildCommunityTasks</MSBuildCommunityTasksPath> |
|
<ArtefactPrefix>ILSpy_</ArtefactPrefix> |
|
|
|
<!-- we cannot use <MSBuild> to build a solution because --> |
|
<!-- A) passing properties to a solution called with <MSBuild> doesn't make the |
|
properties available for the projects inside the solution |
|
(but this works using the command line) --> |
|
<!-- C) We need to use MSBuild 4.0, but the build server uses MSBuild 2.0 --> |
|
<MSBuildExecutable>"$(MSBuildBinPath)\msbuild.exe"</MSBuildExecutable> |
|
<BuildProperties>/p:Configuration=Release "/p:Platform=Any CPU"</BuildProperties> |
|
<BuildProperties>$(BuildProperties) "/p:BranchName=$(BranchName)"</BuildProperties> |
|
<BuildProperties>$(BuildProperties) $(AdditionalBuildProperties)</BuildProperties> |
|
</PropertyGroup> |
|
|
|
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets"/> |
|
|
|
<Target Name="go"> |
|
<Error Text="ArtefactsOutputDir not set" Condition="'$(ArtefactsOutputDir)' == ''"/> |
|
<Error Text="TestReportsDir not set" Condition="'$(TestReportsDir)' == ''"/> |
|
|
|
<Message Text="ArtefactPrefix=$(ArtefactPrefix)" Importance="high"/> |
|
<Message Text="ArtefactsOutputDir=$(ArtefactsOutputDir)" Importance="high"/> |
|
<Message Text="BuildProperties=$(BuildProperties)" Importance="high"/> |
|
|
|
<CallTarget Targets="clean1"/> |
|
|
|
<CallTarget Targets="build"/> |
|
|
|
<CallTarget Targets="createsetup"/> |
|
|
|
<!-- |
|
<CallTarget Targets="buildunittests"/> |
|
<CallTarget Targets="rununittests"/> |
|
--> |
|
|
|
<CallTarget Targets="clean2"/> |
|
<CallTarget Targets="zipsource"/> |
|
<CallTarget Targets="addnote" Condition=" '$(IsOfficialBuildServer)' == 'True' "/> |
|
</Target> |
|
|
|
<Target Name="build"> |
|
<MSBuild Projects="$(ProjectDir)\BuildTools\UpdateAssemblyInfo\UpdateAssemblyInfo.csproj" Targets="Build" Properties="Configuration=Debug" /> |
|
<Exec WorkingDirectory="$(ProjectDir)\BuildTools\UpdateAssemblyInfo\bin\Debug" Command="UpdateAssemblyInfo.exe --REVISION --branchname $(BranchName)" Timeout="60000" Condition=" '$(BranchName)' != '' " /> |
|
<Exec WorkingDirectory="$(ProjectDir)\BuildTools\UpdateAssemblyInfo\bin\Debug" Command="UpdateAssemblyInfo.exe --REVISION" Timeout="60000" Condition=" '$(BranchName)' == '' " /> |
|
|
|
<!-- read content of REVISION into $(BuildNumber) --> |
|
<XmlRead XPath="/versionInfo/version" |
|
XmlFileName="$(ProjectDir)\REVISION"> |
|
<Output TaskParameter="Value" PropertyName="BuildNumber" /> |
|
</XmlRead> |
|
<Message Importance="high" Text="BuildNumber=$(BuildNumber)"/> |
|
|
|
<Copy SourceFiles="$(ProjectDir)\REVISION" |
|
DestinationFolder="$(ArtefactsOutputDir)"/> |
|
|
|
<Exec WorkingDirectory="$(ProjectDir)" |
|
Command="$(MSBuildExecutable) ILSpy.sln $(BuildProperties)"/> |
|
</Target> |
|
|
|
<!-- Yes, apparently we really need two identical clean tasks. MSBuild won't run the same task twice. --> |
|
<Target Name="clean1"> |
|
<Exec WorkingDirectory="$(ProjectDir)" |
|
Command="$(MSBuildExecutable) ILSpy.sln /t:Clean /p:Configuration=Debug"/> |
|
<Exec WorkingDirectory="$(ProjectDir)" |
|
Command="$(MSBuildExecutable) ILSpy.sln /t:Clean /p:Configuration=Release"/> |
|
</Target> |
|
<Target Name="clean2"> |
|
<Exec WorkingDirectory="$(ProjectDir)" |
|
Command="$(MSBuildExecutable) ILSpy.sln /t:Clean /p:Configuration=Debug"/> |
|
<Exec WorkingDirectory="$(ProjectDir)" |
|
Command="$(MSBuildExecutable) ILSpy.sln /t:Clean /p:Configuration=Release"/> |
|
</Target> |
|
|
|
<Target Name="createsetup"> |
|
<CreateItem Include="$(ILSpyBin)\*.dll;$(ILSpyBin)\*.exe;$(ILSpyBin)\*.config" |
|
Exclude="$(ILSpyBin)\*Debugger.*"> |
|
<Output TaskParameter="Include" ItemName="BinFileToZip"/> |
|
</CreateItem> |
|
<Message Importance="high" Text="Creating ZIP file $(ArtefactPrefix)$(BuildNumber)_Binaries.zip"/> |
|
<Zip Files="@(BinFileToZip)" |
|
ZipLevel="9" |
|
WorkingDirectory="$(ILSpyBin)" |
|
ZipFileName="$(ArtefactsOutputDir)\$(ArtefactPrefix)$(BuildNumber)_Binaries.zip"/> |
|
<Copy SourceFiles="$(VsixBin)\ILSpy.AddIn.vsix" |
|
DestinationFiles="$(ArtefactsOutputDir)\$(ArtefactPrefix)$(BuildNumber)_Addin.vsix"/> |
|
</Target> |
|
|
|
<Target Name="zipsource"> |
|
<CreateItem Include="$(ProjectDir)\**" |
|
Exclude="$(ProjectDir)\**\.svn\**;$(ProjectDir)\**\obj\**;$(ProjectDir)\**\bin\**;$(ProjectDir)\.git\**;$(ProjectDir)\.git*;$(ProjectDir)\BuildTools\build\**"> |
|
<Output TaskParameter="Include" ItemName="FileToZip"/> |
|
</CreateItem> |
|
<Message Importance="high" Text="Creating ZIP file $(ArtefactPrefix)$(BuildNumber)_Source.zip"/> |
|
<Zip Files="@(FileToZip)" |
|
ZipLevel="6" |
|
WorkingDirectory="$(ProjectDir)" |
|
ZipFileName="$(ArtefactsOutputDir)\$(ArtefactPrefix)$(BuildNumber)_Source.zip"/> |
|
</Target> |
|
|
|
<Target Name="addnote"> |
|
<XmlRead XPath="/versionInfo/version" |
|
XmlFileName="$(ProjectDir)\REVISION"> |
|
<Output TaskParameter="Value" PropertyName="BuildNumber" /> |
|
</XmlRead> |
|
<XmlRead XPath="/versionInfo/branchName" |
|
XmlFileName="$(ProjectDir)\REVISION"> |
|
<Output TaskParameter="Value" PropertyName="BranchName" /> |
|
</XmlRead> |
|
<Exec WorkingDirectory="$(ProjectDir)" Command='git fetch origin refs/notes/build:refs/notes/build -f' /> |
|
<Exec WorkingDirectory="$(ProjectDir)" Command='git notes --ref build add -m "Build $(BuildNumber) on $(BranchName) successful"' IgnoreExitCode="True" /> |
|
<Exec WorkingDirectory="$(ProjectDir)" Command='git push git@github.com:icsharpcode/ILSpy.git refs/notes/build:refs/notes/build' /> |
|
</Target> |
|
</Project>
|
|
|