| 1 | <Project> |
| 2 | <PropertyGroup> |
| 3 | <_UbuntuWorkerProject>$(MSBuildThisFileDirectory)../Zipelo.Worker/Zipelo.Worker.csproj</_UbuntuWorkerProject> |
| 4 | <_UbuntuWorkerRemoveProperties>PublishProfile;PublishProfileFullPath;PublishDir;PublishUrl;OutputPath;OutDir;BaseOutputPath;BaseIntermediateOutputPath;IntermediateOutputPath;TargetDir;NoBuild</_UbuntuWorkerRemoveProperties> |
| 5 | <!-- 명시적으로 전달하는 속성을 제거 목록에 중복하지 않음. --> |
| 6 | <_UbuntuWorkerPublishRemoveProperties>PublishProfile;PublishProfileFullPath;PublishUrl;OutputPath;OutDir;BaseOutputPath;BaseIntermediateOutputPath;IntermediateOutputPath;TargetDir;NoBuild;PublishSelfContained</_UbuntuWorkerPublishRemoveProperties> |
| 7 | </PropertyGroup> |
| 8 | |
| 9 | <Target Name="PrepareUbuntuWorkerDeployment"> |
| 10 | <PropertyGroup> |
| 11 | <_UbuntuWorkerSelfContained>$(SelfContained)</_UbuntuWorkerSelfContained> |
| 12 | <_UbuntuWorkerSelfContained Condition="'$(_UbuntuWorkerSelfContained)' == ''">false</_UbuntuWorkerSelfContained> |
| 13 | <_UbuntuWorkerWindows>false</_UbuntuWorkerWindows> |
| 14 | <_UbuntuWorkerWindows Condition="$([System.String]::Copy('$(RuntimeIdentifier)').StartsWith('win-')) Or ('$(RuntimeIdentifier)' == '' And '$(OS)' == 'Windows_NT')">true</_UbuntuWorkerWindows> |
| 15 | <_UbuntuWorkerAppHost>Zipelo.Worker</_UbuntuWorkerAppHost> |
| 16 | <_UbuntuWorkerAppHost Condition="'$(_UbuntuWorkerWindows)' == 'true'">Zipelo.Worker.exe</_UbuntuWorkerAppHost> |
| 17 | </PropertyGroup> |
| 18 | </Target> |
| 19 | |
| 20 | <!-- 개발 배치는 같은 구성의 작업자 빌드 출력에서 실행 의존 파일만 복사함. --> |
| 21 | <Target Name="StageUbuntuWorkerForBuild" AfterTargets="Build" DependsOnTargets="PrepareUbuntuWorkerDeployment" |
| 22 | Condition="'$(DesignTimeBuild)' != 'true'"> |
| 23 | <MSBuild Projects="$(_UbuntuWorkerProject)" Targets="GetTargetPath" |
| 24 | RemoveProperties="$(_UbuntuWorkerRemoveProperties)" |
| 25 | Properties="Configuration=$(Configuration);TargetFramework=net10.0;RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(_UbuntuWorkerSelfContained);UseAppHost=true;PublishSingleFile=false;PublishTrimmed=false;PublishAot=false"> |
| 26 | <Output TaskParameter="TargetOutputs" ItemName="_UbuntuWorkerTargetPath" /> |
| 27 | </MSBuild> |
| 28 | <Error Condition="'@(_UbuntuWorkerTargetPath)' == ''" Text="Ubuntu 작업자의 빌드 출력 위치를 확인하지 못했습니다." /> |
| 29 | <PropertyGroup> |
| 30 | <_UbuntuWorkerBuildDirectory>@(_UbuntuWorkerTargetPath->'%(RootDir)%(Directory)')</_UbuntuWorkerBuildDirectory> |
| 31 | </PropertyGroup> |
| 32 | <ItemGroup> |
| 33 | <_UbuntuWorkerBuildRequired Include="$(_UbuntuWorkerBuildDirectory)$(_UbuntuWorkerAppHost);$(_UbuntuWorkerBuildDirectory)Zipelo.Worker.dll;$(_UbuntuWorkerBuildDirectory)Zipelo.Worker.deps.json;$(_UbuntuWorkerBuildDirectory)Zipelo.Worker.runtimeconfig.json;$(_UbuntuWorkerBuildDirectory)Zipelo.Core.dll;$(_UbuntuWorkerBuildDirectory)Zipelo.Runtime.dll" /> |
| 34 | <_UbuntuWorkerBuildRequired Include="$(_UbuntuWorkerBuildDirectory)System.Private.CoreLib.dll" |
| 35 | Condition="'$(_UbuntuWorkerSelfContained)' == 'true'" /> |
| 36 | </ItemGroup> |
| 37 | <Error Condition="!Exists('%(_UbuntuWorkerBuildRequired.Identity)')" Text="Ubuntu 작업자 필수 빌드 파일이 누락되었습니다: %(_UbuntuWorkerBuildRequired.Filename)%(_UbuntuWorkerBuildRequired.Extension)" /> |
| 38 | <ItemGroup> |
| 39 | <_UbuntuWorkerBuildFile Include="$(_UbuntuWorkerBuildDirectory)*.dll;$(_UbuntuWorkerBuildDirectory)*.so;$(_UbuntuWorkerBuildDirectory)*.so.*;$(_UbuntuWorkerBuildDirectory)$(_UbuntuWorkerAppHost);$(_UbuntuWorkerBuildDirectory)Zipelo.Worker.deps.json;$(_UbuntuWorkerBuildDirectory)Zipelo.Worker.runtimeconfig.json" /> |
| 40 | <_UbuntuWorkerBuildFile Include="$(_UbuntuWorkerBuildDirectory)**/*.resources.dll" |
| 41 | Exclude="$(_UbuntuWorkerBuildDirectory)*.resources.dll" /> |
| 42 | </ItemGroup> |
| 43 | <Copy SourceFiles="@(_UbuntuWorkerBuildFile)" |
| 44 | DestinationFiles="@(_UbuntuWorkerBuildFile->'$(TargetDir)worker/%(RecursiveDir)%(Filename)%(Extension)')" |
| 45 | SkipUnchangedFiles="true" /> |
| 46 | </Target> |
| 47 | |
| 48 | <!-- 최종 배치는 UI 게시 위치 아래에 SDK가 같은 RID로 별도 게시하도록 함. --> |
| 49 | <Target Name="PublishUbuntuWorker" AfterTargets="Publish" DependsOnTargets="PrepareUbuntuWorkerDeployment" |
| 50 | Condition="'$(DesignTimeBuild)' != 'true'"> |
| 51 | <Error Condition="'$(RuntimeIdentifier)' != 'linux-x64'" Text="Ubuntu 최종 게시에는 명시적인 linux-x64 RID가 필요합니다." /> |
| 52 | <Error Condition="'$(PublishDir)' == ''" Text="Ubuntu UI 게시 출력 디렉터리가 비어 있습니다." /> |
| 53 | <PropertyGroup> |
| 54 | <_UbuntuWorkerPublishSelfContained>$(_UbuntuWorkerSelfContained)</_UbuntuWorkerPublishSelfContained> |
| 55 | <_UbuntuWorkerPublishSelfContained Condition="'$(PublishSelfContained)' != ''">$(PublishSelfContained)</_UbuntuWorkerPublishSelfContained> |
| 56 | <_UbuntuWorkerPublishStage>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)', '$(MSBuildProjectDirectory)'))/zipelo-worker-publish/$([System.Guid]::NewGuid())/</_UbuntuWorkerPublishStage> |
| 57 | <_UbuntuWorkerPublishDirectory>$([System.IO.Path]::GetFullPath('$(PublishDir)', '$(MSBuildProjectDirectory)'))/worker/</_UbuntuWorkerPublishDirectory> |
| 58 | </PropertyGroup> |
| 59 | <!-- 이번 게시의 새 SDK 출력만 수집하며 이전 bin/publish를 검색하지 않음. --> |
| 60 | <MakeDir Directories="$(_UbuntuWorkerPublishStage)" /> |
| 61 | <MSBuild Projects="$(_UbuntuWorkerProject)" Targets="Publish" |
| 62 | RemoveProperties="$(_UbuntuWorkerPublishRemoveProperties)" |
| 63 | Properties="Configuration=$(Configuration);TargetFramework=net10.0;RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(_UbuntuWorkerPublishSelfContained);UseAppHost=true;PublishSingleFile=false;PublishTrimmed=false;PublishAot=false;PublishDir=$(_UbuntuWorkerPublishStage)" /> |
| 64 | <ItemGroup> |
| 65 | <_UbuntuWorkerPublishRequired Include="$(_UbuntuWorkerPublishStage)Zipelo.Worker;$(_UbuntuWorkerPublishStage)Zipelo.Worker.dll;$(_UbuntuWorkerPublishStage)Zipelo.Worker.deps.json;$(_UbuntuWorkerPublishStage)Zipelo.Worker.runtimeconfig.json;$(_UbuntuWorkerPublishStage)Zipelo.Core.dll;$(_UbuntuWorkerPublishStage)Zipelo.Runtime.dll" /> |
| 66 | <_UbuntuWorkerPublishRequired Include="$(_UbuntuWorkerPublishStage)System.Private.CoreLib.dll;$(_UbuntuWorkerPublishStage)libcoreclr.so;$(_UbuntuWorkerPublishStage)libclrjit.so;$(_UbuntuWorkerPublishStage)libhostfxr.so;$(_UbuntuWorkerPublishStage)libhostpolicy.so" |
| 67 | Condition="'$(_UbuntuWorkerPublishSelfContained)' == 'true'" /> |
| 68 | </ItemGroup> |
| 69 | <Error Condition="!Exists('%(_UbuntuWorkerPublishRequired.Identity)')" Text="Ubuntu 작업자 필수 게시 파일이 누락되었습니다: %(_UbuntuWorkerPublishRequired.Filename)%(_UbuntuWorkerPublishRequired.Extension)" /> |
| 70 | <ItemGroup> |
| 71 | <_UbuntuWorkerPublishedFile Include="$(_UbuntuWorkerPublishStage)**/*" /> |
| 72 | </ItemGroup> |
| 73 | <Copy SourceFiles="@(_UbuntuWorkerPublishedFile)" |
| 74 | DestinationFiles="@(_UbuntuWorkerPublishedFile->'$(_UbuntuWorkerPublishDirectory)%(RecursiveDir)%(Filename)%(Extension)')" |
| 75 | SkipUnchangedFiles="false" /> |
| 76 | <RemoveDir Directories="$(_UbuntuWorkerPublishStage)" /> |
| 77 | </Target> |
| 78 | </Project> |