1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-19 00:15:50 +02:00

Fix post build scripts to support moved F# executables

This commit is contained in:
chylex 2021-12-18 01:29:26 +01:00
parent ab8752845d
commit 994f9635ef
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
4 changed files with 26 additions and 19 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
bld/*
!bld/*.iss
!bld/*.bat
!bld/*.ps1
!bld/Redist
!bld/Resources

View File

@ -405,15 +405,11 @@ rmdir "$(ProjectDir)bin\Release"
rmdir "$(TargetDir)scripts" /S /Q
rmdir "$(TargetDir)plugins" /S /Q
IF EXIST "$(ProjectDir)bld\post_build.exe" (
"$(ProjectDir)bld\post_build.exe" "$(TargetDir)\" "$(ProjectDir)\" "$(ConfigurationName)"
) ELSE (
"$(DevEnvDir)CommonExtensions\Microsoft\FSharp\fsi.exe" "$(ProjectDir)Resources\PostBuild.fsx" --exec --nologo -- "$(TargetDir)\" "$(ProjectDir)\" "$(ConfigurationName)"
)
"$(ProjectDir)bld\post_build.exe" "$(TargetDir)\" "$(ProjectDir)\" "$(ConfigurationName)"
</PostBuildEvent>
</PropertyGroup>
<Target Name="BeforeBuild" Condition="(!$([System.IO.File]::Exists(&quot;$(ProjectDir)\bld\post_build.exe&quot;)) OR ($([System.IO.File]::GetLastWriteTime(&quot;$(ProjectDir)\Resources\PostBuild.fsx&quot;).Ticks) &gt; $([System.IO.File]::GetLastWriteTime(&quot;$(ProjectDir)\bld\post_build.exe&quot;).Ticks)))">
<Exec Command="&quot;$(ProjectDir)bld\POST BUILD.bat&quot; &quot;$(DevEnvDir)CommonExtensions\Microsoft\FSharp\fsc.exe&quot;" WorkingDirectory="$(ProjectDir)bld\" IgnoreExitCode="true" />
<Target Name="BeforeBuild" Condition="(!$([System.IO.File]::Exists(&quot;$(ProjectDir)bld\post_build.exe&quot;)) OR ($([System.IO.File]::GetLastWriteTime(&quot;$(ProjectDir)Resources\PostBuild.fsx&quot;).Ticks) &gt; $([System.IO.File]::GetLastWriteTime(&quot;$(ProjectDir)bld\post_build.exe&quot;).Ticks)))">
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File &quot;$(ProjectDir)bld\POST BUILD.ps1&quot; &quot;$(DevEnvDir)\CommonExtensions\Microsoft\FSharp&quot;" WorkingDirectory="$(ProjectDir)bld\" IgnoreExitCode="true" />
</Target>
<Target Name="AfterBuild" Condition="$(ConfigurationName) == Release">
<Exec Command="del &quot;$(TargetDir)*.pdb&quot;" />

View File

@ -1,12 +0,0 @@
@ECHO OFF
IF EXIST "post_build.exe" (
DEL "post_build.exe"
)
IF NOT EXIST %1 (
ECHO fsc.exe not found
EXIT 1
)
%1 --standalone --deterministic --preferreduilang:en-US --platform:x86 --target:exe --out:post_build.exe "%~dp0..\Resources\PostBuild.fsx"

22
bld/POST BUILD.ps1 Normal file
View File

@ -0,0 +1,22 @@
if ([IO.File]::Exists("post_build.exe")) {
[IO.File]::Delete("post_build.exe");
}
$fs = $args[0];
$fsc = "";
if ([IO.File]::Exists("$fs\fsc.exe")) {
$fsc = "$fs\fsc.exe";
}
if ([IO.File]::Exists("$fs\Tools\fsc.exe")) {
$fsc = "$fs\Tools\fsc.exe";
}
if ($fsc -eq "") {
Write-Host "fsc.exe not found"
$Host.SetShouldExit(1);
exit
}
& $fsc --standalone --deterministic --preferreduilang:en-US --platform:x86 --target:exe --out:post_build.exe "$PSScriptRoot\..\Resources\PostBuild.fsx"