| 1 | <Project> |
| 2 | <PropertyGroup> |
| 3 | <!-- 명시적으로 전달하는 게시 속성을 제거 목록에 중복하지 않음. --> |
| 4 | <_ZipeloWorkerPublishRemoveProperties>PublishProfile;PublishProfileFullPath;PublishUrl;OutputPath;OutDir;BaseOutputPath;BaseIntermediateOutputPath;IntermediateOutputPath;TargetDir;NoBuild;PublishSelfContained</_ZipeloWorkerPublishRemoveProperties> |
| 5 | <_ZipeloWorkerProject>$(MSBuildThisFileDirectory)../Zipelo.Worker/Zipelo.Worker.csproj</_ZipeloWorkerProject> |
| 6 | </PropertyGroup> |
| 7 | |
| 8 | <Target Name="PrepareZipeloWorkerDeployment"> |
| 9 | <PropertyGroup> |
| 10 | <_ZipeloWorkerSelfContained Condition="'$(SelfContained)' == ''">false</_ZipeloWorkerSelfContained> |
| 11 | <_ZipeloWorkerSelfContained Condition="'$(SelfContained)' != ''">$(SelfContained)</_ZipeloWorkerSelfContained> |
| 12 | </PropertyGroup> |
| 13 | </Target> |
| 14 | |
| 15 | <!-- 개발 빌드의 작업자 출력을 앱 기준 고정 하위 폴더에 배치함. --> |
| 16 | <Target Name="StageZipeloWorkerForBuild" AfterTargets="Build" DependsOnTargets="PrepareZipeloWorkerDeployment" |
| 17 | Condition="'$(DesignTimeBuild)' != 'true' And ('$(OS)' == 'Windows_NT' Or '$(RuntimeIdentifier)' == 'win-x64')"> |
| 18 | <MSBuild Projects="$(_ZipeloWorkerProject)" Targets="GetTargetPath" |
| 19 | RemoveProperties="TargetFramework;PublishProfile;PublishProfileFullPath;PublishDir;OutputPath;OutDir;BaseOutputPath;BaseIntermediateOutputPath;IntermediateOutputPath;TargetDir" |
| 20 | Properties="Configuration=$(Configuration);TargetFramework=net10.0;RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(_ZipeloWorkerSelfContained);UseAppHost=true"> |
| 21 | <Output TaskParameter="TargetOutputs" ItemName="_ZipeloWorkerTargetPath" /> |
| 22 | </MSBuild> |
| 23 | <Error Condition="'@(_ZipeloWorkerTargetPath)' == ''" Text="작업자 출력 위치를 확인하지 못했습니다." /> |
| 24 | <PropertyGroup> |
| 25 | <_ZipeloWorkerBuildDirectory>@(_ZipeloWorkerTargetPath->'%(RootDir)%(Directory)')</_ZipeloWorkerBuildDirectory> |
| 26 | </PropertyGroup> |
| 27 | <ItemGroup> |
| 28 | <_ZipeloWorkerBuildFile Include="$(_ZipeloWorkerBuildDirectory)**/*" |
| 29 | Exclude="$(_ZipeloWorkerBuildDirectory)publish/**/*" /> |
| 30 | </ItemGroup> |
| 31 | <Error Condition="!Exists('$(_ZipeloWorkerBuildDirectory)Zipelo.Worker.exe') Or !Exists('$(_ZipeloWorkerBuildDirectory)Zipelo.Worker.dll') Or !Exists('$(_ZipeloWorkerBuildDirectory)Zipelo.Worker.runtimeconfig.json') Or !Exists('$(_ZipeloWorkerBuildDirectory)Zipelo.Worker.deps.json') Or !Exists('$(_ZipeloWorkerBuildDirectory)Zipelo.Core.dll') Or !Exists('$(_ZipeloWorkerBuildDirectory)Zipelo.Runtime.dll')" |
| 32 | Text="작업자 필수 빌드 파일이 누락되었습니다. Desktop과 작업자를 같은 구성으로 빌드하세요." /> |
| 33 | <Copy SourceFiles="@(_ZipeloWorkerBuildFile)" |
| 34 | DestinationFiles="@(_ZipeloWorkerBuildFile->'$(TargetDir)worker/%(RecursiveDir)%(Filename)%(Extension)')" |
| 35 | SkipUnchangedFiles="true" /> |
| 36 | </Target> |
| 37 | |
| 38 | <!-- 최종 배치는 UI 게시 위치 아래에 SDK가 같은 RID로 별도 게시하도록 함. --> |
| 39 | <Target Name="PublishZipeloWorker" AfterTargets="Publish" DependsOnTargets="PrepareZipeloWorkerDeployment" |
| 40 | Condition="'$(DesignTimeBuild)' != 'true' And ('$(OS)' == 'Windows_NT' Or '$(RuntimeIdentifier)' == 'win-x64')"> |
| 41 | <Error Condition="'$(PublishDir)' == ''" Text="Windows UI 게시 출력 디렉터리가 비어 있습니다." /> |
| 42 | <PropertyGroup> |
| 43 | <_ZipeloWorkerPublishSelfContained>$(_ZipeloWorkerSelfContained)</_ZipeloWorkerPublishSelfContained> |
| 44 | <_ZipeloWorkerPublishSelfContained Condition="'$(PublishSelfContained)' != ''">$(PublishSelfContained)</_ZipeloWorkerPublishSelfContained> |
| 45 | <_ZipeloWorkerPublishStage>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)', '$(MSBuildProjectDirectory)'))/zipelo-worker-publish/$([System.Guid]::NewGuid())/</_ZipeloWorkerPublishStage> |
| 46 | <_ZipeloWorkerPublishDirectory>$([System.IO.Path]::GetFullPath('$(PublishDir)', '$(MSBuildProjectDirectory)'))/worker/</_ZipeloWorkerPublishDirectory> |
| 47 | </PropertyGroup> |
| 48 | <!-- 이번 게시의 새 SDK 출력만 수집하며 이전 bin/publish를 검색하지 않음. --> |
| 49 | <MakeDir Directories="$(_ZipeloWorkerPublishStage)" /> |
| 50 | <MSBuild Projects="$(_ZipeloWorkerProject)" Targets="Publish" |
| 51 | RemoveProperties="$(_ZipeloWorkerPublishRemoveProperties)" |
| 52 | Properties="Configuration=$(Configuration);TargetFramework=net10.0;RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(_ZipeloWorkerPublishSelfContained);UseAppHost=true;PublishSingleFile=false;PublishTrimmed=false;PublishAot=false;PublishDir=$(_ZipeloWorkerPublishStage)" /> |
| 53 | <ItemGroup> |
| 54 | <_ZipeloWorkerPublishRequired Include="$(_ZipeloWorkerPublishStage)Zipelo.Worker.exe;$(_ZipeloWorkerPublishStage)Zipelo.Worker.dll;$(_ZipeloWorkerPublishStage)Zipelo.Worker.deps.json;$(_ZipeloWorkerPublishStage)Zipelo.Worker.runtimeconfig.json;$(_ZipeloWorkerPublishStage)Zipelo.Core.dll;$(_ZipeloWorkerPublishStage)Zipelo.Runtime.dll" /> |
| 55 | <_ZipeloWorkerPublishRequired Include="$(_ZipeloWorkerPublishStage)System.Private.CoreLib.dll;$(_ZipeloWorkerPublishStage)coreclr.dll;$(_ZipeloWorkerPublishStage)clrjit.dll;$(_ZipeloWorkerPublishStage)hostfxr.dll;$(_ZipeloWorkerPublishStage)hostpolicy.dll" |
| 56 | Condition="'$(_ZipeloWorkerPublishSelfContained)' == 'true'" /> |
| 57 | </ItemGroup> |
| 58 | <Error Condition="!Exists('%(_ZipeloWorkerPublishRequired.Identity)')" Text="Windows 작업자 필수 게시 파일이 누락되었습니다: %(_ZipeloWorkerPublishRequired.Filename)%(_ZipeloWorkerPublishRequired.Extension)" /> |
| 59 | <ItemGroup> |
| 60 | <_ZipeloWorkerPublishedFile Include="$(_ZipeloWorkerPublishStage)**/*" /> |
| 61 | </ItemGroup> |
| 62 | <Copy SourceFiles="@(_ZipeloWorkerPublishedFile)" |
| 63 | DestinationFiles="@(_ZipeloWorkerPublishedFile->'$(_ZipeloWorkerPublishDirectory)%(RecursiveDir)%(Filename)%(Extension)')" |
| 64 | SkipUnchangedFiles="false" /> |
| 65 | <RemoveDir Directories="$(_ZipeloWorkerPublishStage)" /> |
| 66 | </Target> |
| 67 | </Project> |