Skip to content

Commit

Permalink
Copy signed assemblies to the localize artifacts folder (#6170)
Browse files Browse the repository at this point in the history
  • Loading branch information
donnie-msft authored Nov 27, 2024
1 parent a903fe9 commit a3745af
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
26 changes: 20 additions & 6 deletions build/loc.proj
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,35 @@
</Target>

<!-- Prepares localization artifact -->
<Target Name="CopyBinariesToLocalizationArtifacts" AfterTargets="Localize">
<Target Name="CopyLocalizationArtifacts" AfterTargets="Localize">
<ItemGroup>
<_EnglishBinaries Include="@(FilesToLocalize)">
<DestinationPath>$(ArtifactsDirectory)\localizationArtifacts\artifacts\$([MSBuild]::MakeRelative($(ArtifactsDirectory), %(FilesToLocalize.RootDir)%(FilesToLocalize.Directory)))\%(FilesToLocalize.Filename)%(FilesToLocalize.Extension)</DestinationPath>
</_EnglishBinaries>
<_LocalizeFolder Include="$(ArtifactsDirectory)localize\**\*" Exclude="$(ArtifactsDirectory)localize\ResponseFiles\**\*" />
<_LocalizeFiles Include="@(_LocalizeFolder)">
<DestinationPath>$(ArtifactsDirectory)\localizationArtifacts\artifacts\$([MSBuild]::MakeRelative($(ArtifactsDirectory), %(_LocalizeFolder.Identity)))</DestinationPath>
</_LocalizeFiles>
<!-- Second Localize run creates appropiate LocProject.json -->
<!-- Second Localize run creates appropriate LocProject.json -->
<_LocalizeFiles Include="$(ArtifactsDirectory)localize\ResponseFiles\*.loc.002\ENU\LocProject.json">
<DestinationPath>$(ArtifactsDirectory)\localizationArtifacts\ENU\LocProject.json</DestinationPath>
</_LocalizeFiles>
</ItemGroup>
<Copy SourceFiles="@(_EnglishBinaries)" DestinationFiles="@(_EnglishBinaries->'%(DestinationPath)')" />
<Copy SourceFiles="@(_LocalizeFiles)" DestinationFiles="@(_LocalizeFiles->'%(DestinationPath)')" />
</Target>

<!-- Copy binaries to the localization artifacts folder -->
<Target Name="CopyBinariesToLocalizationArtifacts">
<MSBuild
Projects="@(SolutionProjectsWithoutVSIX)"
Properties="BuildProjectReferences=false;"
Targets="GetLocalizationInputs">
<Output
TaskParameter="TargetOutputs"
ItemName="FilesToLocalize" />
</MSBuild>
<ItemGroup>
<_EnglishBinaries Include="@(FilesToLocalize)">
<DestinationPath>$(ArtifactsDirectory)\localizationArtifacts\artifacts\$([MSBuild]::MakeRelative($(ArtifactsDirectory), %(FilesToLocalize.RootDir)%(FilesToLocalize.Directory)))\%(FilesToLocalize.Filename)%(FilesToLocalize.Extension)</DestinationPath>
</_EnglishBinaries>
</ItemGroup>
<Copy SourceFiles="@(_EnglishBinaries)" DestinationFiles="@(_EnglishBinaries->'%(DestinationPath)')" />
</Target>
</Project>
7 changes: 7 additions & 0 deletions eng/pipelines/templates/Build_and_UnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ steps:
configuration: "$(BuildConfiguration)"
msbuildArguments: "/restore /binarylogger:$(Build.StagingDirectory)\\binlog\\09.SignAssemblies.binlog"

- task: MSBuild@1
displayName: "Copy signed assemblies to localize artifacts folder"
inputs:
solution: "build\\loc.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/restore /t:CopyBinariesToLocalizationArtifacts /binarylogger:$(Build.StagingDirectory)\\binlog\\09.LocalizeFolderAssemblies.binlog"

- task: MSBuild@1
displayName: "Pack Nupkgs"
inputs:
Expand Down

0 comments on commit a3745af

Please sign in to comment.