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

Update workload pack tasks #7614

Merged
merged 7 commits into from
Jul 14, 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
@@ -0,0 +1,273 @@
{
"version": "6.0.0-preview.7.21358.4",
"depends-on": {
"Microsoft.NET.Workload.Emscripten": "6.0.0-preview.7.21330.1"
},
"workloads": {
"microsoft-net-sdk-blazorwebassembly-aot": {
"description": "Browser Runtime native performance tools",
"packs": [
"Microsoft.NET.Runtime.WebAssembly.Sdk",
"Microsoft.NETCore.App.Runtime.Mono.browser-wasm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm",
"Microsoft.NET.Runtime.Emscripten.Node",
"Microsoft.NET.Runtime.Emscripten.Python",
"Microsoft.NET.Runtime.Emscripten.Sdk"
],
"extends": [ "microsoft-net-runtime-mono-tooling", "microsoft-net-sdk-emscripten" ],
"platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ]
},
"microsoft-net-runtime-android": {
"abstract": true,
"description": "Android Mono Runtime",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.android-arm",
"Microsoft.NETCore.App.Runtime.Mono.android-arm64",
"Microsoft.NETCore.App.Runtime.Mono.android-x64",
"Microsoft.NETCore.App.Runtime.Mono.android-x86"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ]
},
"microsoft-net-runtime-android-aot": {
"abstract": true,
"description": "Android Mono AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-x86",
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-x64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm64"
],
"extends": [ "microsoft-net-runtime-android" ],
"platforms": [ "win-x64", "linux-x64", "osx-x64", "osx-arm64" ]
},
"microsoft-net-runtime-ios": {
"abstract": true,
"description": "iOS Mono Runtime and AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.ios-arm",
"Microsoft.NETCore.App.Runtime.Mono.ios-arm64",
"Microsoft.NETCore.App.Runtime.Mono.iossimulator",
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86",
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm",
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator",
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
},
"microsoft-net-runtime-maccatalyst": {
"abstract": true,
"description": "MacCatalyst Mono Runtime and AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst",
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
},
"microsoft-net-runtime-tvos": {
"abstract": true,
"description": "tvOS Mono Runtime and AOT Workload",
"packs": [
"Microsoft.NETCore.App.Runtime.Mono.tvos-arm64",
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator",
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvos-arm64",
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator"
],
"extends": [ "microsoft-net-runtime-mono-tooling" ],
"platforms": [ "osx-arm64", "osx-x64" ]
},
"microsoft-net-runtime-mono-tooling": {
"abstract": true,
"description": "Shared native build tooling for Mono runtime",
"packs": [
"Microsoft.NET.Runtime.MonoAOTCompiler.Task",
"Microsoft.NET.Runtime.MonoTargets.Sdk",
],
}
},
"packs": {
"Microsoft.NET.Runtime.MonoAOTCompiler.Task": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NET.Runtime.MonoTargets.Sdk": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NET.Runtime.WebAssembly.Sdk": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.android-arm": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.android-arm64": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.android-x64": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.android-x86": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-x86": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-x86",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x86",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-x86",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-x86"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-x64": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-x64",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-x64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm64": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm64",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.android-arm64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.maccatalyst": {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.ios-arm" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.ios-arm64" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.iossimulator" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvos-arm64": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvos-arm64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvos-arm64",
}
},
"Microsoft.NETCore.App.Runtime.Mono.tvos-arm64" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
"Microsoft.NETCore.App.Runtime.Mono.tvossimulator" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.Mono.tvossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.Mono.tvossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.tvossimulator": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm",
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64",
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-arm64",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-x64"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.iossimulator-x86"
}
},
"Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm": {
"kind": "Sdk",
"version": "6.0.0-preview.7.21358.4",
"alias-to": {
"win-x64": "Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm",
"linux-x64": "Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.browser-wasm",
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.browser-wasm",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.browser-wasm"
}
},
"Microsoft.NETCore.App.Runtime.Mono.browser-wasm" : {
"kind": "framework",
"version": "6.0.0-preview.7.21358.4"
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,13 @@ public override bool Execute()
MsiProperties msiProps = new MsiProperties
{
InstallSize = MsiUtils.GetInstallSize(msiPath),
Language = Convert.ToInt32(MsiUtils.GetProperty(msiPath, "ProductLanguage")),
Payload = Path.GetFileName(msiPath),
ProductCode = MsiUtils.GetProperty(msiPath, "ProductCode"),
ProductVersion = MsiUtils.GetProperty(msiPath, "ProductVersion"),
ProviderKeyName = $"{nupkg.Id},{nupkg.Version},{platform}",
UpgradeCode = MsiUtils.GetProperty(msiPath, "UpgradeCode")
UpgradeCode = MsiUtils.GetProperty(msiPath, "UpgradeCode"),
RelatedProducts = MsiUtils.GetRelatedProducts(msiPath)
};

string msiJsonPath = Path.Combine(Path.GetDirectoryName(msiPath), Path.GetFileNameWithoutExtension(msiPath) + ".json");
Expand Down Expand Up @@ -308,7 +310,6 @@ private string GeneratePackageProject(string msiPath, string msiJsonPath, string
writer.WriteElementString("PackageId", $"{nupkg.Id}.Msi.{platform}");
writer.WriteElementString("PackageVersion", $"{nupkg.Version}");
writer.WriteElementString("Description", nupkg.Description);
writer.WriteElementString("PackageIcon", "Icon.png");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might have to define an empty "PackageIcon" property so that Arcade doesn't provide defaults and then adds the item group for you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran under Arcade SDK in dotnet/installer and it seems to work, but I will condition the target

Copy link
Member

@chcosta chcosta Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works, that's great. I wouldn't think the target would need a condition. I just thought you would have to undefine packageicon in your project to prevent this from executing because Arcade just default defines it here. Perhaps I'm missing something though.


if (!string.IsNullOrWhiteSpace(nupkg.Authors))
{
Expand All @@ -326,11 +327,23 @@ private string GeneratePackageProject(string msiPath, string msiJsonPath, string
writer.WriteStartElement("ItemGroup");
WriteItem(writer, "None", msiPath, @"\data");
WriteItem(writer, "None", msiJsonPath, @"\data\msi.json");
WriteItem(writer, "None", iconFileName, string.Empty);
WriteItem(writer, "None", licenseFileName, @"\");
writer.WriteEndElement();

writer.WriteEndElement();
writer.WriteEndElement(); // ItemGroup

writer.WriteRaw(@"
<Target Name=""AddPackageIcon""
BeforeTargets=""$(GenerateNuspecDependsOn)""
Condition=""'$(PackageIcon)' == ''"">
<PropertyGroup>
<PackageIcon>Icon.png</PackageIcon>
</PropertyGroup>
<ItemGroup Condition=""'$(IsPackable)' == 'true'"">
<None Include=""$(PackageIcon)"" Pack=""true"" PackagePath=""$(PackageIcon)"" Visible=""false"" />
</ItemGroup>
</Target>
");

writer.WriteEndElement(); // Project
writer.Flush();
writer.Close();

Expand Down
25 changes: 19 additions & 6 deletions src/Microsoft.DotNet.Build.Tasks.Workloads/src/GenerateMsiBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,13 @@ protected IEnumerable<ITaskItem> Generate(string sourcePackage, string swixPacka
MsiProperties msiProps = new MsiProperties
{
InstallSize = MsiUtils.GetInstallSize(msiPath),
Language = Convert.ToInt32(MsiUtils.GetProperty(msiPath, "ProductLanguage")),
Payload = Path.GetFileName(msiPath),
ProductCode = MsiUtils.GetProperty(msiPath, "ProductCode"),
ProductVersion = MsiUtils.GetProperty(msiPath, "ProductVersion"),
ProviderKeyName = $"{nupkg.Id},{nupkg.Version},{platform}",
UpgradeCode = MsiUtils.GetProperty(msiPath, "UpgradeCode")
UpgradeCode = MsiUtils.GetProperty(msiPath, "UpgradeCode"),
RelatedProducts = MsiUtils.GetRelatedProducts(msiPath)
};

string msiJsonPath = Path.Combine(Path.GetDirectoryName(msiPath), Path.GetFileNameWithoutExtension(msiPath) + ".json");
Expand Down Expand Up @@ -334,7 +336,6 @@ private string GeneratePackageProject(string msiPath, string msiJsonPath, string
writer.WriteElementString("PackageId", $"{nupkg.Id}.Msi.{platform}");
writer.WriteElementString("PackageVersion", $"{nupkg.Version}");
writer.WriteElementString("Description", nupkg.Description);
writer.WriteElementString("PackageIcon", "Icon.png");

if (!string.IsNullOrWhiteSpace(nupkg.Authors))
{
Expand All @@ -352,11 +353,23 @@ private string GeneratePackageProject(string msiPath, string msiJsonPath, string
writer.WriteStartElement("ItemGroup");
WriteItem(writer, "None", msiPath, @"\data");
WriteItem(writer, "None", msiJsonPath, @"\data\msi.json");
WriteItem(writer, "None", iconFileName, string.Empty);
joeloff marked this conversation as resolved.
Show resolved Hide resolved
WriteItem(writer, "None", licenseFileName, @"\");
writer.WriteEndElement();

writer.WriteEndElement();
writer.WriteEndElement(); // ItemGroup

writer.WriteRaw(@"
<Target Name=""AddPackageIcon""
BeforeTargets=""$(GenerateNuspecDependsOn)""
Condition=""'$(PackageIcon)' == ''"">
<PropertyGroup>
<PackageIcon>Icon.png</PackageIcon>
</PropertyGroup>
<ItemGroup Condition=""'$(IsPackable)' == 'true'"">
<None Include=""$(PackageIcon)"" Pack=""true"" PackagePath=""$(PackageIcon)"" Visible=""false"" />
</ItemGroup>
</Target>
");

writer.WriteEndElement(); // Project
writer.Flush();
writer.Close();

Expand Down
Loading