Skip to content

Commit

Permalink
Allow BuildTest.BuildHasNoWarnings to have up to 1 warning due to be …
Browse files Browse the repository at this point in the history
…incompatible with Api level 29
  • Loading branch information
gugavaro committed Jul 9, 2019
1 parent fb6cfe0 commit 55be351
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ public void BuildBasicApplicationRelease ()
[Test]
public void BuildHasNoWarnings ([Values (true, false)] bool isRelease, [Values (true, false)] bool xamarinForms)
{
// With Android API Level 29, we will get a warning: "... is only compatible with TargetFrameworkVersion: MonoAndroid,v9.0 (Android API Level 28)"
// We should allow a maximum of 1 warning to cover this case until the packages get updated to be compatible with Api level 29
var proj = xamarinForms ?
new XamarinFormsAndroidApplicationProject () :
new XamarinAndroidApplicationProject ();
proj.IsRelease = isRelease;
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, "0 Warning(s)"), "Should have zero MSBuild warnings.");
Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, " 0 Warning(s)") || StringAssertEx.ContainsText (b.LastBuildOutput, " 1 Warning(s)"), "Should have no more than 1 MSBuild warnings.");
Assert.IsFalse (StringAssertEx.ContainsText (b.LastBuildOutput, "Warning: end of file not at end of a line"),
"Should not get a warning from the <CompileNativeAssembly/> task.");
}
Expand Down Expand Up @@ -456,7 +458,7 @@ public void CheckTimestamps ([Values (true, false)] bool isRelease)
var start = DateTime.UtcNow.AddSeconds (-1);
var proj = new XamarinFormsAndroidApplicationProject {
IsRelease = isRelease,

};

using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
Expand Down Expand Up @@ -583,8 +585,8 @@ public void BuildApplicationWithLibraryAndClean ([Values (false, true)] bool isR
public void BuildIncrementingAssemblyVersion ()
{
var proj = new XamarinAndroidApplicationProject ();
proj.Sources.Add (new BuildItem ("Compile", "AssemblyInfo.cs") {
TextContent = () => "[assembly: System.Reflection.AssemblyVersion (\"1.0.0.*\")]"
proj.Sources.Add (new BuildItem ("Compile", "AssemblyInfo.cs") {
TextContent = () => "[assembly: System.Reflection.AssemblyVersion (\"1.0.0.*\")]"
});

using (var b = CreateApkBuilder ("temp/BuildIncrementingAssemblyVersion")) {
Expand Down Expand Up @@ -3111,7 +3113,7 @@ public void AndroidLibraryProjectsZipWithOddPaths ()

[Test]
[TestCaseSource (nameof (validateJavaVersionTestCases))]
public void ValidateJavaVersion (string targetFrameworkVersion, string buildToolsVersion, string javaVersion, string latestSupportedJavaVersion, bool expectedResult)
public void ValidateJavaVersion (string targetFrameworkVersion, string buildToolsVersion, string javaVersion, string latestSupportedJavaVersion, bool expectedResult)
{
var path = Path.Combine ("temp", $"ValidateJavaVersion_{targetFrameworkVersion}_{buildToolsVersion}_{latestSupportedJavaVersion}_{javaVersion}");
string javaExe = "java";
Expand Down Expand Up @@ -3308,7 +3310,7 @@ public void BuildAMassiveApp()
TextContent = () => @"using System;
namespace "+ libName + @" {
public class " + libName + @" {
public static void Foo () {
}
Expand Down Expand Up @@ -3437,7 +3439,7 @@ public void Desugar ([Values (true, false)] bool isRelease, [Values ("dx", "d8")
WebContent = "http://repo.spring.io/libs-release/com/twitter/sdk/android/twitter-core/3.3.0/twitter-core-3.3.0.aar",
});
/* The source is simple:
*
*
public class Lambda
{
public void foo()
Expand Down Expand Up @@ -3797,7 +3799,7 @@ public void AssemblyWithMissingTargetFramework ()
var proj = new XamarinFormsAndroidApplicationProject {
AndroidResources = {
new AndroidItem.AndroidResource ("Resources\\layout\\test.axml") {
TextContent = () =>
TextContent = () =>
@"<?xml version=""1.0"" encoding=""utf-8""?>
<ScrollView
xmlns:android=""http://schemas.android.com/apk/res/android""
Expand All @@ -3817,7 +3819,7 @@ public void AssemblyWithMissingTargetFramework ()
FileAssert.Exists (javaStub);
}
}

[Test]
[Category ("Commercial")]
public void LibraryProjectsShouldSkipGetPrimaryCpuAbi ()
Expand Down Expand Up @@ -3891,4 +3893,3 @@ public void AbiDelimiters ([Values ("armeabi-v7a%3bx86", "armeabi-v7a,x86")] str
}
}
}

0 comments on commit 55be351

Please sign in to comment.