team-ljyzipelo

공개

Ubuntu 빌드와 게시에 작업자를 자동 배치한다

작성자
호시노 히나타
작성 시각
커밋
e8183d76c695dbc6d1658dd16a015c9ff49aa404
부모
97631fc
이 시점의 파일 보기

변경된 파일 2개

+71-0
추가src/Zipelo.Ubuntu/WorkerDeployment.targets+66-0
@@ -0,0 +1,66 @@
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>
수정src/Zipelo.Ubuntu/Zipelo.Ubuntu.csproj+5-0
@@ -20,5 +20,10 @@
2020 <PackageReference Include="Tmds.DBus.Protocol" Version="[0.21.3]" />
2121 <ProjectReference Include="../Zipelo.Core/Zipelo.Core.csproj" />
2222 <ProjectReference Include="../Zipelo.Runtime/Zipelo.Runtime.csproj" />
23추가: <ProjectReference Include="../Zipelo.Worker/Zipelo.Worker.csproj"
24추가: ReferenceOutputAssembly="false" Private="false"
25추가: GlobalPropertiesToRemove="PublishProfile;PublishProfileFullPath;PublishDir;PublishUrl;OutputPath;OutDir;BaseOutputPath;BaseIntermediateOutputPath;IntermediateOutputPath;TargetDir;PublishSingleFile;PublishTrimmed;PublishAot"
26추가: AdditionalProperties="Configuration=$(Configuration);RuntimeIdentifier=$(RuntimeIdentifier);SelfContained=$(SelfContained);UseAppHost=true;PublishSingleFile=false;PublishTrimmed=false;PublishAot=false" />
2327 </ItemGroup>
28추가: <Import Project="WorkerDeployment.targets" />
2429</Project>