2016-08-22 13:31:52 -04:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2016-08-21 19:09:45 -04:00
|
|
|
<!-- Main msbuild project for OpenRCT2 -->
|
2016-08-25 19:03:52 -04:00
|
|
|
<!-- Inputs (/p: or environment variables)
|
|
|
|
- OPENRCT2_BUILD_SERVER
|
2016-08-23 13:22:06 -04:00
|
|
|
- GIT_TAG
|
|
|
|
- GIT_BRANCH
|
|
|
|
- GIT_COMMIT_SHA1
|
|
|
|
- SIGN_PASSWORD
|
|
|
|
- OPENRCT2_ORG_TOKEN
|
2016-08-25 19:03:52 -04:00
|
|
|
- NO_NSIS: set to true to prevent the NSIS installer building
|
2016-08-23 13:22:06 -04:00
|
|
|
-->
|
2016-08-26 13:29:42 -04:00
|
|
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="PublishAll">
|
2016-08-22 13:31:52 -04:00
|
|
|
<!-- Import custom build tasks -->
|
2016-08-22 16:46:09 -04:00
|
|
|
<Import Project="openrct2.targets" />
|
2016-08-22 13:31:52 -04:00
|
|
|
|
2016-08-22 08:11:57 -04:00
|
|
|
<PropertyGroup>
|
2016-09-09 18:13:12 -04:00
|
|
|
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
|
2016-10-15 17:44:24 -04:00
|
|
|
<Platform Condition="'$(PLATFORM)'==''">x64</Platform>
|
2016-08-27 09:08:31 -04:00
|
|
|
<GIT_COMMIT_SHA1_SHORT Condition="'$(GIT_COMMIT_SHA1)'!=''">$(GIT_COMMIT_SHA1.Substring(0, 7))</GIT_COMMIT_SHA1_SHORT>
|
|
|
|
|
2016-08-27 10:14:34 -04:00
|
|
|
<Version>0.0.5.0</Version>
|
2016-08-27 08:54:19 -04:00
|
|
|
<VersionExtra Condition="'$(GIT_BRANCH)'!=''">-$(GIT_BRANCH)-$(GIT_COMMIT_SHA1_SHORT)</VersionExtra>
|
|
|
|
<VersionTag Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('$(GIT_TAG)', '^v[0-9]'))">$(GIT_TAG)</VersionTag>
|
|
|
|
<VersionExtra Condition="'$(GIT_TAG)'!='' AND '$(VersionTag)'==''">-$(GIT_TAG)</VersionExtra>
|
2016-10-16 11:03:15 -04:00
|
|
|
<TargetLibsVersion>10</TargetLibsVersion>
|
2016-08-23 13:13:45 -04:00
|
|
|
|
2016-08-23 14:24:07 -04:00
|
|
|
<!-- Set dynamic OpenRCT2 #defines -->
|
2016-09-20 18:57:15 -04:00
|
|
|
<OPENRCT2_CL_ADDITIONALOPTIONS Condition="'$(BUILD_SERVER)'!=''">/D "OPENRCT2_BUILD_SERVER=\"$(BUILD_SERVER)\"" $(OPENRCT2_CL_ADDITIONALOPTIONS)</OPENRCT2_CL_ADDITIONALOPTIONS>
|
|
|
|
<OPENRCT2_CL_ADDITIONALOPTIONS Condition="'$(GIT_BRANCH)'!=''">/D "OPENRCT2_BRANCH=\"$(GIT_BRANCH)\"" $(OPENRCT2_CL_ADDITIONALOPTIONS)</OPENRCT2_CL_ADDITIONALOPTIONS>
|
|
|
|
<OPENRCT2_CL_ADDITIONALOPTIONS Condition="'$(GIT_COMMIT_SHA1)'!=''">/D "OPENRCT2_COMMIT_SHA1=\"$(GIT_COMMIT_SHA1)\"" $(OPENRCT2_CL_ADDITIONALOPTIONS)</OPENRCT2_CL_ADDITIONALOPTIONS>
|
|
|
|
<OPENRCT2_CL_ADDITIONALOPTIONS Condition="'$(GIT_COMMIT_SHA1_SHORT)'!=''">/D "OPENRCT2_COMMIT_SHA1_SHORT=\"$(GIT_COMMIT_SHA1_SHORT)\"" $(OPENRCT2_CL_ADDITIONALOPTIONS)</OPENRCT2_CL_ADDITIONALOPTIONS>
|
|
|
|
<OPENRCT2_CL_ADDITIONALOPTIONS Condition="'$(Configuration)'=='Release'">/D "USE_BREAKPAD" $(OPENRCT2_CL_ADDITIONALOPTIONS)</OPENRCT2_CL_ADDITIONALOPTIONS>
|
2016-08-23 14:24:07 -04:00
|
|
|
|
2016-08-22 08:11:57 -04:00
|
|
|
<RootDir>$(MsBuildThisFileDirectory)</RootDir>
|
|
|
|
<DistDir>$(RootDir)distribution\</DistDir>
|
2016-08-22 15:39:06 -04:00
|
|
|
<ArtifactsDir>$(RootDir)artifacts\</ArtifactsDir>
|
2016-09-09 17:42:35 -04:00
|
|
|
<TargetDir>$(RootDir)bin\</TargetDir>
|
2016-08-22 15:39:06 -04:00
|
|
|
|
2016-08-22 17:30:47 -04:00
|
|
|
<NsisScript>$(DistDir)windows\install.nsi</NsisScript>
|
|
|
|
|
2016-10-20 17:45:22 -04:00
|
|
|
<OutputExe>$(TargetDir)openrct2.exe</OutputExe>
|
2016-08-22 15:39:06 -04:00
|
|
|
<g2Output>$(TargetDir)data\g2.dat</g2Output>
|
|
|
|
|
|
|
|
<SignCertificate Condition="'$(SignCertificate)'==''">$(DistDir)windows\code-sign-key-openrct2.org.pfx</SignCertificate>
|
|
|
|
<SignTimestampUrl>http://timestamp.comodoca.com/authenticode</SignTimestampUrl>
|
2016-08-22 16:45:36 -04:00
|
|
|
|
2016-08-26 13:04:17 -04:00
|
|
|
<PublishPostfix>-$(Configuration)-$(Platform)</PublishPostfix>
|
|
|
|
<PublishPostfix Condition="'$(GIT_COMMIT_SHA1_SHORT)'!=''">$(PublishPostfix)-$(GIT_COMMIT_SHA1_SHORT)</PublishPostfix>
|
2016-08-25 18:07:02 -04:00
|
|
|
<PublishPostfix>$(PublishPostfix.ToLower())</PublishPostfix>
|
|
|
|
<PublishZip>$(ArtifactsDir)openrct2-portable$(PublishPostfix).zip</PublishZip>
|
|
|
|
<PublishSymbolsZip Condition="'$(GIT_COMMIT_SHA1_SHORT)'==''">$(ArtifactsDir)openrct2-symbols$(PublishPostfix).zip</PublishSymbolsZip>
|
|
|
|
<PublishSymbolsZip Condition="'$(GIT_COMMIT_SHA1_SHORT)'!=''">$(ArtifactsDir)openrct2-symbols$(PublishPostfix).zip</PublishSymbolsZip>
|
|
|
|
<PublishInstallerExe>$(ArtifactsDir)openrct2-installer$(PublishPostfix).exe</PublishInstallerExe>
|
2016-08-23 13:13:45 -04:00
|
|
|
|
2016-08-27 10:14:34 -04:00
|
|
|
<UploadFilename>OpenRCT2-$(Version)$(VersionExtra)-windows-$(Platform.ToLower())</UploadFilename>
|
2016-09-18 06:24:46 -04:00
|
|
|
|
|
|
|
<!-- Set openrct2.sln properties -->
|
|
|
|
<SlnProperties>$(SlnProperties);Platform=$(Platform)</SlnProperties>
|
2016-10-31 08:41:36 -04:00
|
|
|
<SlnProperties Condition="'$(BUILD_SERVER)'!=''">$(SlnProperties);OPENRCT2_CL_ADDITIONALOPTIONS=$(OPENRCT2_CL_ADDITIONALOPTIONS)</SlnProperties>
|
2016-08-22 08:11:57 -04:00
|
|
|
</PropertyGroup>
|
|
|
|
|
2016-08-25 19:45:57 -04:00
|
|
|
<!-- 3rd party libraries / dependencies -->
|
|
|
|
<PropertyGroup>
|
|
|
|
<LibsUrl>https://github.com/OpenRCT2/Dependencies/releases/download/v$(TargetLibsVersion)/openrct2-libs-vs2015.zip</LibsUrl>
|
|
|
|
<LibsPath>$(RootDir)lib\</LibsPath>
|
|
|
|
<LibsVersionPath>$(LibsPath)libversion</LibsVersionPath>
|
2016-12-02 08:36:03 -05:00
|
|
|
<GtestVersion>1.8.0</GtestVersion>
|
|
|
|
<GtestUrl>https://github.com/google/googletest/archive/release-$(GtestVersion).zip</GtestUrl>
|
2016-08-25 19:45:57 -04:00
|
|
|
</PropertyGroup>
|
|
|
|
|
2016-08-22 15:39:06 -04:00
|
|
|
<ItemGroup>
|
|
|
|
<g2Inputs Include="$(RootDir)resources\g2\*" />
|
2016-08-22 16:45:36 -04:00
|
|
|
<SignItems Include="$(OutputExe)" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ItemGroup Label="Symbol Items">
|
|
|
|
<SymbolItems Include="$(OutputExe)" />
|
2016-09-09 18:13:12 -04:00
|
|
|
<SymbolItems Include="$([System.IO.Path]::ChangeExtension($(OutputExe), '.pdb'))" />
|
2016-08-22 16:45:36 -04:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ItemGroup Label="Publish Items">
|
2016-08-25 13:29:23 -04:00
|
|
|
<PublishItems Include="$(OutputExe)" />
|
2016-08-25 15:17:40 -04:00
|
|
|
<PublishItems Include="$(TargetDir)data" />
|
2016-08-22 16:45:36 -04:00
|
|
|
<PublishItems Include="$(DistDir)changelog.txt" />
|
|
|
|
<PublishItems Include="$(DistDir)known_issues.txt" />
|
|
|
|
<PublishItems Include="$(DistDir)readme.txt" />
|
|
|
|
<PublishItems Include="$(RootDir)contributors.md" />
|
|
|
|
<PublishItems Include="$(RootDir)licence.txt" />
|
2016-08-22 15:39:06 -04:00
|
|
|
</ItemGroup>
|
|
|
|
|
2016-08-23 13:13:45 -04:00
|
|
|
<ItemGroup Label="Upload Artifacts">
|
|
|
|
<UploadArtifacts Include="$(PublishZip)">
|
|
|
|
<Name>$(UploadFilename).zip</Name>
|
2016-08-26 13:33:54 -04:00
|
|
|
<FlavourId Condition="'$(Platform)'=='Win32'">1</FlavourId>
|
|
|
|
<FlavourId Condition="'$(Platform)'=='x64'">6</FlavourId>
|
2016-08-23 13:13:45 -04:00
|
|
|
</UploadArtifacts>
|
|
|
|
<UploadArtifacts Include="$(PublishInstallerExe)">
|
|
|
|
<Name>$(UploadFilename).exe</Name>
|
2016-08-26 13:33:54 -04:00
|
|
|
<FlavourId Condition="'$(Platform)'=='Win32'">2</FlavourId>
|
|
|
|
<FlavourId Condition="'$(Platform)'=='x64'">7</FlavourId>
|
2016-08-23 13:13:45 -04:00
|
|
|
</UploadArtifacts>
|
|
|
|
<UploadArtifacts Include="$(PublishSymbolsZip)">
|
|
|
|
<Name>$(UploadFilename)-symbols.zip</Name>
|
2016-08-26 13:33:54 -04:00
|
|
|
<FlavourId Condition="'$(Platform)'=='Win32'">5</FlavourId>
|
|
|
|
<FlavourId Condition="'$(Platform)'=='x64'">10</FlavourId>
|
2016-08-23 13:13:45 -04:00
|
|
|
</UploadArtifacts>
|
|
|
|
</ItemGroup>
|
|
|
|
|
2016-08-25 19:45:57 -04:00
|
|
|
<Target Name="CheckLibs">
|
|
|
|
<!-- Get libversion file and check version -->
|
|
|
|
<Message Text="Checking if libraries need updating..." Importance="high" />
|
|
|
|
<PropertyGroup>
|
|
|
|
<CurrentLibsVersion>0</CurrentLibsVersion>
|
|
|
|
<CurrentLibsVersion Condition="Exists($(LibsVersionPath))">$([System.IO.File]::ReadAllText($(LibsVersionPath)).Trim())</CurrentLibsVersion>
|
|
|
|
<UpdateLibs Condition="$(TargetLibsVersion) > $(CurrentLibsVersion)">true</UpdateLibs>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Message Condition="'$(UpdateLibs)'!='true'" Text="Libraries up to date" Importance="high" />
|
|
|
|
<Message Condition="'$(UpdateLibs)'=='true'" Text="Libraries out of date, updating..." Importance="high" />
|
|
|
|
<CallTarget Condition="'$(UpdateLibs)'=='true'" Targets="DownloadLibs" />
|
|
|
|
</Target>
|
|
|
|
|
2016-08-25 15:22:09 -04:00
|
|
|
<Target Name="DownloadLibs">
|
2016-08-25 19:45:57 -04:00
|
|
|
<PropertyGroup>
|
|
|
|
<LibsZipPath>$(LibsPath)openrct2-libs-vs2015.zip</LibsZipPath>
|
2016-12-02 08:36:03 -05:00
|
|
|
<GtestZipPath>$(LibsPath)gtest.zip</GtestZipPath>
|
2016-08-25 19:45:57 -04:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<!-- Clean libs directory -->
|
|
|
|
<RemoveDir Directories="$(LibsPath)" />
|
|
|
|
<MakeDir Directories="$(LibsPath)" />
|
|
|
|
|
|
|
|
<Message Text="Downloading libraries..." Importance="normal" />
|
2016-12-02 08:36:03 -05:00
|
|
|
<!-- prebuilt libs -->
|
2016-08-25 19:45:57 -04:00
|
|
|
<Exec Command="powershell -ExecutionPolicy Unrestricted -Command "Invoke-WebRequest '$(LibsUrl)' -OutFile '$(LibsZipPath)'"" StandardOutputImportance="low" />
|
|
|
|
<Unzip Input="$(LibsZipPath)" OutputDirectory="$(LibsPath)" />
|
|
|
|
<Delete Files="$(LibsZipPath)" ContinueOnError="true" />
|
|
|
|
|
2016-12-02 08:36:03 -05:00
|
|
|
<!-- googletest -->
|
|
|
|
<Message Text="Downloading googletest..." Importance="normal" />
|
|
|
|
<Exec Command="powershell -ExecutionPolicy Unrestricted -Command "Invoke-WebRequest '$(GtestUrl)' -OutFile '$(GtestZipPath)'"" StandardOutputImportance="low" />
|
|
|
|
<Unzip Input="$(GtestZipPath)" OutputDirectory="$(LibsPath)" />
|
|
|
|
<Delete Files="$(GtestZipPath)" ContinueOnError="true" />
|
|
|
|
<Exec Command="cmd /c move "$(LibsPath)googletest-release-$(GtestVersion)" "$(LibsPath)googletest"" />
|
|
|
|
|
2016-08-25 19:45:57 -04:00
|
|
|
<!-- Update libversion file -->
|
|
|
|
<WriteLinesToFile Lines="$(TargetLibsVersion)" File="$(LibsVersionPath)" Overwrite="true" />
|
2016-08-22 08:11:57 -04:00
|
|
|
</Target>
|
|
|
|
|
2016-09-09 17:42:35 -04:00
|
|
|
<Target Name="Clean">
|
2016-12-02 09:42:40 -05:00
|
|
|
<PropertyGroup>
|
|
|
|
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
|
|
|
|
</PropertyGroup>
|
2016-08-26 13:04:17 -04:00
|
|
|
<ItemGroup>
|
|
|
|
<CleanItems Condition="'$(Platform)'=='Win32'" Include="$(OutputExe)" />
|
|
|
|
<CleanItems Include="$(g2Output)" />
|
|
|
|
<CleanItems Include="$(ArtifactsDir)openrct2-installer-$(Configuration)-$(Platform)*.exe" />
|
|
|
|
<CleanItems Include="$(ArtifactsDir)openrct2-portable-$(Configuration)-$(Platform)*.zip" />
|
|
|
|
<CleanItems Include="$(ArtifactsDir)openrct2-symbols-$(Configuration)-$(Platform)*.zip" />
|
|
|
|
</ItemGroup>
|
|
|
|
<Delete Files="@(CleanItems)" />
|
2016-08-26 13:57:21 -04:00
|
|
|
<Delete Files="%(SignItems.Identity).signed" />
|
2016-08-25 18:07:02 -04:00
|
|
|
<RemoveDir Directories="$(TargetDir)data" />
|
2016-09-18 06:24:46 -04:00
|
|
|
<MSBuild Projects="openrct2.sln" Targets="Clean" Properties="$(SlnProperties)" />
|
2016-08-22 15:39:06 -04:00
|
|
|
</Target>
|
|
|
|
|
2016-09-09 17:42:35 -04:00
|
|
|
<Target Name="BeforeBuild" BeforeTargets="Build;Rebuild" DependsOnTargets="CheckLibs">
|
2016-08-25 14:18:45 -04:00
|
|
|
<PropertyGroup>
|
|
|
|
<BuildString Condition="'$(GIT_COMMIT_SHA1_SHORT)'!=''">$(GIT_COMMIT_SHA1_SHORT)</BuildString>
|
|
|
|
<BuildString Condition="'$(GIT_BRANCH)'!=''">$(BuildString) ($(GIT_BRANCH))</BuildString>
|
|
|
|
</PropertyGroup>
|
2016-08-25 15:17:40 -04:00
|
|
|
<ItemGroup>
|
|
|
|
<CopyItems Condition="'$(Platform)'=='Win32'" Include="$(RootDir)openrct2.exe" />
|
|
|
|
<DataItems Include="$(RootDir)data\**\*" />
|
|
|
|
</ItemGroup>
|
2016-08-25 14:18:45 -04:00
|
|
|
<Message Condition="'$(BuildString)'!=''" Text="Building $(BuildString)" Importance="high" />
|
2016-08-25 15:17:40 -04:00
|
|
|
<Copy SourceFiles="@(CopyItems)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
|
|
|
|
<Copy SourceFiles="@(DataItems)" DestinationFolder="$(TargetDir)data\%(RecursiveDir)" SkipUnchangedFiles="true" />
|
2016-09-09 17:42:35 -04:00
|
|
|
|
|
|
|
<!-- tests -->
|
|
|
|
<Copy SourceFiles="@(CopyItems)" DestinationFolder="$(TargetDir)testpaint\" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="Build">
|
2016-12-02 09:42:40 -05:00
|
|
|
<PropertyGroup>
|
|
|
|
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
|
|
|
|
</PropertyGroup>
|
2016-09-20 18:57:15 -04:00
|
|
|
<Message Text="SlnProperties: $(SlnProperties)" />
|
2016-09-18 06:24:46 -04:00
|
|
|
<MSBuild Projects="openrct2.sln" Targets="Build" Properties="$(SlnProperties)" />
|
2016-09-09 17:42:35 -04:00
|
|
|
</Target>
|
|
|
|
<Target Name="Rebuild">
|
2016-12-02 09:42:40 -05:00
|
|
|
<PropertyGroup>
|
|
|
|
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
|
|
|
|
</PropertyGroup>
|
2016-09-20 18:57:15 -04:00
|
|
|
<Message Text="SlnProperties: $(SlnProperties)" />
|
2016-09-18 06:24:46 -04:00
|
|
|
<MSBuild Projects="openrct2.sln" Targets="Rebuild" Properties="$(SlnProperties)" />
|
2016-09-09 17:42:35 -04:00
|
|
|
</Target>
|
2016-12-02 09:42:40 -05:00
|
|
|
<Target Name="BuildTests">
|
|
|
|
<PropertyGroup>
|
|
|
|
<Configuration Condition="'$(Configuration)'=='Debug'">DebugTests</Configuration>
|
|
|
|
<Configuration Condition="'$(Configuration)'=='Release'">ReleaseTests</Configuration>
|
|
|
|
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
|
|
|
|
</PropertyGroup>
|
|
|
|
<Message Text="SlnProperties: $(SlnProperties)" />
|
|
|
|
<MSBuild Projects="openrct2.sln" Targets="Build" Properties="$(SlnProperties)" />
|
|
|
|
</Target>
|
2016-09-09 17:42:35 -04:00
|
|
|
|
2016-12-02 09:42:40 -05:00
|
|
|
<Target Name="Test" DependsOnTargets="BuildTests">
|
|
|
|
<Exec Command="$(TargetDir)tests\tests.exe" />
|
|
|
|
</Target>
|
|
|
|
<Target Name="TestPaint" DependsOnTargets="Build" Condition="'$(Platform)'=='Win32'">
|
2016-09-09 17:42:35 -04:00
|
|
|
<Exec Command="$(TargetDir)testpaint\openrct2.exe" />
|
2016-08-25 14:18:45 -04:00
|
|
|
</Target>
|
|
|
|
|
2016-08-21 19:09:45 -04:00
|
|
|
<!-- Target to build g2.dat containing OpenRCT2 sprites -->
|
2016-08-25 15:17:40 -04:00
|
|
|
<Target Name="g2" DependsOnTargets="Build" AfterTargets="Build" Inputs="@(g2Inputs)" Outputs="$(g2Output)">
|
2016-08-21 19:09:45 -04:00
|
|
|
<Message Text="Building g2.dat..." />
|
2016-08-22 16:45:36 -04:00
|
|
|
<Exec Command="$(OutputExe) sprite build $(g2Output) $(RootDir)resources\g2"
|
|
|
|
StandardOutputImportance="low" />
|
2016-08-22 15:39:06 -04:00
|
|
|
</Target>
|
|
|
|
|
2016-10-15 19:06:58 -04:00
|
|
|
<!-- Target to sign OpenRCT2
|
2016-08-23 13:22:06 -04:00
|
|
|
This requires the project parameter SIGN_PASSWORD to be set -->
|
2016-08-26 13:57:21 -04:00
|
|
|
<Target Name="Sign" AfterTargets="Build" Inputs="@(SignItems)" Outputs="%(SignItems.Identity).signed">
|
2016-08-23 13:22:06 -04:00
|
|
|
<Warning Condition="'$(SIGN_PASSWORD)'==''" Text="SIGN_PASSWORD was not set, skipping signing of %(SignItems.Filename)%(SignItems.Extension)." />
|
|
|
|
<Message Condition="'$(SIGN_PASSWORD)'!=''" Text="Signing %(SignItems.Filename)%(SignItems.Extension)"
|
2016-08-22 15:39:06 -04:00
|
|
|
Importance="high" />
|
2016-10-29 08:59:48 -04:00
|
|
|
<Exec EchoOff="true" Condition="'$(SIGN_PASSWORD)'!=''"
|
2016-08-23 13:22:06 -04:00
|
|
|
Command="signtool.exe sign /f $(SignCertificate) /p $(SIGN_PASSWORD) /t $(SignTimestampUrl) %(SignItems.Identity)"
|
2016-08-22 15:39:06 -04:00
|
|
|
StandardOutputImportance="low" />
|
2016-08-26 13:57:21 -04:00
|
|
|
|
|
|
|
<!-- Create a dummy file so that msbuild can use it to determine if the binary is newer than the last sign time -->
|
|
|
|
<Touch AlwaysCreate="true" Files="%(SignItems.Identity).signed" />
|
2016-08-21 19:09:45 -04:00
|
|
|
</Target>
|
2016-08-22 08:11:57 -04:00
|
|
|
|
|
|
|
<!-- Target to publish OpenRCT2 as a portable zip -->
|
2016-08-26 13:57:21 -04:00
|
|
|
<Target Name="PublishPortable" DependsOnTargets="Build;g2" Inputs="@(PublishItems)" Outputs="$(PublishZip)">
|
2016-08-22 08:11:57 -04:00
|
|
|
<MakeDir Directories="$(ArtifactsDir)" />
|
2016-08-25 18:07:02 -04:00
|
|
|
<Message Importance="high" Text="Creating $([System.IO.Path]::GetFileName($(PublishZip)))..." />
|
2016-08-25 15:17:40 -04:00
|
|
|
<_7z Output="$(PublishZip)" Inputs="@(PublishItems)" />
|
2016-08-22 08:11:57 -04:00
|
|
|
</Target>
|
2016-08-22 15:39:06 -04:00
|
|
|
|
2016-08-22 16:45:36 -04:00
|
|
|
<!-- Target to publish the OpenRCT2 debug symbols -->
|
2016-08-26 13:57:21 -04:00
|
|
|
<Target Name="PublishSymbols" DependsOnTargets="Build" Inputs="@(SymbolItems)" Outputs="$(PublishSymbolsZip)">
|
2016-08-22 15:39:06 -04:00
|
|
|
<MakeDir Directories="$(ArtifactsDir)" />
|
2016-08-25 18:07:02 -04:00
|
|
|
<Message Importance="high" Text="Creating $([System.IO.Path]::GetFileName($(PublishSymbolsZip)))..." />
|
2016-08-22 16:45:36 -04:00
|
|
|
<_7z Output="$(PublishSymbolsZip)" Inputs="@(SymbolItems)" />
|
2016-08-22 15:39:06 -04:00
|
|
|
</Target>
|
|
|
|
|
2016-08-22 17:30:47 -04:00
|
|
|
<!-- Target to publish the OpenRCT2 as an NSIS installer -->
|
|
|
|
<Target Name="PublishInstaller"
|
2016-08-26 13:57:21 -04:00
|
|
|
DependsOnTargets="Build;g2"
|
2016-08-22 17:30:47 -04:00
|
|
|
Inputs="@(PublishItems);$(NsisScript)"
|
2016-08-25 18:38:48 -04:00
|
|
|
Outputs="$(PublishInstallerExe)"
|
|
|
|
Condition="'$(NO_NSIS)'!='true'">
|
2016-08-22 17:30:47 -04:00
|
|
|
<PropertyGroup>
|
|
|
|
<PublishInstallerExeName>$([System.IO.Path]::GetFilename($(PublishInstallerExe)))</PublishInstallerExeName>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
2016-08-25 18:07:02 -04:00
|
|
|
<MakeDir Directories="$(ArtifactsDir)" />
|
|
|
|
|
2016-08-22 17:30:47 -04:00
|
|
|
<!-- Create the installer -->
|
|
|
|
<Message Text="Building Windows Installer (NSIS script)" Importance="high" />
|
2016-08-25 17:17:15 -04:00
|
|
|
<Exec Command="makensis /DOUTFILE=$(PublishInstallerExe) ^
|
|
|
|
/DAPPV_EXTRA=$(VersionExtra) ^
|
|
|
|
/DPLATFORM=$(Platform) ^
|
|
|
|
$(NsisScript)"
|
2016-08-22 17:30:47 -04:00
|
|
|
StandardOutputImportance="normal" />
|
|
|
|
|
|
|
|
<!-- Sign the installer -->
|
2016-08-23 13:22:06 -04:00
|
|
|
<Warning Condition="'$(SIGN_PASSWORD)'==''" Text="SIGN_PASSWORD was not set, skipping signing of $(PublishInstallerExeName)." />
|
|
|
|
<Message Condition="'$(SIGN_PASSWORD)'!=''" Text="Signing $(PublishInstallerExeName)"
|
2016-08-22 17:30:47 -04:00
|
|
|
Importance="high" />
|
2016-10-29 08:59:48 -04:00
|
|
|
<Exec EchoOff="true" Condition="'$(SIGN_PASSWORD)'!=''"
|
2016-08-23 13:22:06 -04:00
|
|
|
Command="signtool.exe sign /f $(SignCertificate) /p $(SIGN_PASSWORD) /t $(SignTimestampUrl) $(PublishInstallerExe)"
|
2016-08-22 17:30:47 -04:00
|
|
|
StandardOutputImportance="low" />
|
|
|
|
</Target>
|
|
|
|
|
2016-08-22 16:45:36 -04:00
|
|
|
<Target Name="PublishAll"
|
2016-08-22 17:30:47 -04:00
|
|
|
DependsOnTargets="PublishSymbols;PublishPortable;PublishInstaller" />
|
2016-08-22 16:45:36 -04:00
|
|
|
|
2016-08-23 13:13:45 -04:00
|
|
|
<!-- Target to upload the artifacts to OpenRCT2.org -->
|
|
|
|
<Target Name="UploadArtifacts" DependsOnTargets="PublishAll">
|
|
|
|
<PropertyGroup>
|
|
|
|
<UploadLink>https://openrct2.org/altapi/?command=push-build</UploadLink>
|
|
|
|
<UploadFileNameShort>%(UploadArtifacts.Filename)%(UploadArtifacts.Extension)</UploadFileNameShort>
|
|
|
|
</PropertyGroup>
|
|
|
|
<Message Text="Uploading $(UploadFileNameShort)" Importance="high" />
|
|
|
|
<Error Condition="'$(OPENRCT2_ORG_TOKEN)'==''" Text="OPENRCT2_ORG_TOKEN not set." />
|
2016-08-23 13:22:06 -04:00
|
|
|
<Error Condition="'$(GIT_COMMIT_SHA1)'==''" Text="GIT_COMMIT_SHA1 not set." />
|
|
|
|
<Error Condition="'$(GIT_BRANCH)'==''" Text="GIT_BRANCH not set." />
|
2016-10-29 08:59:48 -04:00
|
|
|
<Exec EchoOff="true" Command="curl.exe -s -o - ^
|
2016-08-23 13:22:06 -04:00
|
|
|
--form "key=$(OPENRCT2_ORG_TOKEN)" ^
|
|
|
|
--form "fileName=%(UploadArtifacts.Name)" ^
|
|
|
|
--form "version=$(Version)" ^
|
|
|
|
--form "gitHash=$(GIT_COMMIT_SHA1)" ^
|
|
|
|
--form "gitBranch=$(GIT_BRANCH)" ^
|
2016-08-23 13:13:45 -04:00
|
|
|
--form "flavourId=%(UploadArtifacts.FlavourId)" ^
|
2016-08-23 13:22:06 -04:00
|
|
|
--form "file=@%(UploadArtifacts.Identity)" ^
|
2016-08-23 13:13:45 -04:00
|
|
|
"$(UploadLink)""
|
|
|
|
CustomErrorRegularExpression=""error":1" />
|
|
|
|
</Target>
|
|
|
|
|
2016-08-21 19:09:45 -04:00
|
|
|
</Project>
|