Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
7 changes: 7 additions & 0 deletions Make.versions
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ DEFAULT_TARGET_PLATFORM_VERSION_TVOS=15.4
DEFAULT_TARGET_PLATFORM_VERSION_WATCHOS=8.5
DEFAULT_TARGET_PLATFORM_VERSION_MACOS=12.3
DEFAULT_TARGET_PLATFORM_VERSION_MACCATALYST=15.4

# These variables must be updated whenever we release a new stable version into .NET 6
NET6_IOS_NUGET_VERSION_NO_METADATA=15.4.447
NET6_TVOS_NUGET_VERSION_NO_METADATA=15.4.447
NET6_WATCHOS_NUGET_VERSION_NO_METADATA=8.5.447
NET6_MACOS_NUGET_VERSION_NO_METADATA=12.3.447
NET6_MACCATALYST_NUGET_VERSION_NO_METADATA=15.4.447
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<add key="macios-dependencies" value="https://pkgs.dev.azure.com/xamarin/public/_packaging/macios-dependencies/nuget/v3/index.json" />
<add key="xamarin-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
<add key="local-tests-feed" value="tests/.nuget/packages" />

<!-- These feeds are from main (6.0.4xx runtime branch) to get 6.0.9 versions of numerous .NET 6 packages. It should be possible to remove this after a while. -->
<add key="darc-pub-dotnet-emsdk-3f6c45a" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3f6c45a2/nuget/v3/index.json" />
<add key="darc-pub-dotnet-runtime-531f715" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-531f715f/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
Expand Down
16 changes: 7 additions & 9 deletions dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ DOTNET_PLATFORMS_UPPERCASE:=$(shell echo $(DOTNET_PLATFORMS) | tr a-z A-Z)

# Create variables prefixed with the correctly cased platform name from the upper-cased platform name. This makes some of the next sections somewhat simpler.
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(platform)_NUGET_VERSION_NO_METADATA:=$($(shell echo $(platform) | tr a-z A-Z)_NUGET_VERSION_NO_METADATA)))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval NET6_$(platform)_NUGET_VERSION_NO_METADATA:=$(NET6_$(shell echo $(platform) | tr a-z A-Z)_NUGET_VERSION_NO_METADATA)))

DOTNET_iOS_GLOBAL_USINGS=CoreGraphics Foundation UIKit
DOTNET_tvOS_GLOBAL_USINGS=CoreGraphics Foundation UIKit
Expand Down Expand Up @@ -104,13 +105,15 @@ targets/Microsoft.$(1).Sdk.Versions.props: targets/Microsoft.Sdk.Versions.templa
-e "s/@CURRENT_BRANCH@/$$(CURRENT_BRANCH_SED_ESCAPED)/g" \
-e "s/@CURRENT_HASH_LONG@/$$(CURRENT_HASH_LONG)/g" \
-e 's*@VALID_RUNTIME_IDENTIFIERS@*$(foreach rid,$(3),\n\t\t<_XamarinValidRuntimeIdentifier Include="$(rid)" Platform="$(1)" />)*' \
-e 's/@DOTNET_TFM@/$(DOTNET_TFM)/g' \
-e 's/@RUNTIME_PACK_RUNTIME_IDENTIFIERS@/$(4)/g' \
$$< > [email protected]
$$(Q) mv [email protected] $$@

Microsoft.$1.Sdk/targets/Microsoft.$1.Sdk.Versions.props: targets/Microsoft.$1.Sdk.Versions.props
$$(Q) $$(CP) $$< $$@
endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call VersionsTemplate,$(platform),$(shell echo $(platform) | tr a-z A-Z),$(DOTNET_$(shell echo $(platform) | tr a-z A-Z)_RUNTIME_IDENTIFIERS))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call VersionsTemplate,$(platform),$(shell echo $(platform) | tr a-z A-Z),$(DOTNET_$(shell echo $(platform) | tr a-z A-Z)_RUNTIME_IDENTIFIERS),$(shell echo $(DOTNET_$(shell echo $(platform) | tr a-z A-Z)_RUNTIME_IDENTIFIERS) | tr ' ' ';'))))

define AutoImports
Microsoft.$(1).Sdk/Sdk/AutoImport.props: targets/AutoImport.template.props Makefile
Expand Down Expand Up @@ -150,14 +153,9 @@ endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SupportedTargetPlatforms,$(platform))))

define WorkloadTargets
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: targets/WorkloadManifest.$(1).template.json Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-json.csharp
$$(Q) rm -f [email protected]
$$(Q_GEN) sed \
-e "s/@VERSION@/$3/g" \
-e "s/@BUNDLED_NETCORE_PLATFORMS_PACKAGE_VERSION@/$(BUNDLED_NETCORE_PLATFORMS_PACKAGE_VERSION)/g" \
-e "s/@PLATFORM_LOWERCASE@/$2/g" \
-e "s/@PLATFORM@/$1/g" \
$$< > [email protected]
$$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(4)" "$$(DOTNET_$(5)_RUNTIME_IDENTIFIERS)" "[email protected]" "$$(DOTNET_WINDOWS_PLATFORMS)"
$$(Q) mv [email protected] $$@

Workloads/Microsoft.NET.Sdk.$(1)/LICENSE: $(TOP)/LICENSE
Expand All @@ -169,7 +167,7 @@ WORKLOAD_TARGETS += Workloads/Microsoft.NET.Sdk.$(1)/LICENSE
LOCAL_WORKLOAD_TARGETS += Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json
LOCAL_WORKLOAD_TARGETS += Workloads/Microsoft.NET.Sdk.$(1)/LICENSE
endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call WorkloadTargets,$(platform),$(shell echo $(platform) | tr A-Z a-z),$($(platform)_NUGET_VERSION_NO_METADATA))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call WorkloadTargets,$(platform),$(shell echo $(platform) | tr A-Z a-z),$($(platform)_NUGET_VERSION_NO_METADATA),$(NET6_$(platform)_NUGET_VERSION_NO_METADATA),$(shell echo $(platform) | tr a-z A-Z))))

$(DOTNET_NUPKG_DIR)/vs-workload.props: Workloads/vs-workload.template.props
$(Q) rm -f [email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.MacCatalyst.Sdk" Condition="'$(TargetPlatformIdentifier)' == 'MacCatalyst'" />
<ImportGroup Condition=" '$(TargetPlatformIdentifier)' == 'MacCatalyst' ">
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Sdk.net7" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0')) " />
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Sdk.net6" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) " />
</ImportGroup>

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0')) ">
<SdkSupportedTargetPlatformIdentifier Include="maccatalyst" DisplayName="Mac Catalyst" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.iOS.Sdk" Condition="'$(TargetPlatformIdentifier)' == 'iOS'" />
<Import Project="Sdk.props" Sdk="Microsoft.iOS.Windows.Sdk.Aliased" Condition=" '$(TargetPlatformIdentifier)' == 'iOS' and $([MSBuild]::IsOSPlatform('windows'))" />
<ImportGroup Condition=" '$(TargetPlatformIdentifier)' == 'iOS' ">
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Sdk.net7" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0')) " />
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Sdk.net6" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) " />
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Windows.Sdk.Aliased.net7" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0')) And $([MSBuild]::IsOSPlatform('windows'))" />
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Windows.Sdk.Aliased.net6" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) And $([MSBuild]::IsOSPlatform('windows'))" />
</ImportGroup>

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0')) ">
<SdkSupportedTargetPlatformIdentifier Include="ios" DisplayName="iOS" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.macOS.Sdk" Condition="'$(TargetPlatformIdentifier)' == 'macOS'" />
<ImportGroup Condition=" '$(TargetPlatformIdentifier)' == 'macOS' ">
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Sdk.net7" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0')) " />
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Sdk.net6" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) " />
</ImportGroup>

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0')) ">
<SdkSupportedTargetPlatformIdentifier Include="macos" DisplayName="macOS" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.tvOS.Sdk" Condition="'$(TargetPlatformIdentifier)' == 'tvOS'" />
<ImportGroup Condition=" '$(TargetPlatformIdentifier)' == 'tvOS' ">
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Sdk.net7" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '7.0')) " />
<Import Project="Sdk.props" Sdk="Microsoft.$(TargetPlatformIdentifier).Sdk.net6" Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) " />
</ImportGroup>

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0')) ">
<SdkSupportedTargetPlatformIdentifier Include="tvos" DisplayName="tvOS" />
Expand Down
137 changes: 137 additions & 0 deletions dotnet/generate-workloadmanifest-json.csharp
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp

// arguments are: <platform> <outputPath>

using System.IO;
using System.Xml;

var args = Environment.GetCommandLineArgs ();
var expectedArgumentCount = 6;
if (args.Length != expectedArgumentCount + 2 /* 2 default arguments (executable + script) + 'expectedArgumentCount' arguments we're interested in */) {
// first arg is "/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5/csharp.exe"
// second arg the script itself
// then comes the ones we care about
Console.WriteLine ($"Need {expectedArgumentCount} arguments, got {args.Length - 2}");
Environment.Exit (1);
return;
}

var argumentIndex = 2;
var platform = args [argumentIndex++];
var version = args [argumentIndex++];
var net6Version = args [argumentIndex++];
var runtimeIdentifiers = args [argumentIndex++].Split (' ');
var outputPath = args [argumentIndex++];
var windowsPlatforms = args [argumentIndex++].Split (' ');
var hasWindows = Array.IndexOf (windowsPlatforms, platform) >= 0;

var platformLowerCase = platform.ToLowerInvariant ();

using (TextWriter writer = new StreamWriter (outputPath)) {
writer.WriteLine ($"{{");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"workloads\": {{");
writer.WriteLine ($" \"{platformLowerCase}\": {{");
writer.WriteLine ($" \"description\": \".NET SDK Workload for building {platform} applications.\",");
writer.WriteLine ($" \"packs\": [");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net7\",");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net6\",");
if (hasWindows) {
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net7\",");
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net6\",");
}
writer.WriteLine ($" \"Microsoft.{platform}.Ref.net7\",");
writer.WriteLine ($" \"Microsoft.{platform}.Ref\",");
foreach (var rid in runtimeIdentifiers) {
writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}.net7\",");
writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}\",");
}
writer.WriteLine ($" \"Microsoft.{platform}.Templates.net7\"");
writer.WriteLine ($" ],");
writer.WriteLine ($" \"extends\": [");
if (platform == "macOS") {
writer.WriteLine ($" \"microsoft-net-runtime-mono-tooling\",");
writer.WriteLine ($" \"microsoft-net-runtime-mono-tooling-net6\",");
} else {
writer.WriteLine ($" \"microsoft-net-runtime-{platformLowerCase}\",");
writer.WriteLine ($" \"microsoft-net-runtime-{platformLowerCase}-net6\",");
}
writer.WriteLine ($" ]");
writer.WriteLine ($" }},");
writer.WriteLine ($" }},");
writer.WriteLine ($" \"packs\": {{");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net7\": {{");
writer.WriteLine ($" \"kind\": \"sdk\",");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"any\": \"Microsoft.{platform}.Sdk\"");
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net6\": {{");
writer.WriteLine ($" \"kind\": \"sdk\",");
writer.WriteLine ($" \"version\": \"{net6Version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"any\": \"Microsoft.{platform}.Sdk\"");
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
if (hasWindows) {
writer.WriteLine ($" \"Microsoft.@[email protected]\": {{");
writer.WriteLine ($" \"kind\": \"sdk\",");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"win-x64\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" \"win-x86\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" \"win-arm64\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net6\": {{");
writer.WriteLine ($" \"kind\": \"sdk\",");
writer.WriteLine ($" \"version\": \"{net6Version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"win-x64\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" \"win-x86\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" \"win-arm64\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
}
writer.WriteLine ($" // The ref and runtime packs use the .net6 version, because when we load the .net6 SDK pack, it says to use the ref and runtime pack versions from the workload (**FromWorkload**).");
writer.WriteLine ($" // This could be solvable with aliases as well, except that aliases doesn't work in this scenario (https://github.com/dotnet/sdk/issues/26384).");
writer.WriteLine ($" // For the .net7 packs, we're stating the exact version to use in the KnownFrameworkReference item, so whatever we specify here is ignored.");
writer.WriteLine ($" \"Microsoft.{platform}.Ref\": {{");
writer.WriteLine ($" \"kind\": \"framework\",");
writer.WriteLine ($" \"version\": \"{net6Version}\"");
writer.WriteLine ($" }},");
writer.WriteLine ($" \"Microsoft.{platform}.Ref.net7\": {{");
writer.WriteLine ($" \"kind\": \"framework\",");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"any\": \"Microsoft.{platform}.Ref\",");
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
foreach (var rid in runtimeIdentifiers) {
writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}\": {{");
writer.WriteLine ($" \"kind\": \"framework\",");
writer.WriteLine ($" \"version\": \"{net6Version}\"");
writer.WriteLine ($" }},");
}
foreach (var rid in runtimeIdentifiers) {
writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}.net7\": {{");
writer.WriteLine ($" \"kind\": \"framework\",");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"any\": \"Microsoft.{platform}.Runtime.{rid}\",");
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
}
writer.WriteLine ($" \"Microsoft.{platform}.Templates.net7\": {{");
writer.WriteLine ($" \"kind\": \"template\",");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"any\": \"Microsoft.{platform}.Templates\",");
writer.WriteLine ($" }}");
writer.WriteLine ($" }}");
writer.WriteLine ($" }}");
writer.WriteLine ($"}}");
}

Environment.Exit (0);
16 changes: 16 additions & 0 deletions dotnet/targets/Microsoft.Sdk.Versions.template.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,20 @@

<ItemGroup>@VALID_RUNTIME_IDENTIFIERS@
</ItemGroup>

<!-- Declare the XI/XM framework bundled with this version of the SDK. See Microsoft.NETCoreSdk.BundledVersions.props -->
<ItemGroup>
<KnownFrameworkReference
Include="Microsoft.@PLATFORM@"
TargetFramework="@DOTNET_TFM@"
RuntimeFrameworkName="Microsoft.@PLATFORM@"
DefaultRuntimeFrameworkVersion="@NUGET_VERSION_NO_METADATA@"
LatestRuntimeFrameworkVersion="@NUGET_VERSION_NO_METADATA@"
TargetingPackName="Microsoft.@[email protected]"
TargetingPackVersion="@NUGET_VERSION_NO_METADATA@"
RuntimePackNamePatterns="Microsoft.@[email protected].**RID**"
RuntimePackRuntimeIdentifiers="@RUNTIME_PACK_RUNTIME_IDENTIFIERS@"
Profile="@PLATFORM@"
/>
</ItemGroup>
</Project>
40 changes: 0 additions & 40 deletions dotnet/targets/WorkloadManifest.MacCatalyst.template.json

This file was deleted.

65 changes: 0 additions & 65 deletions dotnet/targets/WorkloadManifest.iOS.template.json

This file was deleted.

Loading