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

Commit db8ab0c

Browse files
authored
Build 14393 targets separately (#12826)
* Build 14393 targets separately * Update build.cake * Update build.cake * - additional unit test fixes
1 parent fcabac1 commit db8ab0c

File tree

3 files changed

+37
-16
lines changed

3 files changed

+37
-16
lines changed

UWP.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
<TargetFrameworks>$(UwpMinTargetFrameworks)</TargetFrameworks>
44
</PropertyGroup>
55
<PropertyGroup Condition=" '$(UwpMinTargetFrameworks)' == '' ">
6-
<TargetFrameworks Condition=" '$(BuildingInsideVisualStudio)' == 'true' AND '$(OS)' == 'Windows_NT' ">uap10.0.16299</TargetFrameworks>
7-
<TargetFrameworks Condition=" '$(BuildingInsideVisualStudio)' != 'true' AND '$(OS)' == 'Windows_NT' ">uap10.0.14393;uap10.0.16299</TargetFrameworks>
6+
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">uap10.0.16299</TargetFrameworks>
87
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0</TargetFrameworks>
98
</PropertyGroup>
109
<PropertyGroup>

Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4597.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System.Linq;
45
using System.Text;
6+
using System.Threading;
57
using Xamarin.Forms.CustomAttributes;
68
using Xamarin.Forms.Internals;
7-
using System.Linq;
8-
using System.Threading;
99

1010
#if UITEST
1111
using Xamarin.UITest;
@@ -103,7 +103,7 @@ protected override void Init()
103103
IsToggled = false,
104104
HeightRequest = 60
105105
};
106-
var sourceLabel = new Label { Text = _imageFromFile };
106+
var sourceLabel = new Label { Text = _imageFromFile, AutomationId = "SourceLabel" };
107107

108108
switchToUri.Toggled += (_, e) =>
109109
{
@@ -176,42 +176,42 @@ protected override void Init()
176176
[Test]
177177
public void ImageFromFileSourceAppearsAndDisappearsCorrectly()
178178
{
179-
RunTest(nameof(Image), false);
179+
RunTest(nameof(Image), true);
180180
}
181181

182182
[Test]
183183
[NUnit.Framework.Category(UITestCategories.RequiresInternetConnection)]
184184
public void ImageFromUriSourceAppearsAndDisappearsCorrectly()
185185
{
186-
RunTest(nameof(Image), true);
186+
RunTest(nameof(Image), false);
187187
}
188188

189189

190190
[Test]
191191
public void ButtonFromFileSourceAppearsAndDisappearsCorrectly()
192192
{
193-
RunTest(nameof(Button), false);
193+
RunTest(nameof(Button), true);
194194
}
195195

196196
[Test]
197197
[NUnit.Framework.Category(UITestCategories.RequiresInternetConnection)]
198198
public void ButtonFromUriSourceAppearsAndDisappearsCorrectly()
199199
{
200-
RunTest(nameof(Button), true);
200+
RunTest(nameof(Button), false);
201201
}
202202

203203

204204
[Test]
205205
public void ImageButtonFromFileSourceAppearsAndDisappearsCorrectly()
206206
{
207-
RunTest(nameof(ImageButton), false);
207+
RunTest(nameof(ImageButton), true);
208208
}
209209

210210
[Test]
211211
[NUnit.Framework.Category(UITestCategories.RequiresInternetConnection)]
212212
public void ImageButtonFromUriSourceAppearsAndDisappearsCorrectly()
213213
{
214-
RunTest(nameof(ImageButton), true);
214+
RunTest(nameof(ImageButton), false);
215215
}
216216

217217
[Test]
@@ -306,9 +306,10 @@ void SetupTest(string controlType, bool fileSource)
306306
RunningApp.WaitForNoElement(activeTest);
307307
}
308308

309-
if (fileSource && RunningApp.Query(_imageFromFile).Length == 0)
309+
string sourceLabel = RunningApp.WaitForFirstElement("SourceLabel").ReadText();
310+
if (fileSource && sourceLabel != _imageFromFile)
310311
RunningApp.Tap(_switchUriId);
311-
else if (!fileSource && RunningApp.Query(_imageFromUri).Length == 0)
312+
else if (!fileSource && sourceLabel != _imageFromUri)
312313
RunningApp.Tap(_switchUriId);
313314
}
314315
#endif

build.cake

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,12 +800,33 @@ Task("BuildForNuget")
800800

801801
msbuildSettings = GetMSBuildSettings();
802802
msbuildSettings.BinaryLogger = binaryLogger;
803-
binaryLogger.FileName = $"{artifactStagingDirectory}/win-{configuration}-csproj.binlog";
803+
binaryLogger.FileName = $"{artifactStagingDirectory}/win-maps-{configuration}-csproj.binlog";
804+
MSBuild("./Xamarin.Forms.Maps.UWP/Xamarin.Forms.Maps.UWP.csproj",
805+
msbuildSettings
806+
.WithProperty("UwpMinTargetFrameworks", "uap10.0.14393")
807+
.WithRestore());
808+
809+
msbuildSettings = GetMSBuildSettings();
810+
msbuildSettings.BinaryLogger = binaryLogger;
811+
binaryLogger.FileName = $"{artifactStagingDirectory}/win-16299-{configuration}-csproj.binlog";
812+
MSBuild("./Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj",
813+
msbuildSettings
814+
.WithRestore()
815+
.WithTarget("rebuild")
816+
.WithProperty("DisableEmbeddedXbf", "false")
817+
.WithProperty("EnableTypeInfoReflection", "false")
818+
.WithProperty("UwpMinTargetFrameworks", "uap10.0.16299"));
819+
820+
msbuildSettings = GetMSBuildSettings();
821+
msbuildSettings.BinaryLogger = binaryLogger;
822+
binaryLogger.FileName = $"{artifactStagingDirectory}/win-14393-{configuration}-csproj.binlog";
804823
MSBuild("./Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj",
805824
msbuildSettings
825+
.WithRestore()
806826
.WithTarget("rebuild")
807827
.WithProperty("DisableEmbeddedXbf", "false")
808-
.WithProperty("EnableTypeInfoReflection", "false"));
828+
.WithProperty("EnableTypeInfoReflection", "false")
829+
.WithProperty("UwpMinTargetFrameworks", "uap10.0.14393"));
809830

810831
msbuildSettings = GetMSBuildSettings();
811832
msbuildSettings.BinaryLogger = binaryLogger;
@@ -1186,4 +1207,4 @@ public void SetEnvironmentVariable(string key, string value, ICakeContext contex
11861207
{
11871208
System.Environment.SetEnvironmentVariable(key, value);
11881209
}
1189-
}
1210+
}

0 commit comments

Comments
 (0)