team-ljyzipelo

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