mirror of https://github.com/OpenRCT2/OpenRCT2.git
Automatically download title sequences in msbuild
This commit is contained in:
parent
f57d69eeb9
commit
5583d7afd0
|
@ -221,6 +221,39 @@
|
|||
StandardOutputImportance="low" />
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
<SequencesUrl>https://github.com/OpenRCT2/title-sequences/releases/download/v0.0.5/title-sequence-v0.0.5.zip</SequencesUrl>
|
||||
<SequencesPath>$(TargetDir)data\title</SequencesPath>
|
||||
<SequencesZip>$(TargetDir)data\title\seqs.zip</SequencesZip>
|
||||
<SequencesVersionPath>$(TargetDir)sequencesversion</SequencesVersionPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CheckTitleSequences" AfterTargets="Build">
|
||||
<PropertyGroup>
|
||||
<CurrentSequencesVersion Condition="Exists($(SequencesVersionPath))">$([System.IO.File]::ReadAllText($(SequencesVersionPath)).Trim())</CurrentSequencesVersion>
|
||||
<UpdateSequences Condition="'$(CurrentSequencesVersion)'!='$(SequencesUrl)'">true</UpdateSequences>
|
||||
</PropertyGroup>
|
||||
|
||||
<Message Condition="'$(UpdateSequences)'!='true'" Text="Sequences up to date" Importance="high" />
|
||||
<Message Condition="'$(UpdateSequences)'=='true'" Text="Sequences out of date, updating..." Importance="high" />
|
||||
<CallTarget Condition="'$(UpdateSequences)'=='true'" Targets="DownloadTitleSequences" />
|
||||
</Target>
|
||||
|
||||
<!-- Target to download the title sequences -->
|
||||
<Target Name="DownloadTitleSequences">
|
||||
<!-- Clean sequences directory -->
|
||||
<RemoveDir Directories="$(SequencesPath)" />
|
||||
<MakeDir Directories="$(SequencesPath)" />
|
||||
|
||||
<Message Text="Downloading title sequences..." Importance="normal" />
|
||||
<Exec Command="powershell -ExecutionPolicy Unrestricted -Command "Invoke-WebRequest '$(SequencesUrl)' -OutFile '$(SequencesZip)'"" StandardOutputImportance="low" />
|
||||
<Unzip Input="$(SequencesZip)" OutputDirectory="$(SequencesPath)" />
|
||||
<Delete Files="$(SequencesZip)" ContinueOnError="true" />
|
||||
|
||||
<!-- Update version file -->
|
||||
<WriteLinesToFile Lines="$(SequencesUrl)" File="$(SequencesVersionPath)" Overwrite="true" />
|
||||
</Target>
|
||||
|
||||
<!-- Target to sign OpenRCT2
|
||||
This requires the project parameter SIGN_PASSWORD to be set -->
|
||||
<Target Name="Sign" AfterTargets="Build" Inputs="@(SignItems)" Outputs="%(SignItems.Identity).signed"
|
||||
|
|
Loading…
Reference in New Issue