Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
162 lines (136 sloc) 7.8 KB
<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>
<SharpDevelopSrc>$(ProjectDir)\src</SharpDevelopSrc>
<SharpDevelopBin>$(ProjectDir)\bin</SharpDevelopBin>
<MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)\Tools\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
<ArtefactPrefix>SharpDevelop_</ArtefactPrefix>
<NUnitToolPath>$(MSBuildProjectDirectory)\Tools\NUnit</NUnitToolPath>
<NUnitTempToolPath>$(SharpDevelopBin)\Tools\x86NUnit</NUnitTempToolPath>
<ProfilerSrc>$(SharpDevelopSrc)\AddIns\Misc\Profiler</ProfilerSrc>
<!-- 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) -->
<!-- B) The Wix task assembly is locked if we do not use a separate MSBuild process -->
<!-- C) We need to use MSBuild 4.0, but the build server uses MSBuild 2.0 -->
<MSBuildExecutable>&quot;$(MSBuildBinPath)\..\v4.0.30319\msbuild.exe&quot;</MSBuildExecutable>
<BuildProperties>/p:Configuration=Release</BuildProperties>
<BuildProperties>$(BuildProperties) &quot;/p:SharpDevelopBinPath=$(SharpDevelopBin)&quot;</BuildProperties>
<BuildProperties>$(BuildProperties) &quot;/p:BooBinPath=$(SharpDevelopSrc)\AddIns\BackendBindings\Boo\RequiredLibraries&quot;</BuildProperties>
<BuildProperties>$(BuildProperties) &quot;/p:FSharpBuildTasksPath=$(SharpDevelopSrc)\AddIns\BackendBindings\FSharp\RequiredLibraries&quot;</BuildProperties>
<BuildProperties>$(BuildProperties) &quot;/p:BranchName=$(BranchName)&quot;</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="$(SharpDevelopSrc)\Tools\Tools.build"
Targets="PrepareRelease"
Properties="Configuration=Release;BranchName=$(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) SharpDevelop.sln $(BuildProperties)"/>
<!--<Exec WorkingDirectory="$(ProfilerSrc)"
Command="$(MSBuildExecutable) AutomatedBuild.proj $(BuildProperties)"/>-->
</Target>
<Target Name="buildunittests">
<Exec WorkingDirectory="$(ProjectDir)"
Command="$(MSBuildExecutable) SharpDevelop.Tests.sln $(BuildProperties)"/>
</Target>
<Target Name="rununittests">
<CreateItem Include="$(SharpDevelopBin)\UnitTests\**\*.Tests.dll">
<Output TaskParameter="Include" ItemName="UnitTestAssemblies"/>
</CreateItem>
<!-- HACK: we cannot make the NUnit task run the x86 version; so instead we make a copy
of NUnit and rename nunit-console-x86 to nunit-console
-->
<CreateItem Include="$(NUnitToolPath)\lib\*.dll">
<Output TaskParameter="Include" ItemName="NUnitLibFiles"/>
</CreateItem>
<Copy SourceFiles="@(NUnitLibFiles)" DestinationFolder="$(NUnitTempToolPath)\lib"/>
<Copy SourceFiles="$(NUnitToolPath)\nunit.framework.dll" DestinationFolder="$(NUnitTempToolPath)"/>
<Copy SourceFiles="$(NUnitToolPath)\nunit-console-x86.exe" DestinationFiles="$(NUnitTempToolPath)\nunit-console.exe"/>
<Copy SourceFiles="$(NUnitToolPath)\nunit-console-x86.exe.config" DestinationFiles="$(NUnitTempToolPath)\nunit-console.exe.config"/>
<!-- the %() portion is important; otherwise a single NUnit-console process is used for all tests -->
<NUnit Assemblies="@(UnitTestAssemblies)"
OutputXmlFile="$(TestReportsDir)\%(UnitTestAssemblies.FileName).xml"
WorkingDirectory="$(SharpDevelopBin)\UnitTests"
ToolPath="$(NUnitTempToolPath)"/>
</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) SharpDevelop.sln /t:Clean $(BuildProperties)"/>
<Exec WorkingDirectory="$(ProjectDir)"
Command="$(MSBuildExecutable) SharpDevelop.Tests.sln /t:Clean $(BuildProperties)"/>
<!--<Exec WorkingDirectory="$(ProfilerSrc)"
Command="$(MSBuildExecutable) AutomatedBuild.proj /t:Clean $(BuildProperties)"/>-->
</Target>
<Target Name="clean2">
<Exec WorkingDirectory="$(ProjectDir)"
Command="$(MSBuildExecutable) SharpDevelop.sln /t:Clean $(BuildProperties)"/>
<Exec WorkingDirectory="$(ProjectDir)"
Command="$(MSBuildExecutable) SharpDevelop.Tests.sln /t:Clean $(BuildProperties)"/>
<!--<Exec WorkingDirectory="$(ProfilerSrc)"
Command="$(MSBuildExecutable) AutomatedBuild.proj /t:Clean $(BuildProperties)"/>-->
</Target>
<Target Name="createsetup">
<Exec WorkingDirectory="$(SharpDevelopSrc)\Setup"
Command="$(MSBuildExecutable) SharpDevelop.Setup.sln $(BuildProperties)"/>
<Move SourceFiles="$(SharpDevelopSrc)\setup\bin\SharpDevelop.msi"
DestinationFiles="$(ArtefactsOutputDir)\$(ArtefactPrefix)$(BuildNumber).msi"/>
<RemoveDir
Directories="$(SharpDevelopSrc)\setup\bin" />
</Target>
<Target Name="zipsource">
<CreateItem Include="$(ProjectDir)\**"
Exclude="$(ProjectDir)\**\.svn\**;$(ProjectDir)\**\obj\**;$(ProjectDir)\.git\**;$(ProjectDir)\.git*;$(ProjectDir)\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/SharpDevelop.git refs/notes/build:refs/notes/build' />
</Target>
</Project>
Something went wrong with that request. Please try again.