Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter RuntimeComponentManifest.targets to use the correct runtime pack #56431

Merged
merged 7 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
steveisok marked this conversation as resolved.
Show resolved Hide resolved

<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