#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
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.
 
 
 
 
 
 

233 lines
11 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>
<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>
<SamplesSrc>$(ProjectDir)\samples</SamplesSrc>
<!-- 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 12.0, but the build server uses MSBuild 4.0 -->
<MSBuildExecutable>&quot;$(MSBuildExtensionsPath)\12.0\Bin\msbuild.exe&quot;</MSBuildExecutable>
<BuildProperties>/m /p:Configuration=Release</BuildProperties>
<BuildProperties>$(BuildProperties) &quot;/p:SharpDevelopBinPath=$(SharpDevelopBin)&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="createxcopydeployablezip"/>
<CallTarget Targets="buildsamples"/>
<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)"/>
</Target>
<Target Name="buildunittests">
<Exec WorkingDirectory="$(ProjectDir)"
Command="$(MSBuildExecutable) SharpDevelop.Tests.sln $(BuildProperties)"/>
</Target>
<Target Name="buildsamples">
<MSBuild Projects="$(SamplesSrc)\AvalonEdit.Sample\AvalonEdit.Sample.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\CodonCreation\CodonCreation.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\ComponentInspector\ComponentInspector.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\CppBackendBinding\CppBackendBinding.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\CustomPad\CustomPad.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\CustomView\CustomView.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\DisplayBindings\AlternateEditor\AlternateEditor.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\DisplayBindings\HtmlPreview\HtmlPreview.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\DisplayBindings\ImageViewer\ImageViewer.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\EmbeddedImageAddIn\EmbeddedImageAddIn.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\HtmlSyntaxColorizer\HtmlSyntaxColorizer.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\ILAsmBinding\ILAsmBinding.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\LineCounter\LineCounter.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\Mono\Mono.AddIn.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\MSTest\MSTest.SharpDevelop.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\NAnt\NAnt.AddIn.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\PInvokeAddIn\PInvokeAddIn.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\SdaUser\SdaUser.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<!-- <MSBuild Projects="$(SamplesSrc)\SharpDevelopReports\src\ReportSamples.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
<MSBuild Projects="$(SamplesSrc)\SharpSnippetCompiler\SharpSnippetCompiler.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>-->
<MSBuild Projects="$(SamplesSrc)\XamlDesigner\XamlDesigner.sln"
Targets="build;clean"
Properties="Configuration=Release;BranchName=$(BranchName)"/>
</Target>
<Target Name="rununittests">
<CreateItem Include="$(SharpDevelopBin)\UnitTests\**\*.Tests.dll;$(SharpDevelopSrc)\Libraries\NRefactory\bin\net_4_5_Release\ICSharpCode.NRefactory.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)"/>
</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)"/>
</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="createxcopydeployablezip">
<MSBuild Projects="$(SharpDevelopSrc)\Tools\Tools.build"
Targets="PrepareXcopyZip"
Properties="Configuration=Release"/>
<Move SourceFiles="$(SharpDevelopSrc)\Tools\ZipFromMsi\bin\Debug\SharpDevelopStandalone.zip"
DestinationFiles="$(ArtefactsOutputDir)\$(ArtefactPrefix)$(BuildNumber).Xcopyable.zip"/>
</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>