build: auto-copy published exes to repo root
After every `dotnet publish -c Release`, the single-file binaries land in C:\ASTERION\GIT\PS_Launcher\ next to PS_Launcher.sln so they can be launched directly without digging into bin/Release/.../publish/. Implemented as an MSBuild AfterTargets="Publish" target on each csproj (PSLauncher.App, PSLauncher.Updater) using $(MSBuildThisFileDirectory) to resolve the repo root portably. Condition='Release' so debug builds don't pollute the root. .gitignore covers /PSLauncher.exe and /PSLauncher.Updater.exe so the committed tree stays clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -35,3 +35,7 @@ server/builds/*
|
|||||||
|
|
||||||
# Plans
|
# Plans
|
||||||
.claude/
|
.claude/
|
||||||
|
|
||||||
|
# Binaires copiés par le post-publish à la racine du repo
|
||||||
|
/PSLauncher.exe
|
||||||
|
/PSLauncher.Updater.exe
|
||||||
|
|||||||
Binary file not shown.
@@ -49,4 +49,19 @@
|
|||||||
<Resource Include="Resources\pirulen.otf" />
|
<Resource Include="Resources\pirulen.otf" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<!-- Après chaque `dotnet publish -c Release`, copie le single-file exe à la racine du repo
|
||||||
|
(C:\ASTERION\GIT\PS_Launcher\PSLauncher.exe) pour avoir un binaire prêt à tester
|
||||||
|
sans aller chercher dans bin\Release\... -->
|
||||||
|
<Target Name="CopyPublishedToRepoRoot" AfterTargets="Publish"
|
||||||
|
Condition=" '$(Configuration)' == 'Release' ">
|
||||||
|
<PropertyGroup>
|
||||||
|
<RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\'))</RepoRoot>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Copy SourceFiles="$(PublishDir)$(AssemblyName).exe"
|
||||||
|
DestinationFolder="$(RepoRoot)"
|
||||||
|
SkipUnchangedFiles="false"
|
||||||
|
OverwriteReadOnlyFiles="true" />
|
||||||
|
<Message Importance="high" Text="Copied $(AssemblyName).exe to $(RepoRoot)" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -19,4 +19,18 @@
|
|||||||
<PublishTrimmed>false</PublishTrimmed>
|
<PublishTrimmed>false</PublishTrimmed>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- Copie automatique du single-file Updater à la racine du repo après chaque
|
||||||
|
`dotnet publish -c Release`. -->
|
||||||
|
<Target Name="CopyPublishedToRepoRoot" AfterTargets="Publish"
|
||||||
|
Condition=" '$(Configuration)' == 'Release' ">
|
||||||
|
<PropertyGroup>
|
||||||
|
<RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\'))</RepoRoot>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Copy SourceFiles="$(PublishDir)$(AssemblyName).exe"
|
||||||
|
DestinationFolder="$(RepoRoot)"
|
||||||
|
SkipUnchangedFiles="false"
|
||||||
|
OverwriteReadOnlyFiles="true" />
|
||||||
|
<Message Importance="high" Text="Copied $(AssemblyName).exe to $(RepoRoot)" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user