Ubisam-MergeTool/Directory.Build.targets
choiminyeong 5e5ef8c36f 플랫폼 최초 커밋 + 자동 업데이트 배포 폴더(dist)
소스(Core/Shell/Launcher)와 실행 PC가 받아갈 업데이트 파일(dist)을 함께 올린다.
Launcher가 켤 때 이 저장소의 dist와 D:\UbisamPlatform\bin을 비교해 새 버전이면 받아간다.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 21:56:35 +09:00

53 lines
4.9 KiB
XML

<Project>
<!-- 플랫폼을 빌드하면(Debug/Release 구분 없이) 결과물을 곧바로 D:\UbisamPlatform\bin에 반영한다.
이 폴더를 참조하는 모든 프로그램은 UbisamBase.Launcher로 실행되고, Launcher는 실행할 때마다
이 폴더를 복사해 가므로, 플랫폼을 빌드한 다음 프로그램을 실행하는 순간부터 새 플랫폼으로 뜬다.
- Core : UbisamBase.Core.dll만 반영 (Core만 따로 빌드해도 바로 반영되도록)
- Shell : 출력 폴더 전체(Shell.exe, Core.dll, 의존 dll, 네이티브 폴더) + Launcher 설정 + README
- Launcher : UbisamBase.Launcher.exe만 반영 (Launcher 설정 파일은 Shell 쪽에서 만든다 - 아래 참고)
.pdb는 반영하지 않는다(소스 없는 배포본 유지). 기존 파일은 지우지 않고 덮어쓰기만 하므로,
쓰지 않게 된 옛 dll까지 정리하려면 scripts\publish-platform.ps1(비우고 다시 채움)을 쓴다. -->
<PropertyGroup>
<UbisamPublishDir>D:\UbisamPlatform\bin\</UbisamPublishDir>
<!-- VS의 "빠른 최신 상태 확인"은 소스가 안 바뀌었으면 MSBuild를 아예 부르지 않고 넘어간다.
그러면 아래 반영 타겟도 안 돌아서, D드라이브가 다른 빌드(예: 깨끗한 배포본 스크립트의
Release)로 바뀌어 있어도 "빌드했는데 갱신이 안 된다"가 된다. 빌드를 누를 때마다 실제로
MSBuild가 돌게 해서 반영이 항상 일어나게 한다(컴파일은 여전히 바뀐 게 있을 때만 한다). -->
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
<Target Name="PublishCoreToPlatformDir" AfterTargets="Build" Condition="'$(MSBuildProjectName)' == 'UbisamBase.Core'">
<MakeDir Directories="$(UbisamPublishDir)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(UbisamPublishDir)" SkipUnchangedFiles="true" />
</Target>
<Target Name="PublishShellToPlatformDir" AfterTargets="Build" Condition="'$(MSBuildProjectName)' == 'UbisamBase.Shell'">
<ItemGroup>
<_UbisamShellOutput Include="$(TargetDir)**\*.*" Exclude="$(TargetDir)**\*.pdb" />
</ItemGroup>
<PropertyGroup>
<_UbisamPublishedAt>$([System.DateTime]::Now.ToString('yyyy-MM-dd HH:mm:ss'))</_UbisamPublishedAt>
<_UbisamReadme>UbisamBase 플랫폼 배포 폴더 (빌드할 때 자동 생성 - 직접 고치지 마세요);갱신 시각 : $(_UbisamPublishedAt);빌드 구성 : $(Configuration);원본 소스 : $(MSBuildThisFileDirectory);----;이 폴더는 원본 소스에서 플랫폼(Core/Shell/Launcher)을 빌드할 때마다 자동으로 갱신됩니다(Debug/Release 모두).;소스(.cs)와 디버그 심볼(.pdb)은 들어 있지 않습니다.;----;이 폴더를 참조하는 프로그램은 UbisamBase.Launcher.exe로 실행됩니다.;Launcher는 실행할 때마다 이 폴더 내용을 자기 폴더로 복사한 뒤 Shell을 띄우므로,;플랫폼이 갱신되면 프로그램을 다시 빌드하지 않아도 다음 실행부터 새 버전이 적용됩니다.;----;다른 PC에서 쓰려면 이 폴더를 통째로 그 PC의 D:\UbisamPlatform\bin 에 복사하면 됩니다.;쓰지 않게 된 옛 파일까지 정리하려면 원본 소스 폴더에서 scripts\publish-platform.ps1 을 실행하세요.</_UbisamReadme>
</PropertyGroup>
<MakeDir Directories="$(UbisamPublishDir)" />
<Copy SourceFiles="@(_UbisamShellOutput)" DestinationFiles="@(_UbisamShellOutput->'$(UbisamPublishDir)%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
<!-- Launcher는 Shell을 자기 프로세스 안에서 로드하므로 실제로 적용되는 설정 파일은 Launcher 것이다.
Shell의 바인딩 리디렉트가 없으면 실행 직후 FileLoadException으로 죽으므로 Shell 설정을 그대로 쓴다. -->
<Copy SourceFiles="$(TargetDir)UbisamBase.Shell.exe.config" DestinationFiles="$(UbisamPublishDir)UbisamBase.Launcher.exe.config" />
<WriteLinesToFile File="$(UbisamPublishDir)README.txt" Lines="$(_UbisamReadme)" Overwrite="true" />
<!-- 버전 도장 — Launcher가 깃 저장소의 업데이트 파일(dist)과 비교할 때 쓰는 기준값이다.
배포 시각이라 문자열 비교만으로 어느 쪽이 새것인지 가려진다. -->
<WriteLinesToFile File="$(UbisamPublishDir)platform-version.json" Overwrite="true" Lines="{; &quot;version&quot;: &quot;$(_UbisamPublishedAt)&quot;,; &quot;configuration&quot;: &quot;$(Configuration)&quot;;}" />
<Message Importance="high" Text="UbisamBase 플랫폼 -> $(UbisamPublishDir) 반영 ($(Configuration))" />
</Target>
<Target Name="PublishLauncherToPlatformDir" AfterTargets="Build" Condition="'$(MSBuildProjectName)' == 'UbisamBase.Launcher'">
<MakeDir Directories="$(UbisamPublishDir)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(UbisamPublishDir)" SkipUnchangedFiles="true" />
</Target>
</Project>