Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Build 14393 targets separately #12826

Merged
merged 4 commits into from
Nov 16, 2020
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
3 changes: 1 addition & 2 deletions UWP.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<TargetFrameworks>$(UwpMinTargetFrameworks)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(UwpMinTargetFrameworks)' == '' ">
<TargetFrameworks Condition=" '$(BuildingInsideVisualStudio)' == 'true' AND '$(OS)' == 'Windows_NT' ">uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(BuildingInsideVisualStudio)' != 'true' AND '$(OS)' == 'Windows_NT' ">uap10.0.14393;uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">uap10.0.16299</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using System.Linq;
using System.Threading;

#if UITEST
using Xamarin.UITest;
Expand Down Expand Up @@ -103,7 +103,7 @@ protected override void Init()
IsToggled = false,
HeightRequest = 60
};
var sourceLabel = new Label { Text = _imageFromFile };
var sourceLabel = new Label { Text = _imageFromFile, AutomationId = "SourceLabel" };

switchToUri.Toggled += (_, e) =>
{
Expand Down Expand Up @@ -176,42 +176,42 @@ protected override void Init()
[Test]
public void ImageFromFileSourceAppearsAndDisappearsCorrectly()
{
RunTest(nameof(Image), false);
RunTest(nameof(Image), true);
}

[Test]
[NUnit.Framework.Category(UITestCategories.RequiresInternetConnection)]
public void ImageFromUriSourceAppearsAndDisappearsCorrectly()
{
RunTest(nameof(Image), true);
RunTest(nameof(Image), false);
}


[Test]
public void ButtonFromFileSourceAppearsAndDisappearsCorrectly()
{
RunTest(nameof(Button), false);
RunTest(nameof(Button), true);
}

[Test]
[NUnit.Framework.Category(UITestCategories.RequiresInternetConnection)]
public void ButtonFromUriSourceAppearsAndDisappearsCorrectly()
{
RunTest(nameof(Button), true);
RunTest(nameof(Button), false);
}


[Test]
public void ImageButtonFromFileSourceAppearsAndDisappearsCorrectly()
{
RunTest(nameof(ImageButton), false);
RunTest(nameof(ImageButton), true);
}

[Test]
[NUnit.Framework.Category(UITestCategories.RequiresInternetConnection)]
public void ImageButtonFromUriSourceAppearsAndDisappearsCorrectly()
{
RunTest(nameof(ImageButton), true);
RunTest(nameof(ImageButton), false);
}

[Test]
Expand Down Expand Up @@ -306,9 +306,10 @@ void SetupTest(string controlType, bool fileSource)
RunningApp.WaitForNoElement(activeTest);
}

if (fileSource && RunningApp.Query(_imageFromFile).Length == 0)
string sourceLabel = RunningApp.WaitForFirstElement("SourceLabel").ReadText();
if (fileSource && sourceLabel != _imageFromFile)
RunningApp.Tap(_switchUriId);
else if (!fileSource && RunningApp.Query(_imageFromUri).Length == 0)
else if (!fileSource && sourceLabel != _imageFromUri)
RunningApp.Tap(_switchUriId);
}
#endif
Expand Down
27 changes: 24 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,33 @@ Task("BuildForNuget")

msbuildSettings = GetMSBuildSettings();
msbuildSettings.BinaryLogger = binaryLogger;
binaryLogger.FileName = $"{artifactStagingDirectory}/win-{configuration}-csproj.binlog";
binaryLogger.FileName = $"{artifactStagingDirectory}/win-maps-{configuration}-csproj.binlog";
MSBuild("./Xamarin.Forms.Maps.UWP/Xamarin.Forms.Maps.UWP.csproj",
msbuildSettings
.WithProperty("UwpMinTargetFrameworks", "uap10.0.14393")
.WithRestore());

msbuildSettings = GetMSBuildSettings();
msbuildSettings.BinaryLogger = binaryLogger;
binaryLogger.FileName = $"{artifactStagingDirectory}/win-16299-{configuration}-csproj.binlog";
MSBuild("./Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj",
msbuildSettings
.WithRestore()
.WithTarget("rebuild")
.WithProperty("DisableEmbeddedXbf", "false")
.WithProperty("EnableTypeInfoReflection", "false")
.WithProperty("UwpMinTargetFrameworks", "uap10.0.16299"));

msbuildSettings = GetMSBuildSettings();
msbuildSettings.BinaryLogger = binaryLogger;
binaryLogger.FileName = $"{artifactStagingDirectory}/win-14393-{configuration}-csproj.binlog";
MSBuild("./Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj",
msbuildSettings
.WithRestore()
.WithTarget("rebuild")
.WithProperty("DisableEmbeddedXbf", "false")
.WithProperty("EnableTypeInfoReflection", "false"));
.WithProperty("EnableTypeInfoReflection", "false")
.WithProperty("UwpMinTargetFrameworks", "uap10.0.14393"));

msbuildSettings = GetMSBuildSettings();
msbuildSettings.BinaryLogger = binaryLogger;
Expand Down Expand Up @@ -1186,4 +1207,4 @@ public void SetEnvironmentVariable(string key, string value, ICakeContext contex
{
System.Environment.SetEnvironmentVariable(key, value);
}
}
}