Skip to content

Commit

Permalink
Merge NET9 GA into main (dotnet#25422)
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen authored Oct 22, 2024
2 parents 8b44525 + af52ebf commit 0f79050
Show file tree
Hide file tree
Showing 29 changed files with 225 additions and 118 deletions.
2 changes: 1 addition & 1 deletion eng/devices/android.cake
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ void ExecuteUITests(string project, string app, string appPackageName, string de

var name = System.IO.Path.GetFileNameWithoutExtension(project);
var binlog = $"{binDir}/{name}-{config}-{platform}.binlog";
var appiumLog = $"{binDir}/appium_{platform}.log";
var resultsFileName = SanitizeTestResultsFilename($"{name}-{config}-{platform}-{testFilter}");
var appiumLog = $"{binDir}/appium_{platform}_{resultsFileName}.log";

DotNetBuild(project, new DotNetBuildSettings
{
Expand Down
2 changes: 1 addition & 1 deletion eng/devices/catalyst.cake
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ void ExecuteUITests(string project, string app, string device, string resultsDir

var name = System.IO.Path.GetFileNameWithoutExtension(project);
var binlog = $"{binDir}/{name}-{config}-mac.binlog";
var appiumLog = $"{binDir}/appium_mac.log";
var resultsFileName = SanitizeTestResultsFilename($"{name}-{config}-catalyst-{testFilter}");
var appiumLog = $"{binDir}/appium_mac_{resultsFileName}.log";

DotNetBuild(project, new DotNetBuildSettings
{
Expand Down
6 changes: 3 additions & 3 deletions eng/devices/ios.cake
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Setup(context =>
{
return;
}

PerformCleanupIfNeeded(deviceCleanupEnabled, false);
bool createLogs = targetCleanup && IsCIBuild();
PerformCleanupIfNeeded(deviceCleanupEnabled, createLogs);

// Device or simulator setup
if (testDevice.Contains("device"))
Expand Down Expand Up @@ -234,8 +234,8 @@ void ExecuteUITests(string project, string app, string device, string resultsDir

var name = System.IO.Path.GetFileNameWithoutExtension(project);
var binlog = $"{binDir}/{name}-{config}-ios.binlog";
var appiumLog = $"{binDir}/appium_ios.log";
var resultsFileName = SanitizeTestResultsFilename($"{name}-{config}-ios-{testFilter}");
var appiumLog = $"{binDir}/appium_ios_{resultsFileName}.log";

DotNetBuild(project, new DotNetBuildSettings
{
Expand Down
1 change: 1 addition & 0 deletions eng/devices/uitests-shared.cake
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ if (!IsCIBuild() && GetBuildVariable("workloads", "notset") == "notset")

bool deviceBoot = Argument("boot", TARGET.ToLower() != "uitest-build");
bool targetBoot = TARGET.ToLower() == "boot";
bool targetCleanup = TARGET.ToLower() == "cleanup";
bool deviceBootWait = Argument("wait", true);
2 changes: 1 addition & 1 deletion eng/devices/windows.cake
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ Task("uitest")
DotNetBuild(PROJECT.FullPath, buildSettings);

SetEnvironmentVariable("WINDOWS_APP_PATH", TEST_APP);
SetEnvironmentVariable("APPIUM_LOG_FILE", $"{BINLOG_DIR}/appium_windows.log");
SetEnvironmentVariable("APPIUM_LOG_FILE", $"{BINLOG_DIR}/appium_windows_{name}.log");

Information("Run UITests project {0}",PROJECT.FullPath);
RunTestWithLocalDotNet(PROJECT.FullPath, CONFIGURATION, localToolPath, noBuild: true, resultsFileNameWithoutExtension: $"{name}-{CONFIGURATION}-windows");
Expand Down
20 changes: 14 additions & 6 deletions eng/pipelines/common/maui-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ parameters:
- name: BuildCategories
type: object
default:
- WindowsTemplates
- macOSTemplates
- Build
- Blazor
- MultiProject
- AOT
- WindowsTemplates
- macOSTemplates
- Build
- Blazor
- MultiProject
- AOT

- name: RunPlatforms
type: object
Expand Down Expand Up @@ -119,6 +119,14 @@ jobs:
continueOnError: true
condition: succeededOrFailed()

- task: PublishBuildArtifacts@1
displayName: Publish Artifacts
condition: always()
continueOnError: true
inputs:
PathToPublish: '$(Build.StagingDirectory)/IntegrationTestsBuildLogs'
ArtifactName: BuildTemplateBuildLogs

- task: PublishTestResults@2
displayName: Publish the $(PLATFORM_NAME) templates build tests
condition: always()
Expand Down
113 changes: 57 additions & 56 deletions eng/pipelines/common/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,22 @@ stages:
parameters:
runtimeVariant: "Mono"

- stage: build_ui_tests_nativeaot
displayName: Build UITests Sample App NativeAOT
dependsOn: []
jobs:
- job: build_ui_tests
displayName: Build Sample App
pool: ${{ parameters.androidPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/
steps:
- template: ui-tests-build-sample.yml
parameters:
runtimeVariant: "NativeAOT"
platform: ios
- ${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}:
- stage: build_ui_tests_nativeaot
displayName: Build UITests Sample App NativeAOT
dependsOn: []
jobs:
- job: build_ui_tests
displayName: Build Sample App
pool: ${{ parameters.androidPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/
steps:
- template: ui-tests-build-sample.yml
parameters:
runtimeVariant: "NativeAOT"
platform: ios

- stage: build_ui_tests_windows
displayName: Build UITests Windows Sample App
Expand Down Expand Up @@ -165,47 +166,47 @@ stages:
runtimeVariant : "Mono"
testFilter: $(CATEGORYGROUP)


- stage: ios_ui_tests_nativeaot
displayName: iOS UITests NativeAOT
dependsOn: build_ui_tests_nativeaot
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.ios, '') }}:
- ${{ each version in parameters.iosVersions }}:
- ${{ if not(containsValue(project.iosVersionsExclude, version)) }}:
- job: ios_ui_tests_nativeaot_${{ project.name }}_${{ replace(version, '.', '_') }}
strategy:
matrix:
${{ each categoryGroup in parameters.categoryGroupsToTest }}:
${{ categoryGroup }}:
CATEGORYGROUP: ${{ categoryGroup }}
timeoutInMinutes: 240 # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }})
pool: ${{ parameters.iosPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/
steps:
- template: ui-tests-steps.yml
parameters:
platform: ios
${{ if eq(version, 'latest') }}:
version: 17.2
${{ if ne(version, 'latest') }}:
version: ${{ version }}
path: ${{ project.ios }}
app: ${{ project.app }}
${{ if eq(version, 'latest') }}:
device: ios-simulator-64
${{ if ne(version, 'latest') }}:
device: ios-simulator-64_${{ version }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
runtimeVariant : "NativeAOT"
testFilter: $(CATEGORYGROUP)
- ${{ if or(parameters.BuildEverything, and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'devdiv'))) }}:
- stage: ios_ui_tests_nativeaot
displayName: iOS UITests NativeAOT
dependsOn: build_ui_tests_nativeaot
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.ios, '') }}:
- ${{ each version in parameters.iosVersions }}:
- ${{ if not(containsValue(project.iosVersionsExclude, version)) }}:
- job: ios_ui_tests_nativeaot_${{ project.name }}_${{ replace(version, '.', '_') }}
strategy:
matrix:
${{ each categoryGroup in parameters.categoryGroupsToTest }}:
${{ categoryGroup }}:
CATEGORYGROUP: ${{ categoryGroup }}
timeoutInMinutes: 240 # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }})
pool: ${{ parameters.iosPool }}
variables:
REQUIRED_XCODE: $(DEVICETESTS_REQUIRED_XCODE)
APPIUM_HOME: $(System.DefaultWorkingDirectory)/.appium/
steps:
- template: ui-tests-steps.yml
parameters:
platform: ios
${{ if eq(version, 'latest') }}:
version: 17.2
${{ if ne(version, 'latest') }}:
version: ${{ version }}
path: ${{ project.ios }}
app: ${{ project.app }}
${{ if eq(version, 'latest') }}:
device: ios-simulator-64
${{ if ne(version, 'latest') }}:
device: ios-simulator-64_${{ version }}
provisionatorChannel: ${{ parameters.provisionatorChannel }}
agentPoolAccessToken: ${{ parameters.agentPoolAccessToken }}
runtimeVariant : "NativeAOT"
testFilter: $(CATEGORYGROUP)

- stage: winui_ui_tests
displayName: WinUI UITests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Condition="'$(EnvironmentBuildPropsImported)' != 'True'" Project="..\..\..\..\..\eng\Environment.Build.props" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public IEnumerable<Instruction> ProvideValue(VariableDefinitionReference vardefr


//Fallback
foreach (var instruction in FallBack(keyValueNode.Value as string, eNode, module, context).ToList())
foreach (var instruction in FallBack(keyValueNode.Value as string, eNode, module, context).ToList())
yield return instruction;

var vardef = new VariableDefinition(module.TypeSystem.Object);
Expand Down Expand Up @@ -124,15 +124,21 @@ public static IEnumerable<Instruction> TryConvert(ValueNode stringResourceNode,
var propertyRef = parentType.GetProperty(context.Cache, pd => pd.Name == localName, out var declaringTypeReference);
if (propertyRef != null)
{
foreach (var instruction in stringResourceNode.PushConvertedValue(context, propertyRef.PropertyType, new ICustomAttributeProvider[] { propertyRef, propertyRef.PropertyType.ResolveCached(context.Cache) }, requiredServices => stringResourceNode.PushServiceProvider(context, requiredServices, propertyRef: propertyRef), true, false))
var propertyType = propertyRef.PropertyType.ResolveGenericParameters(declaringTypeReference);

foreach (var instruction in stringResourceNode.PushConvertedValue(
context,
propertyType,
[propertyRef, propertyType.ResolveCached(context.Cache)],
requiredServices => stringResourceNode.PushServiceProvider(context, requiredServices, propertyRef: propertyRef),
boxValueTypes: true,
unboxValueTypes: false))
yield return instruction;
var vardef = new VariableDefinition(propertyRef.PropertyType);
var vardef = new VariableDefinition(propertyType);
yield return Create(Stloc, vardef);
vardefref.VariableDefinition = vardef;
yield break;
}


}

public static IEnumerable<Instruction> FallBack(string key, IElementNode node, ModuleDefinition module, ILContext context)
Expand Down
17 changes: 3 additions & 14 deletions src/Controls/src/Build.Tasks/CreateObjectVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,6 @@ public void Visit(ElementNode node, INode parentNode)
return;
}

if (IsXaml2009LanguagePrimitive(node))
{
var vardef = new VariableDefinition(typeref);
Context.Variables[node] = vardef;
Context.Body.Variables.Add(vardef);

Context.IL.Append(PushValueFromLanguagePrimitive(typedef, node));
Context.IL.Emit(Stloc, vardef);
return;
}

MethodDefinition factoryCtorInfo = null;
MethodDefinition factoryMethodInfo = null;
MethodDefinition parameterizedCtorInfo = null;
Expand Down Expand Up @@ -214,7 +203,7 @@ public void Visit(ElementNode node, INode parentNode)
(vardef.VariableType.IsValueType || isColor))
{
//<Color>Purple</Color>
Context.IL.Append(vnode.PushConvertedValue(Context, typeref, new ICustomAttributeProvider[] { typedef },
Context.IL.Append(vnode.PushConvertedValue(Context, typeref, [typedef],
(requiredServices) => node.PushServiceProvider(Context, requiredServices),
false, true));
Context.IL.Emit(OpCodes.Stloc, vardef);
Expand Down Expand Up @@ -324,7 +313,7 @@ IEnumerable<Instruction> PushCtorArguments(MethodReference ctorinfo, ElementNode
{
foreach (var instruction in vnode.PushConvertedValue(Context,
parameter.ParameterType,
new ICustomAttributeProvider[] { parameter, parameter.ParameterType.ResolveCached(Context.Cache) },
[parameter, parameter.ParameterType.ResolveCached(Context.Cache)],
(requiredServices) => enode.PushServiceProvider(Context, requiredServices),
false, true))
yield return instruction;
Expand Down Expand Up @@ -362,7 +351,7 @@ IEnumerable<Instruction> PushCtorXArguments(MethodReference factoryCtorInfo, Ele
{
foreach (var instruction in vnode.PushConvertedValue(Context,
parameter.ParameterType,
new ICustomAttributeProvider[] { parameter, parameter.ParameterType.ResolveCached(Context.Cache) },
[parameter, parameter.ParameterType.ResolveCached(Context.Cache)],
(requiredServices) => enode.PushServiceProvider(Context, requiredServices),
false, true))
yield return instruction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ protected override void DisconnectHandler(UIView platformView)
{
ItemsView.ScrollToRequested -= ScrollToRequested;
_layout = null;
MauiContext?.GetDispatcher()?.Dispatch(() =>
{
Controller?.DisposeItemsSource();
});
Controller?.DisposeItemsSource();
base.DisconnectHandler(platformView);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri
const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string!
const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri
const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string!
const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri
const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string!
const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri
const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string!
const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri
const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string!
const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri
const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string!
const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Microsoft.Maui.Controls.TitleBar.IconHiddenState = "IconCollapsed" -> stri
const Microsoft.Maui.Controls.TitleBar.IconVisibleState = "IconVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingHiddenState = "LeadingContentCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.LeadingVisibleState = "LeadingContentVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubTitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleHiddenState = "SubtitleCollapsed" -> string!
const Microsoft.Maui.Controls.TitleBar.SubtitleVisibleState = "SubtitleVisible" -> string!
const Microsoft.Maui.Controls.TitleBar.TemplateRootName = "PART_Root" -> string!
const Microsoft.Maui.Controls.TitleBar.TitleBarActiveState = "TitleBarTitleActive" -> string!
Expand Down
Loading

0 comments on commit 0f79050

Please sign in to comment.