| 1 | <Project> |
| 2 | <PropertyGroup> |
| 3 | <_ZipeloWorkerProject>$(MSBuildThisFileDirectory)../Zipelo.Worker/Zipelo.Worker.csproj</_ZipeloWorkerProject> |
| 4 | </PropertyGroup> |
| 5 | |
| 6 | <Target Name="PrepareZipeloWorkerDeployment"> |
| 7 | <PropertyGroup> |
| 8 | <_ZipeloWorkerSelfContained Condition="'$(SelfContained)' == ''">false</_ZipeloWorkerSelfContained> |
| 9 | <_ZipeloWorkerSelfContained Condition="'$(SelfContained)' != ''">$(SelfContained)</_ZipeloWorkerSelfContained> |
| 10 | </PropertyGroup> |
| 11 | </Target> |
| 12 | |
| 13 | <!-- 개발 빌드의 작업자 출력을 앱 기준 고정 하위 폴더에 배치함. --> |
| 14 | <Target Name="StageZipeloWorkerForBuild" AfterTargets="Build" DependsOnTargets="PrepareZipeloWorkerDeployment" |
| 15 | Condition="'$(DesignTimeBuild)' != 'true' And ('$(OS)' == 'Windows_NT' Or '$(RuntimeIdentifier)' == 'win-x64')"> |
| 16 | <MSBuild Projects="$(_ZipeloWorkerProject)" Targets="GetTargetPath" |
| 17 | RemoveProperties="TargetFramework;PublishProfile;PublishProfileFullPath;PublishDir;OutputPath;OutDir;BaseOutputPath;BaseIntermediateOutputPath;IntermediateOutputPath;TargetDir" |
| 18 | Properties="Configuration=$(Configuration);TargetFramework=net10.0;RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(_ZipeloWorkerSelfContained);UseAppHost=true"> |
| 19 | <Output TaskParameter="TargetOutputs" ItemName="_ZipeloWorkerTargetPath" /> |
| 20 | </MSBuild> |
| 21 | <Error Condition="'@(_ZipeloWorkerTargetPath)' == ''" Text="작업자 출력 위치를 확인하지 못했습니다." /> |
| 22 | <PropertyGroup> |
| 23 | <_ZipeloWorkerBuildDirectory>@(_ZipeloWorkerTargetPath->'%(RootDir)%(Directory)')</_ZipeloWorkerBuildDirectory> |
| 24 | </PropertyGroup> |
| 25 | <ItemGroup> |
| 26 | <_ZipeloWorkerBuildFile Include="$(_ZipeloWorkerBuildDirectory)**/*" |
| 27 | Exclude="$(_ZipeloWorkerBuildDirectory)publish/**/*" /> |
| 28 | </ItemGroup> |
| 29 | <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')" |
| 30 | Text="작업자 필수 빌드 파일이 누락되었습니다. Desktop과 작업자를 같은 구성으로 빌드하세요." /> |
| 31 | <Copy SourceFiles="@(_ZipeloWorkerBuildFile)" |
| 32 | DestinationFiles="@(_ZipeloWorkerBuildFile->'$(TargetDir)worker/%(RecursiveDir)%(Filename)%(Extension)')" |
| 33 | SkipUnchangedFiles="true" /> |
| 34 | </Target> |
| 35 | |
| 36 | <!-- 게시 시 개발 빌드 폴더 대신 같은 RID와 런타임 방식의 게시물을 사용함. --> |
| 37 | <Target Name="PublishZipeloWorker" AfterTargets="Publish" DependsOnTargets="PrepareZipeloWorkerDeployment" |
| 38 | Condition="'$(DesignTimeBuild)' != 'true' And ('$(OS)' == 'Windows_NT' Or '$(RuntimeIdentifier)' == 'win-x64')"> |
| 39 | <PropertyGroup> |
| 40 | <_ZipeloWorkerPublishDirectory>$([System.IO.Path]::GetFullPath('$(PublishDir)', '$(MSBuildProjectDirectory)'))/worker/</_ZipeloWorkerPublishDirectory> |
| 41 | </PropertyGroup> |
| 42 | <MSBuild Projects="$(_ZipeloWorkerProject)" Targets="Publish" |
| 43 | RemoveProperties="TargetFramework;PublishProfile;PublishProfileFullPath;PublishDir;OutputPath;OutDir;BaseOutputPath;BaseIntermediateOutputPath;IntermediateOutputPath;TargetDir;NoBuild" |
| 44 | Properties="Configuration=$(Configuration);TargetFramework=net10.0;RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(_ZipeloWorkerSelfContained);UseAppHost=true;PublishSingleFile=false;PublishTrimmed=false;PublishDir=$(_ZipeloWorkerPublishDirectory)" /> |
| 45 | <Error Condition="!Exists('$(_ZipeloWorkerPublishDirectory)Zipelo.Worker.exe') Or !Exists('$(_ZipeloWorkerPublishDirectory)Zipelo.Worker.dll') Or !Exists('$(_ZipeloWorkerPublishDirectory)Zipelo.Worker.runtimeconfig.json') Or !Exists('$(_ZipeloWorkerPublishDirectory)Zipelo.Worker.deps.json') Or !Exists('$(_ZipeloWorkerPublishDirectory)Zipelo.Core.dll') Or !Exists('$(_ZipeloWorkerPublishDirectory)Zipelo.Runtime.dll')" |
| 46 | Text="작업자 게시 파일이 누락되어 배포를 완료할 수 없습니다." /> |
| 47 | </Target> |
| 48 | </Project> |