You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
2.0 KiB
XML

<Project>
<PropertyGroup>
<InkVersion>v1.1.1</InkVersion>
<!-- Directories -->
<GodotDotDirectory>$([System.IO.Path]::Combine($(GodotProjectDir),'.godot'))</GodotDotDirectory>
<GodotMonoDirectory>$([System.IO.Path]::Combine($(GodotDotDirectory),'mono'))</GodotMonoDirectory>
<UnzipDirectory>$([System.IO.Path]::Combine($(GodotDotDirectory),'ink'))</UnzipDirectory>
<InkVersionDirectory>$([System.IO.Path]::Combine($(GodotMonoDirectory),'ink-$(InkVersion)'))</InkVersionDirectory>
<!-- File -->
<InkZip>inklecate_windows.zip</InkZip>
<InkZipPath>$([System.IO.Path]::Combine($(GodotDotDirectory),$(InkZip)))</InkZipPath>
<InkUrl>https://github.com/inkle/ink/releases/download/$(InkVersion)/$(InkZip)</InkUrl>
<InkCompiler>ink_compiler.dll</InkCompiler>
<InkCompilerPath>$([System.IO.Path]::Combine($(InkVersionDirectory),$(InkCompiler)))</InkCompilerPath>
<InkRuntime>ink-engine-runtime.dll</InkRuntime>
<InkRuntimePath>$([System.IO.Path]::Combine($(InkVersionDirectory),$(InkRuntime)))</InkRuntimePath>
</PropertyGroup>
<Target Name="DownloadInkDependency" AfterTargets="BeforeBuild" Condition="!Exists('$(InkCompilerPath)') Or !Exists('$(InkRuntimePath)')">
<!-- Download and unzip -->
<DownloadFile SourceUrl="$(InkUrl)" DestinationFolder="$(GodotDotDirectory)" />
<Unzip SourceFiles="$(InkZipPath)" DestinationFolder="$(UnzipDirectory)" />
<!-- Extract what we want -->
<ItemGroup>
<FilesToMove Include="$([System.IO.Path]::Combine($(UnzipDirectory),$(InkCompiler)))" />
<FilesToMove Include="$([System.IO.Path]::Combine($(UnzipDirectory),$(InkRuntime)))" />
</ItemGroup>
<Move SourceFiles="@(FilesToMove)" DestinationFolder="$(InkVersionDirectory)" />
<!-- Cleanup -->
<Delete Files="$(InkZipPath)" />
<RemoveDir Directories="$(UnzipDirectory)" />
</Target>
<ItemGroup>
<Reference Include="$(InkCompilerPath)" Condition="'$(Configuration)' == 'Debug'" />
<Reference Include="$(InkRuntimePath)" />
</ItemGroup>
</Project>