Skip to content

Commit d3e28de

Browse files
committed
Fix artifact names + some more test fixes
1 parent b3ae893 commit d3e28de

File tree

12 files changed

+28
-14
lines changed

12 files changed

+28
-14
lines changed

build-tools/automation/yaml-templates/run-msbuild-tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
- template: /build-tools/automation/yaml-templates/upload-results.yaml
6464
parameters:
65-
artifactName: Test Results - MSBuild - ${{ parameters.testOS }}-${{ parameters.runtimeName }}
65+
artifactName: Test Results - MSBuild - ${{ parameters.testOS }}-${{ parameters.runtimeName }}-$(System.JobPositionInPhase)
6666
xaSourcePath: ${{ parameters.xaSourcePath }}
6767
use1ESTemplate: ${{ parameters.use1ESTemplate }}
6868

build-tools/automation/yaml-templates/variables.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,5 @@ variables:
6868
value: 'cat != SystemApplication & cat != TimeZoneInfo & cat != Localization'
6969
- name: RunMAUITestJob
7070
value: true
71+
- name: CoreCLRExcludedNunitCategories
72+
value: 'cat != AOT'

src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs

+1
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ void AddEnvironment ()
342342
JniRemappingReplacementTypeCount = jniRemappingNativeCodeInfo == null ? 0 : jniRemappingNativeCodeInfo.ReplacementTypeCount,
343343
JniRemappingReplacementMethodIndexEntryCount = jniRemappingNativeCodeInfo == null ? 0 : jniRemappingNativeCodeInfo.ReplacementMethodIndexEntryCount,
344344
MarshalMethodsEnabled = EnableMarshalMethods,
345+
ManagedMarshalMethodsLookupEnabled = EnableManagedMarshalMethodsLookup,
345346
IgnoreSplitConfigs = ShouldIgnoreSplitConfigs (),
346347
};
347348
} else {

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1406,21 +1406,21 @@ public void NUnitLiteNugetWorks ()
14061406
/* enableProguard */ null,
14071407
/* androidEnableProguard */ "true",
14081408
/* expectedBuildResult */ true,
1409-
/* expectedWarning */ "0 Warning(s)",
1409+
/* expectedWarning */ TargetRuntimeHelper.UseCoreCLR && TargetRuntimeHelper.CoreClrIsExperimental ? "1 Warning(s)" : "0 Warning(s)",
14101410
},
14111411
new object [] {
14121412
/* linkTool */ "proguard",
14131413
/* enableProguard */ null,
14141414
/* androidEnableProguard */ "true",
14151415
/* expectedBuildResult */ false,
1416-
/* expectedWarning */ "0 Warning(s)",
1416+
/* expectedWarning */ TargetRuntimeHelper.UseCoreCLR && TargetRuntimeHelper.CoreClrIsExperimental ? "1 Warning(s)" : "0 Warning(s)",
14171417
},
14181418
new object [] {
14191419
/* linkTool */ null,
14201420
/* enableProguard */ null,
14211421
/* androidEnableProguard */ null,
14221422
/* expectedBuildResult */ true,
1423-
/* expectedWarning */ "0 Warning(s)",
1423+
/* expectedWarning */ TargetRuntimeHelper.UseCoreCLR && TargetRuntimeHelper.CoreClrIsExperimental ? "1 Warning(s)" : "0 Warning(s)",
14241424
},
14251425
new object [] {
14261426
/* linkTool */ null,

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,14 @@ public void BuildHasTrimmerWarnings (string properties, string [] codes, bool is
437437
var proj = new XamarinAndroidApplicationProject {
438438
IsRelease = isRelease,
439439
};
440-
if (totalWarnings != null && TargetRuntimeHelper.UseCoreCLR && TargetRuntimeHelper.CoreClrIsExperimental) {
440+
if (TargetRuntimeHelper.UseCoreCLR && TargetRuntimeHelper.CoreClrIsExperimental) {
441441
// Experimental runtimes will issue warning XA1040
442-
totalWarnings++;
443442
var newCodes = new List<string> (codes);
444443
newCodes.Add ("XA1040");
445444
codes = newCodes.ToArray ();
445+
if (totalWarnings != null) {
446+
totalWarnings++;
447+
}
446448
}
447449
proj.SetRuntimeIdentifier ("arm64-v8a");
448450
proj.MainActivity = proj.DefaultMainActivity

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public void BuildWithNativeLibraryUnknownAbi ()
456456
},
457457
}
458458
};
459-
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86");
459+
proj.SetAndroidSupportedAbis ("arm64-v8a", "x64");
460460

461461
using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) {
462462
builder.ThrowOnBuildFailure = false;

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1307,10 +1307,15 @@ public void MissingProjectReference ()
13071307
libBuilder.ThrowOnBuildFailure =
13081308
appBuilder.ThrowOnBuildFailure = false;
13091309

1310+
int expectedWarnings = 1;
1311+
if (TargetRuntimeHelper.UseCoreCLR && TargetRuntimeHelper.CoreClrIsExperimental) {
1312+
expectedWarnings++; // Warning XA1040 will be issued
1313+
}
1314+
13101315
// Build app before library is built
13111316
Assert.IsFalse (appBuilder.Build (app), "app build should have failed.");
13121317
Assert.IsTrue (StringAssertEx.ContainsText (appBuilder.LastBuildOutput, "warning MSB9008"), "Should receive MSB9008");
1313-
Assert.IsTrue (StringAssertEx.ContainsText (appBuilder.LastBuildOutput, " 1 Warning(s)"), "Should receive 1 Warning");
1318+
Assert.IsTrue (StringAssertEx.ContainsText (appBuilder.LastBuildOutput, $" {expectedWarnings} Warning(s)"), $"Should receive {expectedWarnings} Warning(s)");
13141319
Assert.IsTrue (StringAssertEx.ContainsText (appBuilder.LastBuildOutput, "error CS0246"), "Should receive CS0246");
13151320
Assert.IsTrue (StringAssertEx.ContainsText (appBuilder.LastBuildOutput, " 1 Error(s)"), "Should receive 1 Error");
13161321

@@ -1435,10 +1440,10 @@ public void AndroidAssetMissing ()
14351440
public void ChangeSupportedAbis ()
14361441
{
14371442
var proj = new XamarinFormsAndroidApplicationProject ();
1438-
proj.SetAndroidSupportedAbis ("armeabi-v7a");
1443+
proj.SetAndroidSupportedAbis ("arm64-v8a");
14391444
using (var b = CreateApkBuilder ()) {
14401445
b.Build (proj);
1441-
b.Build (proj, parameters: new [] { $"{KnownProperties.RuntimeIdentifier}=android-x86" }, doNotCleanupOnUpdate: true);
1446+
b.Build (proj, parameters: new [] { $"{KnownProperties.RuntimeIdentifier}=android-x64" }, doNotCleanupOnUpdate: true);
14421447
}
14431448
}
14441449

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ public void CheckSignApk ([Values(true, false)] bool useApkSigner, [Values(true,
415415

416416
// Make sure the APKs have unique version codes
417417
if (perAbiApk) {
418-
int armManifestCode = GetVersionCodeFromIntermediateManifest (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "armeabi-v7a", "AndroidManifest.xml"));
419-
int x86ManifestCode = GetVersionCodeFromIntermediateManifest (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "x86", "AndroidManifest.xml"));
418+
int armManifestCode = thirtyTwoBitAbisSupported ? GetVersionCodeFromIntermediateManifest (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "armeabi-v7a", "AndroidManifest.xml")) : 0;
419+
int x86ManifestCode = thirtyTwoBitAbisSupported ? GetVersionCodeFromIntermediateManifest (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "x86", "AndroidManifest.xml")) : 0;
420420
int arm64ManifestCode = GetVersionCodeFromIntermediateManifest (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "arm64-v8a", "AndroidManifest.xml"));
421421
int x86_64ManifestCode = GetVersionCodeFromIntermediateManifest (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "x86_64", "AndroidManifest.xml"));
422422
List<int> versionList;

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Utilities/TargetRuntimeHelper.cs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ static TargetRuntimeHelper ()
3232
public static bool UseMonoRuntime => useMonoRuntime;
3333
public static bool UseCoreCLR => !useMonoRuntime;
3434
public static string[] CoreClrSupportedAbis => coreClrSupportedAbis;
35+
public string RuntimeName => UseMonoRuntime ? "MonoVM" : "CoreCLR";
3536

3637
public static bool CoreClrSupportsAbi (string abiName) => coreClrAbis.Contains (abiName);
3738

src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfig.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Xamarin.Android.Tasks
44
{
55
// Declaration order of fields and their types must correspond *exactly* to that in
6-
// src/native/xamarin-app-stub/xamarin-app.hh ApplicationConfig structure
6+
// src/native/mono/xamarin-app-stub/xamarin-app.hh ApplicationConfig structure
77
//
88
// Type mappings:
99
//

src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfigCLR.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Xamarin.Android.Tasks;
44

55
// Declaration order of fields and their types must correspond *exactly* to that in
6-
// src/native/clr/xamarin-app-stub/xamarin-app.hh ApplicationConfig structure
6+
// src/native/clr/include/xamarin-app.hh ApplicationConfig structure
77
//
88
// Type mappings:
99
//
@@ -49,4 +49,5 @@ sealed class ApplicationConfigCLR
4949
public uint jni_remapping_replacement_type_count;
5050
public uint jni_remapping_replacement_method_index_entry_count;
5151
public string android_package_name = String.Empty;
52+
public bool managed_marshal_methods_lookup_enabled;
5253
}

src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfigNativeAssemblyGeneratorCLR.cs

+2
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ sealed class XamarinAndroidBundledAssembly
207207
public PackageNamingPolicy PackageNamingPolicy { get; set; }
208208
public List<ITaskItem> NativeLibraries { get; set; }
209209
public bool MarshalMethodsEnabled { get; set; }
210+
public bool ManagedMarshalMethodsLookupEnabled { get; set; }
210211
public bool IgnoreSplitConfigs { get; set; }
211212

212213
public ApplicationConfigNativeAssemblyGeneratorCLR (IDictionary<string, string> environmentVariables, IDictionary<string, string> systemProperties,
@@ -256,6 +257,7 @@ protected override void Construct (LlvmIrModule module)
256257
uses_assembly_preload = UsesAssemblyPreload,
257258
jni_add_native_method_registration_attribute_present = JniAddNativeMethodRegistrationAttributePresent,
258259
marshal_methods_enabled = MarshalMethodsEnabled,
260+
managed_marshal_methods_lookup_enabled = ManagedMarshalMethodsLookupEnabled,
259261
ignore_split_configs = IgnoreSplitConfigs,
260262
number_of_runtime_properties = (uint)(runtimeProperties == null ? 0 : runtimeProperties.Count),
261263
package_naming_policy = (uint)PackageNamingPolicy,

0 commit comments

Comments
 (0)