Skip to content

Commit

Permalink
fix store output platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
RassK committed Feb 19, 2024
1 parent bf08ac9 commit e1338ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions build/Build.Steps.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Text.Json.Nodes;
using Extensions;
Expand Down Expand Up @@ -551,6 +552,7 @@ void RemoveFilesInNetFolderAvailableInAdditionalStore()
.SetProject(Solution.GetProjectByName(Projects.AutoInstrumentationAdditionalDeps))
.SetConfiguration(BuildConfiguration)
.SetTargetPlatformAnyCPU()
.SetProperty("NukePlatform", Platform)
.SetProperty("TracerHomePath", TracerHomeDirectory)
.EnableNoBuild()
.SetNoRestore(NoRestore)
Expand All @@ -559,7 +561,7 @@ void RemoveFilesInNetFolderAvailableInAdditionalStore()
// Additional-deps probes the directory using SemVer format.
// Example: For netcoreapp3.1 framework, additional-deps uses 3.1.0 or 3.1.1 and so on.
// Major and Minor version are extracted from framework and default value of 0 is appended for patch.
.SetOutput(AdditionalDepsDirectory / "shared" / "Microsoft.NETCore.App" / framework.ToString().Substring(framework.ToString().Length - 3) + ".0")));
.SetOutput(AdditionalDepsDirectory / "shared" / "Microsoft.NETCore.App" / framework.ToString().Substring(framework.ToString().Length - 3) + ".0"))); ;

AdditionalDepsDirectory.GlobFiles("**/*deps.json")
.ForEach(file =>
Expand All @@ -569,8 +571,9 @@ void RemoveFilesInNetFolderAvailableInAdditionalStore()

var folderRuntimeName = depsJson.GetFolderRuntimeName();
var architectureStores = new List<AbsolutePath>()
.AddIf(StoreDirectory / "x64" / folderRuntimeName, true) // All OS'es support x64 runtime
.AddIf(StoreDirectory / "x64" / folderRuntimeName, RuntimeInformation.OSArchitecture == Architecture.X64)
.AddIf(StoreDirectory / "x86" / folderRuntimeName, IsWin) // Only Windows supports x86 runtime
.AddIf(StoreDirectory / "arm64" / folderRuntimeName, IsArm64)
.AsReadOnly();

depsJson.CopyNativeDependenciesToStore(file, architectureStores);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@
<StoreOutputBasePath>$(OutputDir)\store\</StoreOutputBasePath>
<AdditionalDepsPath Condition="'$(TracerHomePath)' != ''">$(TracerHomePath)\AdditionalDeps</AdditionalDepsPath>
<StoreOutputBasePath Condition="'$(TracerHomePath)' != ''">$(TracerHomePath)\store</StoreOutputBasePath>
<NukePlatform Condition="'$(NukePlatform)' == ''">x64</NukePlatform>
</PropertyGroup>

<ItemGroup>
<StoreRuntime Include="x86" Condition="'$(OS)' == 'Windows_NT'">
<Platform>x86</Platform>
<StorePath>$(StoreOutputBasePath)</StorePath>
</StoreRuntime>
<StoreRuntime Include="x64" Condition="'$(Platform)' == 'x64'">
<StoreRuntime Include="x64" Condition="'$(NukePlatform)' == 'x64'">
<Platform>x64</Platform>
<StorePath>$(StoreOutputBasePath)</StorePath>
</StoreRuntime>
<StoreRuntime Include="arm64" Condition="$([MSBuild]::IsOSPlatform('Linux')) And '$(Platform)' == 'arm64'">
<StoreRuntime Include="arm64" Condition="$([MSBuild]::IsOSPlatform('Linux')) And '$(NukePlatform)' == 'arm64'">
<Platform>arm64</Platform>
<StorePath>$(StoreOutputBasePath)</StorePath>
</StoreRuntime>
</ItemGroup>

<Message Text="Calling ComposeStore for TargetFramework='$(TargetFramework)'" Importance="high" />
<Message Text="Calling ComposeStore for TargetFramework='$(TargetFramework)' and NukePlatform='$(NukePlatform)'" Importance="high" />

<ItemGroup>
<ProjectsToBuild Include="Package.xml">
Expand Down

0 comments on commit e1338ce

Please sign in to comment.