Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/net6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Aug 29, 2022
2 parents ed53643 + 3e5d206 commit 29828c2
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 22 deletions.
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.401-servicing.22415.11" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.401-servicing.22419.11" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>ab13fb50e90766d83f7d8c0e1ab6a38cb30e7d41</Sha>
<Sha>b98928971106bd301a7827962ff6d46fb7c28fc1</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Ref" Version="6.0.9" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>531f715f281e7a6456375635c02b6dd301d95996</Sha>
</Dependency>
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="32.0.463">
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="32.0.465">
<Uri>https://github.com/xamarin/xamarin-android</Uri>
<Sha>246e84b7ee6fbe354ec5a4f5747669af73b800ec</Sha>
<Sha>d6224ca6b1032ffebc8fe2b496f93a511b0674a6</Sha>
</Dependency>
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="15.4.448">
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project>
<PropertyGroup>
<!-- dotnet/installer -->
<MicrosoftDotnetSdkInternalPackageVersion>6.0.401-servicing.22415.11</MicrosoftDotnetSdkInternalPackageVersion>
<MicrosoftDotnetSdkInternalPackageVersion>6.0.401-servicing.22419.11</MicrosoftDotnetSdkInternalPackageVersion>
<!-- dotnet/runtime -->
<MicrosoftNETCoreAppRefPackageVersion>6.0.9</MicrosoftNETCoreAppRefPackageVersion>
<!-- NOTE: should eventually revert back to $(MicrosoftNETCoreAppRefPackageVersion) in .NET 7 -->
<MicrosoftExtensionsPackageVersion>6.0.0</MicrosoftExtensionsPackageVersion>
<MicrosoftExtensionsServicingPackageVersion>6.0.1</MicrosoftExtensionsServicingPackageVersion>
<SystemCodeDomPackageVersion>6.0.0</SystemCodeDomPackageVersion>
<!-- xamarin/xamarin-android -->
<MicrosoftAndroidSdkWindowsPackageVersion>32.0.463</MicrosoftAndroidSdkWindowsPackageVersion>
<MicrosoftAndroidSdkWindowsPackageVersion>32.0.465</MicrosoftAndroidSdkWindowsPackageVersion>
<!-- xamarin/xamarin-macios -->
<MicrosoftiOSSdkPackageVersion>15.4.448</MicrosoftiOSSdkPackageVersion>
<MicrosoftMacCatalystSdkPackageVersion>15.4.448</MicrosoftMacCatalystSdkPackageVersion>
Expand Down
1 change: 1 addition & 0 deletions eng/automation/vs-workload.template.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
<ComponentResources Include="maui-ios" Version="@VS_COMPONENT_VERSION@" Category=".NET" Title=".NET MAUI SDK for iOS" Description=".NET SDK Workload for building MAUI applications that target iOS." />
<ComponentResources Include="maui-windows" Version="@VS_COMPONENT_VERSION@" Category=".NET" Title=".NET MAUI SDK for Windows" Description=".NET SDK Workload for building MAUI applications that target Windows." />
<WorkloadPackages Include="$(NuGetPackagePath)\Microsoft.NET.Sdk.Maui.Manifest*.nupkg" Version="@VS_COMPONENT_VERSION@" />
<MultiTargetPackNames Include="Microsoft.Maui.Sdk" />
</ItemGroup>
</Project>
15 changes: 14 additions & 1 deletion eng/pipelines/common/sdk-insertion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,17 @@ jobs:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: vsdrop-signed
downloadPath: $(Build.StagingDirectory)/$(VSDropCommitStatusName)
downloadPath: $(Build.StagingDirectory)/$(VSDropCommitStatusName)
- template: templates\common\upload-vs-insertion-artifacts.yml@sdk-insertions
parameters:
githubToken: $(github--pat--vs-mobiletools-engineering-service2)
githubContext: $(MultiTargetVSDropCommitStatusName)
blobName: $(MultiTargetVSDropCommitStatusName)
packagePrefix: maui
artifactsPath: $(Build.StagingDirectory)/$(MultiTargetVSDropCommitStatusName)
yamlResourceName: xamarin-templates
downloadSteps:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: vsdrop-multitarget-signed
downloadPath: $(Build.StagingDirectory)/$(MultiTargetVSDropCommitStatusName)
3 changes: 2 additions & 1 deletion eng/pipelines/common/sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stages:
displayName: Sign Phase
condition: and(succeeded(), eq(variables.signingCondition, true))

- template: nuget-msi-convert/job/v2.yml@xamarin-templates
- template: nuget-msi-convert/job/v3.yml@xamarin-templates
parameters:
yamlResourceName: xamarin-templates
artifactName: nuget
Expand All @@ -23,6 +23,7 @@ stages:
artifactPath: signed
propsArtifactName: nuget
signType: Real
useDateTimeVersion: false
preConvertSteps:
- task: DownloadPipelineArtifact@2
displayName: Download library-packs nugets
Expand Down
7 changes: 7 additions & 0 deletions src/Controls/src/Xaml/SimplifyOnPlatformVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ public void Visit(ElementNode node, INode parentNode)
if (parentNode is IElementNode parentEnode)
parentEnode.Properties[name] = targetNode;
}
else if (node.CollectionItems.Count > 0) // syntax like {OnPlatform foo, iOS=bar}
{
if (!ApplyPropertiesVisitor.TryGetPropertyName(node, parentNode, out XmlName name))
return;
if (parentNode is IElementNode parentEnode)
parentEnode.Properties[name] = node.CollectionItems[0];
}
else //no prop for target and no Default set
{
if (!ApplyPropertiesVisitor.TryGetPropertyName(node, parentNode, out XmlName name))
Expand Down
9 changes: 4 additions & 5 deletions src/Controls/tests/Xaml.UnitTests/OnPlatformOptimization.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Microsoft.Maui.Controls.Xaml.UnitTests.OnPlatformOptimization">
<StackLayout>
<Border>
<Grid>
<Label x:Name="label0"
Text="{OnPlatform Android='john', iOS='paul', Default='ringo' }"
Padding="{OnPlatform iOS='2,3,4,5'}" />
<Border.StrokeShape>
<RoundRectangle CornerRadius="12"/>
</Border.StrokeShape>
</Border>
<Label x:Name="label1"
Text="{OnPlatform foo, iOS=bar }" />
</Grid>
</StackLayout>
</ContentPage>
13 changes: 12 additions & 1 deletion src/Controls/tests/Xaml.UnitTests/OnPlatformOptimization.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Microsoft.Maui.Controls.Xaml.UnitTests
{
[XamlCompilation(XamlCompilationOptions.Skip)]
public partial class OnPlatformOptimization : ContentPage
{
public OnPlatformOptimization()
Expand All @@ -31,6 +30,18 @@ public void OnPlatformExtensionsAreSimplified([Values("net6.0-ios", "net6.0-andr
{
MockCompiler.Compile(typeof(OnPlatformOptimization), out var methodDef, targetFramework);
Assert.That(!methodDef.Body.Instructions.Any(instr => InstructionIsOnPlatformExtensionCtor(methodDef, instr)), "This Xaml still generates a new OnPlatformExtension()");

var expected = targetFramework == "net6.0-ios" ? "bar" : "foo";
Assert.That(methodDef.Body.Instructions.Any(instr => instr.Operand as string == expected), $"Did not find instruction containing '{expected}'");
}

[TestCase(false)]
[TestCase(true)]
public void ValuesAreSet(bool useCompiledXaml)
{
var p = new OnPlatformOptimization(useCompiledXaml);
Assert.AreEqual("ringo", p.label0.Text);
Assert.AreEqual("foo", p.label1.Text);
}

bool InstructionIsOnPlatformExtensionCtor(MethodDefinition methodDef, Mono.Cecil.Cil.Instruction instruction)
Expand Down
6 changes: 3 additions & 3 deletions src/Core/src/Platform/Tizen/MauiPicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public MauiPicker()
{
_underline = new NView
{
Color = _defaultUnderlineColor,
BackgroundColor = _defaultUnderlineColor,
SizeHeight = 1d.ToScaledPixel(),
WidthResizePolicy = ResizePolicyType.FillToParent,
ParentOrigin = Position.ParentOriginBottomLeft
Expand All @@ -31,7 +31,7 @@ public MauiPicker()
protected override void OnEnabled(bool enabled)
{
base.OnEnabled(enabled);
_underline.Color = enabled ? _defaultUnderlineColor : NColor.LightGray;
_underline.BackgroundColor = enabled ? _defaultUnderlineColor : NColor.LightGray;
}
}
}
}
5 changes: 4 additions & 1 deletion src/Maui.InTree.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<Project>
<ItemGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'">
<ProjectCapability Include="Maui" />
</ItemGroup>
<Import Project="$(_MauiBuildTasksLocation)Microsoft.Maui.Core.targets" Condition="'$(BuildingInsideVisualStudio)' == 'true' AND Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.Build.Tasks.dll')" />
<Import Project="$(_MauiBuildTasksLocation)Microsoft.Maui.Core.targets" Condition="'$(BuildingInsideVisualStudio)' != 'true'" />
<Import Project="$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.targets" Condition="'$(BuildingInsideVisualStudio)' == 'true' AND Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.Build.Tasks.dll')" />
<Import Project="$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.targets" Condition="'$(BuildingInsideVisualStudio)' != 'true'" />
<Import Project="$(_MauiBuildTasksLocation)Microsoft.Maui.Controls.DefaultItems.targets" />
<Import Project="$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.targets" Condition="'$(BuildingInsideVisualStudio)' == 'true' AND Exists('$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.dll')" />
<Import Project="$(_MauiBuildTasksLocation)Microsoft.Maui.Resizetizer.targets" Condition="'$(BuildingInsideVisualStudio)' != 'true'" />
</Project>
</Project>
9 changes: 6 additions & 3 deletions src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"description": ".NET MAUI SDK Core Packages",
"packs": [
"Microsoft.Maui.Dependencies",
"Microsoft.Maui.Sdk",
"Microsoft.Maui.Sdk.net6",
"Microsoft.Maui.Graphics",
"Microsoft.Maui.Resizetizer.Sdk",
"Microsoft.Maui.Templates-@MAUI_DOTNET_VERSION@",
Expand Down Expand Up @@ -282,9 +282,12 @@
"kind": "library",
"version": "@MAUI_GRAPHICS_VERSION@"
},
"Microsoft.Maui.Sdk": {
"Microsoft.Maui.Sdk.net6": {
"kind": "sdk",
"version": "@VERSION@"
"version": "@VERSION@",
"alias-to": {
"any": "Microsoft.Maui.Sdk"
}
},
"Microsoft.Maui.Resizetizer.Sdk": {
"kind": "sdk",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</ItemGroup>
<Import
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' or '$(UseMauiEssentials)' == 'true' or '$(UseMauiAssets)' == 'true' "
Project="Sdk.targets" Sdk="Microsoft.Maui.Sdk"
Project="Sdk.targets" Sdk="Microsoft.Maui.Sdk.net6"
/>
<Import
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiAssets)' == 'true' "
Expand Down

0 comments on commit 29828c2

Please sign in to comment.