Skip to content

Commit

Permalink
Alter RuntimeComponentManifest.targets to use the correct runtime pack (
Browse files Browse the repository at this point in the history
  • Loading branch information
steveisok authored Jul 29, 2021
1 parent 6482d14 commit d0f2752
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<Project>
<Target Name="_MonoReadAvailableComponentsManifest">
<Error Condition="'%(ResolvedRuntimePack.PackageDirectory)' == '' and '$(_MonoRuntimeComponentManifestJsonFilePath)' == ''"
Text="Empty ResolvedRuntimePack.PackageDirectory while trying to read runtime components manifest" />
<Error Condition="'%(ResolvedFrameworkReference.Identity)' == 'Microsoft.NETCore.App' and '%(ResolvedFrameworkReference.RuntimePackPath)' == '' and '$(_MonoRuntimeComponentManifestJsonFilePath)' == ''"
Text="Empty ResolveFrameworkReference.RuntimePackPath while trying to read runtime components manifest. ResolvedFrameworkReference available: @(ResolvedFrameworkReference -> '{ %(Identity), RuntimePackPath: %(RuntimePackPath) }')" />

<PropertyGroup>
<_MonoRuntimeComponentManifestJsonFilePath Condition="'$(_MonoRuntimeComponentManifestJsonFilePath)' == ''">%(ResolvedRuntimePack.PackageDirectory)\runtimes\$(RuntimeIdentifier)\build\RuntimeComponentManifest.json</_MonoRuntimeComponentManifestJsonFilePath>
<_MonoRuntimeComponentManifestJsonFilePath
Condition="'$(_MonoRuntimeComponentManifestJsonFilePath)' == '' and '%(ResolvedFrameworkReference.Identity)' == 'Microsoft.NETCore.App'">$([MSBuild]::NormalizePath('%(RuntimePackPath)', 'runtimes', '$(RuntimeIdentifier)', 'build', 'RuntimeComponentManifest.json'))</_MonoRuntimeComponentManifestJsonFilePath>
</PropertyGroup>

<Error Condition="!Exists('$(_MonoRuntimeComponentManifestJsonFilePath)')"
Text="Unable to read the runtime components manifest as the path: $(_MonoRuntimeComponentManifestJsonFilePath) does not exist" />

<MonoRuntimeComponentManifestReadTask JsonFilePath="$(_MonoRuntimeComponentManifestJsonFilePath)">
<Output TaskParameter="_MonoRuntimeComponentSharedLibExt" ItemName="_MonoRuntimeComponentSharedLibExt" />
<Output TaskParameter="_MonoRuntimeComponentStaticLibExt" ItemName="_MonoRuntimeComponentStaticLibExt" />
Expand Down
6 changes: 6 additions & 0 deletions src/tasks/JsonToItemsTaskFactory/JsonToItemsTaskFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ public bool Execute()
Log.LogError($"no {nameof(JsonFilePath)} specified");
return false;
}
if (!File.Exists(jsonFilePath))
{
Log.LogError($"Could not find {nameof(JsonFilePath)}={jsonFilePath}");
return false;
}

if (!TryGetJson(jsonFilePath, out var json))
return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@
PackageDirectory="$(NetCoreTargetingPackRoot)\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\$(RuntimePackInWorkloadVersion)"
RuntimeIdentifier="browser-wasm" />

<ResolvedFrameworkReference
TargetingPackPath="$(_MicrosoftNetCoreAppRefDir.TrimEnd('/\'))"
Include="Microsoft.NETCore.App"
RuntimePackName="Microsoft.NETCore.App.Runtime.Mono.browser-wasm"
RuntimePackVersion="$(RuntimePackInWorkloadVersion)"
RuntimePackPath="$(NetCoreTargetingPackRoot)\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\$(RuntimePackInWorkloadVersion)"
RuntimeIdentifier="browser-wasm" />
<ResolvedFrameworkReference Update="Microsoft.NETCore.App"
TargetingPackPath="$(_MicrosoftNetCoreAppRefDir.TrimEnd('/\'))"
RuntimePackName="Microsoft.NETCore.App.Runtime.Mono.browser-wasm"
RuntimePackVersion="$(RuntimePackInWorkloadVersion)"
RuntimePackPath="$(NetCoreTargetingPackRoot)\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\$(RuntimePackInWorkloadVersion)"
RuntimeIdentifier="browser-wasm" />
</ItemGroup>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@
PackageDirectory="$(NetCoreTargetingPackRoot)\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\$(RuntimePackInWorkloadVersion)"
RuntimeIdentifier="browser-wasm" />

<ResolvedFrameworkReference
TargetingPackPath="$(_MicrosoftNetCoreAppRefDir.TrimEnd('/\'))"
Include="Microsoft.NETCore.App"
RuntimePackName="Microsoft.NETCore.App.Runtime.Mono.browser-wasm"
RuntimePackVersion="$(RuntimePackInWorkloadVersion)"
RuntimePackPath="$(NetCoreTargetingPackRoot)\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\$(RuntimePackInWorkloadVersion)"
RuntimeIdentifier="browser-wasm" />
<ResolvedFrameworkReference Update="Microsoft.NETCore.App"
TargetingPackPath="$(_MicrosoftNetCoreAppRefDir.TrimEnd('/\'))"
RuntimePackName="Microsoft.NETCore.App.Runtime.Mono.browser-wasm"
RuntimePackVersion="$(RuntimePackInWorkloadVersion)"
RuntimePackPath="$(NetCoreTargetingPackRoot)\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\$(RuntimePackInWorkloadVersion)"
RuntimeIdentifier="browser-wasm" />
</ItemGroup>
</Target>

Expand Down

0 comments on commit d0f2752

Please sign in to comment.