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

[net7] include net6 templates #8203

Merged
merged 39 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
dc98b32
Include net6 template packs in net7 workload
Redth Jun 21, 2022
d5c81d8
Previous template pack version
Redth Jun 21, 2022
af08b6a
Fix bad copy pasta
Redth Jun 21, 2022
f959933
Merge remote-tracking branch 'origin/net7.0' into net7-include-net6-t…
mattleibow Jun 22, 2022
e976635
More template tests
mattleibow Jun 22, 2022
11cfe15
Merge branch 'net7.0' into net7-include-net6-templates
mattleibow Jun 22, 2022
9b5d151
Merge remote-tracking branch 'origin/net7.0' into net7-include-net6-t…
mattleibow Jun 23, 2022
39056fd
Make --framework and -f work!
mattleibow Jun 23, 2022
92d9a6c
Swap the values in the cli file as well
mattleibow Jun 23, 2022
eb7e578
--Framework for now
mattleibow Jun 23, 2022
beae459
Merge branch 'net7.0' into net7-include-net6-templates
mattleibow Jun 23, 2022
847c714
?:
mattleibow Jun 23, 2022
fa16f28
This should be working now
mattleibow Jun 24, 2022
952739f
revert that
mattleibow Jun 24, 2022
9099af9
Skip certian platforms
mattleibow Jun 24, 2022
05b5806
Load the SDK that matches the current build
mattleibow Jun 24, 2022
9a5769a
oops
mattleibow Jun 24, 2022
3251e8d
Use this instead
mattleibow Jun 24, 2022
414f9eb
Include both versions
mattleibow Jun 24, 2022
ff60600
Support older SDKs
mattleibow Jun 24, 2022
ef6ee32
Each workload version has a single support
mattleibow Jun 24, 2022
24bab94
Merge branch 'net7.0' into net7-include-net6-templates
mattleibow Jun 24, 2022
10617b7
Seems this is OK
mattleibow Jun 24, 2022
824e862
Get something that will work
mattleibow Jun 25, 2022
32e3e98
this should be working now
mattleibow Jun 27, 2022
52c7008
Merge remote-tracking branch 'origin/net7.0' into net7-include-net6-t…
mattleibow Jun 27, 2022
fec5c75
Use the next stable version
mattleibow Jun 27, 2022
565393e
better formatting
mattleibow Jun 27, 2022
642ef54
Merge branch 'net7.0' into net7-include-net6-templates
mattleibow Jun 27, 2022
a5b616c
Merge branch 'net7.0' into net7-include-net6-templates
mattleibow Jun 27, 2022
ab144cd
The last version that worked
mattleibow Jun 27, 2022
8c67680
Merge branch 'net7.0' into net7-include-net6-templates
mattleibow Jun 27, 2022
4cf8400
Due to a bug
mattleibow Jun 28, 2022
58a6344
Merge branch 'net7.0' into net7-include-net6-templates
mattleibow Jun 28, 2022
37b67ef
not much works
mattleibow Jun 28, 2022
7801e7d
Merge remote-tracking branch 'origin/net7.0' into net7-include-net6-t…
mattleibow Jun 30, 2022
e313ece
Merge remote-tracking branch 'origin/net7.0' into net7-include-net6-t…
mattleibow Jul 6, 2022
4dfe8bd
Merge remote-tracking branch 'origin/net7.0' into net7-include-net6-t…
mattleibow Jul 6, 2022
8245fcb
Try .net6.0 again
mattleibow Jul 7, 2022
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 Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<_MauiDotNetVersionMinor Condition="'$(_MauiDotNetVersionMinor)' == ''">0</_MauiDotNetVersionMinor>
<_MauiDotNetVersion Condition="'$(_MauiDotNetVersion)' == ''">$(_MauiDotNetVersionMajor).$(_MauiDotNetVersionMinor)</_MauiDotNetVersion>
<_MauiDotNetTfm Condition="'$(_MauiDotNetTfm)' == ''">net$(_MauiDotNetVersion)</_MauiDotNetTfm>

<_MauiPreviousDotNetVersionMajor Condition="'$(_MauiPreviousDotNetVersionMajor)' == ''">6</_MauiPreviousDotNetVersionMajor>
<_MauiPreviousDotNetVersionMinor Condition="'$(_MauiPreviousDotNetVersionMinor)' == ''">0</_MauiPreviousDotNetVersionMinor>
<_MauiPreviousDotNetVersion Condition="'$(_MauiPreviousDotNetVersion)' == ''">$(_MauiPreviousDotNetVersionMajor).$(_MauiPreviousDotNetVersionMinor)</_MauiPreviousDotNetVersion>
<_MauiPreviousDotNetVersionNoDot Condition="'$(_MauiPreviousDotNetVersionNoDot)' == ''">$(_MauiPreviousDotNetVersionMajor)$(_MauiPreviousDotNetVersionMinor)</_MauiPreviousDotNetVersionNoDot>
<_MauiPreviousDotNetTfm Condition="'$(_MauiPreviousDotNetTfm)' == ''">net$(_MauiPreviousDotNetVersion)</_MauiPreviousDotNetTfm>

<_MauiTargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</_MauiTargetPlatformIdentifier>
<_MauiNoTargetPlatform Condition="'$(_MauiTargetPlatformIdentifier)' == ''">True</_MauiNoTargetPlatform>
<_MauiTargetPlatformIsAndroid Condition="'$(_MauiTargetPlatformIdentifier)' == 'android'">True</_MauiTargetPlatformIsAndroid>
Expand Down
2 changes: 2 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project>
<PropertyGroup>
<!-- Current previous .NET SDK major version's stable release of MAUI packages -->
<MicrosoftMauiPreviousDotNetReleasedVersion>6.0.405</MicrosoftMauiPreviousDotNetReleasedVersion>
<!-- dotnet/installer -->
<MicrosoftDotnetSdkInternalPackageVersion>7.0.100-preview.6.22316.8</MicrosoftDotnetSdkInternalPackageVersion>
<!-- dotnet/runtime -->
Expand Down
24 changes: 17 additions & 7 deletions eng/cake/dotnet.cake
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Task("dotnet-templates")
var framework = string.IsNullOrWhiteSpace(TestTFM) ? "" : $"--framework {TestTFM}";

projectName = $"{tempDir}/{projectName}_{type}";
projectName += string.IsNullOrWhiteSpace(TestTFM) ? "" : $"_{TestTFM}";
projectName += string.IsNullOrWhiteSpace(TestTFM) ? "" : $"_{TestTFM.Replace('.', '_')}";

// Create
StartProcess(dn, $"new {templateName} -o \"{projectName}\" {framework}");
Expand All @@ -169,12 +169,22 @@ Task("dotnet-templates")
template.Value(projectName);

// Enable Tizen
ReplaceTextInFiles($"{projectName}/*.csproj",
"<!-- <TargetFrameworks>",
"<TargetFrameworks>");
ReplaceTextInFiles($"{projectName}/*.csproj",
"</TargetFrameworks> -->",
"</TargetFrameworks>");
if (!TestTFM.StartsWith("net6")) // Tizen does not yet support net6 on the net7 SDK: https://github.com/Samsung/Tizen.NET/issues/182
mattleibow marked this conversation as resolved.
Show resolved Hide resolved
{
ReplaceTextInFiles($"{projectName}/*.csproj",
"<!-- <TargetFrameworks>",
"<TargetFrameworks>");
ReplaceTextInFiles($"{projectName}/*.csproj",
"</TargetFrameworks> -->",
"</TargetFrameworks>");
}
else
{
// Mac Catalyst/iOS does not yet support net6 from the net7 SDK: https://github.com/xamarin/xamarin-macios/issues/15344
ReplaceTextInFiles($"{projectName}/*.csproj",
";net6.0-ios;net6.0-maccatalyst",
"");
}
mattleibow marked this conversation as resolved.
Show resolved Hide resolved

// Build
RunMSBuildWithDotNet(projectName, properties, warningsAsError: true, forceDotNetBuild: forceDotNetBuild);
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/handlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ parameters:
tfm: default
# - name: net6
# tfm: net6.0
mattleibow marked this conversation as resolved.
Show resolved Hide resolved
- name: net7
tfm: net7.0

resources:
repositories:
Expand Down
43 changes: 18 additions & 25 deletions src/Workload/Microsoft.Maui.Sdk/Microsoft.Maui.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,42 +55,35 @@
<ProjectReference Include="$(MauiRootDirectory)src/Controls/src/SourceGen/Controls.SourceGen.csproj" />
</ItemGroup>

<ItemGroup>
<_ValuesToReplace Include="VERSION" PropertyName="PackageReferenceVersion" />
<_ValuesToReplace Include="TFM" PropertyName="_MauiDotNetTfm" />
<_ValuesToReplace Include="PREVIOUS_TFM" PropertyName="_MauiPreviousDotNetTfm" />
<_ValuesToReplace Include="MAUI_DOTNET_VERSION" PropertyName="_MauiDotNetVersion" />
<_ValuesToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION" PropertyName="_MauiPreviousDotNetVersion" />
<_ValuesToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION_NO_DOT" PropertyName="_MauiPreviousDotNetVersionNoDot" />
<_ValuesToReplace Include="MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION" PropertyName="MicrosoftMauiPreviousDotNetReleasedVersion" />
<_ValuesToReplace Include="MicrosoftWindowsSDKBuildToolsPackageVersion" PropertyName="MicrosoftWindowsSDKBuildToolsPackageVersion" />
<_ValuesToReplace Include="MicrosoftExtensionsPackageVersion" PropertyName="MicrosoftExtensionsPackageVersion" />
<_ValuesToReplace Include="MicrosoftExtensionsServicingPackageVersion" PropertyName="MicrosoftExtensionsServicingPackageVersion" />
</ItemGroup>

<Import Project="$(MauiRootDirectory)eng/ReplaceText.targets" />

<Target Name="_GenerateBundledVersions"
BeforeTargets="Build;AssignTargetPaths"
DependsOnTargets="SetVersions"
Inputs="$(MSBuildProjectFile);$(MauiRootDirectory)eng/Versions.props;Sdk/BundledVersions.in.targets"
Outputs="$(IntermediateOutputPath)BundledVersions.targets">
<ReplaceText
Input="Sdk/BundledVersions.in.targets"
Output="$(IntermediateOutputPath)BundledVersions.targets"
OldValue="@VERSION@"
NewValue="$(PackageReferenceVersion)"
/>
<ReplaceText
Input="$(IntermediateOutputPath)BundledVersions.targets"
Output="$(IntermediateOutputPath)BundledVersions.targets"
OldValue="@TFM@"
NewValue="$(_MauiDotNetTfm)"
/>
<ReplaceText
Input="$(IntermediateOutputPath)BundledVersions.targets"
Output="$(IntermediateOutputPath)BundledVersions.targets"
OldValue="@MicrosoftWindowsSDKBuildToolsPackageVersion@"
NewValue="$(MicrosoftWindowsSDKBuildToolsPackageVersion)"
/>
<ReplaceText
Input="$(IntermediateOutputPath)BundledVersions.targets"
Output="$(IntermediateOutputPath)BundledVersions.targets"
OldValue="@MicrosoftExtensionsPackageVersion@"
NewValue="$(MicrosoftExtensionsPackageVersion)"
<Copy
SourceFiles="Sdk/BundledVersions.in.targets"
DestinationFiles="$(IntermediateOutputPath)BundledVersions.targets"
/>
<ReplaceText
Input="$(IntermediateOutputPath)BundledVersions.targets"
Output="$(IntermediateOutputPath)BundledVersions.targets"
OldValue="@MicrosoftExtensionsServicingPackageVersion@"
NewValue="$(MicrosoftExtensionsServicingPackageVersion)"
OldValue="@%(_ValuesToReplace.Identity)@"
NewValue="$(%(_ValuesToReplace.PropertyName))"
/>
<ItemGroup>
<None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>

<PropertyGroup>
<_MauiRuntimePackVersion>$(MauiVersion)</_MauiRuntimePackVersion>
<_MauiRuntimePackVersion Condition=" '$(_MauiRuntimePackVersion)' == '' ">**FromWorkload**</_MauiRuntimePackVersion>
Expand All @@ -14,7 +15,6 @@

<!-- Framework references -->
<ItemGroup>
<_MauiRuntimeIdentifiers Include="android;ios;maccatalyst;win;tizen" />
<KnownFrameworkReference
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' "
Include="Microsoft.Maui.Core"
Expand Down
27 changes: 10 additions & 17 deletions src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<ItemGroup>
<_JsonInputFile Include="WorkloadManifest.in.json" OutputPath="$(IntermediateOutputPath)WorkloadManifest.json" Pack="true" />
<_JsonInputFile Include="WorkloadManifest.in.targets" OutputPath="$(IntermediateOutputPath)WorkloadManifest.targets" Pack="true" />
<_JsonInputFile Include="Rollback.in.json" OutputPath="$(IntermediateOutputPath)Rollback.json" Pack="false" />
<_JsonInputFile Include="SdkInstaller.in.json" OutputPath="$(IntermediateOutputPath)SdkInstaller.json" Pack="false" />
</ItemGroup>
Expand Down Expand Up @@ -54,6 +55,12 @@
<_VersionsToReplace Include="MicrosoftMauiGraphicsVersion" />
<_VersionsToReplace Update="@(_VersionsToReplace)" PropertyName="%(Identity)" />
<_VersionsToReplace Include="MicrosoftMauiGraphicsWin2DWinUIDesktopPackageVersion" PropertyName="MicrosoftMauiGraphicsVersion" />
<_VersionsToReplace Include="MAUI_GRAPHICS_VERSION" PropertyName="MicrosoftMauiGraphicsVersion" />
<_VersionsToReplace Include="VERSION" PropertyName="PackageReferenceVersion" />
<_VersionsToReplace Include="MAUI_DOTNET_VERSION" PropertyName="_MauiDotNetVersion" />
<_VersionsToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION" PropertyName="_MauiPreviousDotNetVersion" />
<_VersionsToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION_NO_DOT" PropertyName="_MauiPreviousDotNetVersionNoDot" />
<_VersionsToReplace Include="MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION" PropertyName="MicrosoftMauiPreviousDotNetReleasedVersion" />
</ItemGroup>
<CreateItem
Include="@(_JsonInputFile)"
Expand All @@ -62,23 +69,9 @@
TaskParameter="Include"
ItemName="_JsonVariableMatrix"/>
</CreateItem>
<ReplaceText
Input="%(_JsonInputFile.Identity)"
Output="%(_JsonInputFile.OutputPath)"
OldValue="@VERSION@"
NewValue="$(PackageReferenceVersion)"
/>
<ReplaceText
Input="$(IntermediateOutputPath)WorkloadManifest.json"
Output="$(IntermediateOutputPath)WorkloadManifest.json"
OldValue="@MAUI_GRAPHICS_VERSION@"
NewValue="$(MicrosoftMauiGraphicsVersion)"
/>
<ReplaceText
Input="$(IntermediateOutputPath)WorkloadManifest.json"
Output="$(IntermediateOutputPath)WorkloadManifest.json"
OldValue="@MAUI_DOTNET_VERSION@"
NewValue="$(_MauiDotNetVersion)"
<Copy
SourceFiles="%(_JsonInputFile.Identity)"
DestinationFiles="%(_JsonInputFile.OutputPath)"
/>
<ReplaceText
Input="%(_JsonVariableMatrix.OutputPath)"
Expand Down
13 changes: 13 additions & 0 deletions src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
"packs": [
"Microsoft.Maui.Dependencies",
"Microsoft.Maui.Sdk",
"Microsoft.Maui.Sdk-@MAUI_PREVIOUS_DOTNET_VERSION@",
"Microsoft.Maui.Graphics",
"Microsoft.Maui.Resizetizer.Sdk",
"Microsoft.Maui.Templates-@MAUI_PREVIOUS_DOTNET_VERSION@",
"Microsoft.Maui.Templates-@MAUI_DOTNET_VERSION@",
"Microsoft.Maui.Core.Ref.any",
"Microsoft.Maui.Core.Runtime.any",
Expand Down Expand Up @@ -286,13 +288,24 @@
"kind": "sdk",
"version": "@VERSION@"
},
"Microsoft.Maui.Sdk-@MAUI_PREVIOUS_DOTNET_VERSION@": {
mattleibow marked this conversation as resolved.
Show resolved Hide resolved
"kind": "sdk",
"version": "@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@",
"alias-to": {
"any": "Microsoft.Maui.Sdk"
}
},
"Microsoft.Maui.Resizetizer.Sdk": {
"kind": "sdk",
"version": "@VERSION@"
},
"Microsoft.Maui.Templates-@MAUI_DOTNET_VERSION@": {
"kind": "template",
"version": "@VERSION@"
},
"Microsoft.Maui.Templates-@MAUI_PREVIOUS_DOTNET_VERSION@": {
"kind": "template",
"version": "@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
}
}
}
47 changes: 47 additions & 0 deletions src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project>

<ItemGroup Condition=" '$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' ">
<ProjectCapability Include="UseMauiCore" />
<ProjectCapability Condition=" '$(UseMaui)' == 'true' " Include="UseMaui" />
</ItemGroup>

<Import
Condition=" ('$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' or '$(UseMauiEssentials)' == 'true' or '$(UseMauiAssets)' == 'true') and ($([MSBuild]::VersionEquals($(TargetFrameworkVersion), '@MAUI_DOTNET_VERSION@'))) "
Project="Sdk.targets" Sdk="Microsoft.Maui.Sdk"
/>
<Import
Condition=" ('$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' or '$(UseMauiEssentials)' == 'true' or '$(UseMauiAssets)' == 'true') and ($([MSBuild]::VersionEquals($(TargetFrameworkVersion), '@MAUI_PREVIOUS_DOTNET_VERSION@'))) "
Project="Sdk.targets" Sdk="Microsoft.Maui.Sdk-@MAUI_PREVIOUS_DOTNET_VERSION@"
/>

<Import
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiAssets)' == 'true' "
Project="Sdk.targets" Sdk="Microsoft.Maui.Resizetizer.Sdk"
/>

<!--
Previous versions of the .NET MAUI SDK used **FromWorkload**, so replace with explicit versions.
The BundledVersions.targets that is imported is from the previous SDK, so all the other values are correct.
-->
<ItemGroup Condition=" $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '@MAUI_PREVIOUS_DOTNET_VERSION@')) ">
<KnownFrameworkReference
Update="Microsoft.Maui.Core"
DefaultRuntimeFrameworkVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
LatestRuntimeFrameworkVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
TargetingPackVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
/>
<KnownFrameworkReference
Update="Microsoft.Maui.Controls"
DefaultRuntimeFrameworkVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
LatestRuntimeFrameworkVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
TargetingPackVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
/>
<KnownFrameworkReference
Update="Microsoft.Maui.Essentials"
DefaultRuntimeFrameworkVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
LatestRuntimeFrameworkVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
TargetingPackVersion="@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@"
/>
</ItemGroup>

</Project>
14 changes: 0 additions & 14 deletions src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.targets

This file was deleted.