[Xamarin.Android.Build.Tasks] XA1039 error for Android.Support (#8629)
Context:c92702619f
Context:68368189d6
Context:929e701241
Context: https://github.com/xamarin/xamarin-android/pull/8478 Context: https://github.com/xamarin/xamarin-android/issues/8155 Context: https://github.com/xamarin/xamarin-android/issues/8168 Our build process has a bit of a "consistent sanity" problem: large portions of the build process assume that the output of a `.csproj` is a single assembly, and that single assembly is (eventually) embedded into the `.apk`, to be loaded at runtime. Unfortunately, that wasn't strictly true starting with .NET 5: there were *multiple* `System.Private.CoreLib.dll` assemblies, which needed to be treated specially; see alsoc9270261
. We discovered that this assumption was even *less* true because of the linker, which would quite happily *replace* `IntPtr.get_Size()` method invocations with a *constant*, specific for the target ABI; see also68368189
,929e7012
. This in turn could be responsible for all sorts of weirdness if e.g. a 64-bit assembly were used in a 32-bit process, or vice versa. Which brings us to the original assumption: there is (usually) only one "source" assembly, which is (optionally) linked into one "linked" assembly, which is packaged into one assembly in the `.apk`. With the linker, though, we can have one "source" assembly, which when linked becomes *N* assemblies, which *should be* separately packaged as per-ABI assemblies within the `.apk`, but *probably aren't*, which we *think* is the "root cause" of #8155. PR #8478 is attempting fix this assumption, imbuing the build system with knowledge that the linker may produce *multiple outputs* for a single input assembly. Unfortunately, in trying to fix things, various intermediate assembly locations have *changed*, which in turn breaks [AndroidX Migration in Xamarin.Forms][0], as it makes assumptions about where various assemblies are located within `obj`: (_AndroidXCecilfy target) -> /Users/runner/.nuget/packages/xamarin.androidx.migration/1.0.8/buildTransitive/monoandroid90/Xamarin.AndroidX.Migration.targets(227,9): error : Source assembly does not exist: 'obj/Debug/android/assets/UnnamedProject.dll'. as [`@(_AndroidXFileToCecilfy)`][1] uses `$(MonoAndroidIntermediateAssetsDir)`, which does not account for the ABI which is now in the path: <ItemGroup> <_AndroidXFileToCecilfy Include="@(ResolvedUserAssemblies->'$(MonoAndroidIntermediateAssetsDir)%(Filename)%(Extension)')" Condition="('%(ResolvedUserAssemblies.TargetFrameworkIdentifier)' == 'MonoAndroid' or '%(ResolvedUserAssemblies.HasMonoAndroidReference)' == 'true') and ('%(ResolvedUserAssemblies.AndroidXSkipAndroidXMigration)' != 'true')" /> </ItemGroup> Given that AndroidX Migration is mostly for Xamarin.Forms customers (and *kinda* buggy, and unmaintained), and MAUI doesn't support the Android Support libraries, and thus doesn't need AndroidX Migration, we'd like to just *not worry about this*. The problem? The above error message is not actionable, and doesn't tell anybody how to fix it. Introduce a new `XA1039` *actionable* error in .NET 9: error XA1039: The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details. The XA1039 error is generated if any NuGet packages are found matching: * `Xamarin.Android.Support.*` * `Xamarin.Android.Arch.*` TODO: "port" XA1039 to .NET 8 *as a warning*, so that customers will have some time to migrate off of the Android Support libraries before .NET 9 is released in 2024-Nov. --<AndroidError Code="XA1039" ++<AndroidWarning Code="XA1039" ResourceName="XA1039" Condition=" '@(_AndroidUnsupportedPackages->Count())' != '0' " /> The biggest impact here is going to be many of our old tests, which use the support libraries in various forms. Improvements & general cleanup: * Removed all old/unused packages in `KnownPackages.cs` * Updated `KnownPackages.cs` to latest versions, including Xamarin.Forms * [Android Wear tests are now migrated from support to AndroidX][2] * `AndroidUpdateResourcesTest.CheckEmbeddedSupportLibraryResources()` is renamed to `.CheckEmbeddedAndroidXResources()`. * `BuildTest2.BuildHasNoWarnings()` was not appropriately applying `IsRelease`. * `Android.Support.v8.RenderScript` removed in favor of an inline `.so` file. * A few tests that used support libraries to create a project large numbers of dependencies, moved to `XamarinFormsAndroidApplicationProject`. * `IncrementalBuildTest.ResolveLibraryProjectImports()` now sorts items before comparing them. * `XamarinFormsAndroidApplicationProject` has a workaround for Guava: <https://github.com/xamarin/AndroidX/issues/535> * Fix a bug in `AndroidFastDeploymentType=Assemblies::Dexes`; see "AndroidFastDeploymentType=Assemblies::Dexes" section, below. Removed tests: * `AndroidXMigration`, `AndroidXMigrationBug` * `ResolveLibraryImportsWithReadonlyFiles`, seemed duplicate of other Android Wear tests, and used support libraries. * `ExtraAaptManifest` as it depends on `Xamarin.Android.Fabric` and `Xamarin.Android.Crashlytics`. These are deprecated and depend on support libraries. * `BuildProguardEnabledProjectSource` now only tests `Release` mode. Since updating to AndroidX, `Debug` mode was triggering multi-dex. Making it difficult to assert contents of `*.dex` files. ~~ AndroidFastDeploymentType=Assemblies::Dexes ~~ The runtime test in `ApplicationRunsWithDebuggerAndBreaks()` was crashing at runtime with: E monodroid-assembly: typemap: failed to stat TypeMap index file '/data/user/0/com.xamarin.applicationrunswithdebuggerandbreaks/files/.__override__/typemaps/typemap.index': No such file or directory F monodroid-assembly: typemap: unable to load TypeMap data index from '/data/user/0/com.xamarin.applicationrunswithdebuggerandbreaks/files/.__override__/typemaps/typemap.index' This only happens when `AndroidFastDeploymentType=Assemblies::Dexes` is used, as it is the case when typemap files like this are fast deployed and used at runtime. What was even more odd, was the file seems to exist after a `-t:Install`, but ends up missing after `-t:Run`: > adb shell run-as com.xamarin.applicationrunswithdebuggerandbreaks ls -la files/.__override__/typemaps/typemap.index ls: files/.__override__/typemaps/typemap.index: No such file or directory It appears that `-t:Install` successfully deploys the file: Pushed 3969 to /data/local/tmp/.xatools/typemap.index DEBUG RunShellCommand emulator-5554 "run-as" "com.xamarin.applicationrunswithdebuggerandbreaks" "--user" "0" "files/.__tools__/xamarin.cp" "/data/local/tmp/.xatools/typemap.index" "files/.__override__/typemaps/typemap.index" "1705432079367" [5ms] files/.__tools__/xamarin.cp returned: moved [/data/local/tmp/.xatools/typemap.index] to [files/.__override__/typemaps/typemap.index] modifieddate [1705432079367] moved /data/local/tmp/.xatools/typemap.index to files/.__override__/typemaps/typemap.index Installed files/.__override__/typemaps/typemap.index. [12ms] NotifySync CopyFile obj\Debug\android\typemaps\typemap.index. [0ms] But then `-t:Run` deletes the file! Remove redundant file files/.__override__/typemaps/typemap.index DEBUG RunShellCommand 0A041FDD400327 "run-as" "com.xamarin.applicationrunswithdebuggerandbreaks" "rm" "-Rf" "files/.__override__/typemaps/typemap.index" [29ms] This happens because the `@(_AndroidTypeMapping)` item group is empty during an incremental build: * The `<GenerateJavaStubs/>` MSBuild task, during the first build outputs `@(_AndroidTypeMapping)` items * During an incremental build, the `_GenerateJavaStubs` MSBuild *target* is skipped, and so the `@(_AndroidTypeMapping)` item group is empty! * The `<FastDeploy/>` task happily deletes files that it thinks should be removed. For now, let's add logic to the `_GenerateJavaStubs` target to fill in the `@(_AndroidTypeMapping)` item group during incremental builds: <ItemGroup Condition=" '$(_InstantRunEnabled)' == 'True' and '@(_AndroidTypeMapping->Count())' == '0' "> <_AndroidTypeMapping Include="$(_NativeAssemblySourceDir)typemaps\*" /> </ItemGroup> `<ItemGroup>`s are still evaluated when a target is *skipped*, solving the problem. I assume this is working in `main`, because Xamarin.AndroidX.Migration package was involved. It likely was running the `_GenerateJavaStubs` target on every build. [0]: https://learn.microsoft.com/xamarin/xamarin-forms/platform/android/androidx-migration [1]:17e596fafe/source/migration/BuildTasks/Xamarin.AndroidX.Migration.targets (L205-L206)
[2]: https://android-developers.googleblog.com/2016/04/build-beautifully-for-android-wear.html
This commit is contained in:
Родитель
d538d7b37f
Коммит
2f192386e8
|
@ -0,0 +1,47 @@
|
|||
---
|
||||
title: Xamarin.Android error XA1039
|
||||
description: XA1039 error code
|
||||
ms.date: 1/10/2024
|
||||
---
|
||||
# Xamarin.Android error XA1039
|
||||
|
||||
## Example messages
|
||||
|
||||
```
|
||||
error XA1039: The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details.
|
||||
```
|
||||
|
||||
## Issue
|
||||
|
||||
Outdated "Android Support Library" packages are no longer supported in .NET 9:
|
||||
|
||||
* `Xamarin.Android.Arch.*`
|
||||
* `Xamarin.Android.Support.*`
|
||||
|
||||
The underlying Java libraries are no longer supported by Google since the final
|
||||
28.0.0 release. See the [Android Support Library Documentation][support] for
|
||||
details.
|
||||
|
||||
Some example prefixes of the newer, supported AndroidX packages are:
|
||||
|
||||
* `Xamarin.AndroidX.*`
|
||||
* `Xamarin.AndroidX.Arch.*`
|
||||
|
||||
For more information about the Android Support libraries or AndroidX, see:
|
||||
|
||||
* [Android Support Library Documentation][support]
|
||||
* [AndroidX Documentation](https://developer.android.com/jetpack/androidx)
|
||||
|
||||
[support]: https://developer.android.com/topic/libraries/support-library/packages
|
||||
|
||||
## Solution
|
||||
|
||||
Remove all NuGet package references to `Xamarin.Android.Support` or
|
||||
`Xamarin.Android.Arch` in favor of the new AndroidX equivalents.
|
||||
|
||||
This also can occur if you are using a NuGet package with a transitive
|
||||
dependency on the Android support packages. In this case, you will need to
|
||||
remove the package or contact the package author.
|
||||
|
||||
See the [AndroidX migration documentation](https://aka.ms/xamarin/androidx) for
|
||||
details.
|
|
@ -1006,4 +1006,8 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS
|
|||
{0} - The deprecated MSBuild property name
|
||||
{1} - The numeric version of .NET</comment>
|
||||
</data>
|
||||
<data name="XA1039" xml:space="preserve">
|
||||
<value>The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details.</value>
|
||||
<comment>The following are literal names and should not be translated: Android Support, AndroidX, .NET.</comment>
|
||||
</data>
|
||||
</root>
|
|
@ -138,23 +138,17 @@ namespace Xamarin.Android.Build.Tests
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void CheckEmbeddedSupportLibraryResources ()
|
||||
public void CheckEmbeddedAndroidXResources ()
|
||||
{
|
||||
var proj = new XamarinAndroidApplicationProject () {
|
||||
IsRelease = true,
|
||||
PackageReferences = {
|
||||
KnownPackages.SupportMediaCompat_27_0_2_1,
|
||||
KnownPackages.SupportFragment_27_0_2_1,
|
||||
KnownPackages.SupportCoreUtils_27_0_2_1,
|
||||
KnownPackages.SupportCoreUI_27_0_2_1,
|
||||
KnownPackages.SupportCompat_27_0_2_1,
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportV7AppCompat_27_0_2_1,
|
||||
KnownPackages.AndroidXAppCompat,
|
||||
},
|
||||
};
|
||||
using (var b = CreateApkBuilder ()) {
|
||||
Assert.IsTrue (b.Build (proj), "First build should have succeeded.");
|
||||
var Rdrawable = b.Output.GetIntermediaryPath (Path.Combine ("android", "bin", "classes", "android", "support", "v7", "appcompat", "R$drawable.class"));
|
||||
var Rdrawable = b.Output.GetIntermediaryPath (Path.Combine ("android", "bin", "classes", "androidx", "appcompat", "R$drawable.class"));
|
||||
Assert.IsTrue (File.Exists (Rdrawable), $"{Rdrawable} should exist");
|
||||
}
|
||||
}
|
||||
|
@ -410,8 +404,7 @@ namespace UnnamedProject
|
|||
}
|
||||
}"
|
||||
});
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidSupportV4_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportV7AppCompat_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
|
||||
using (var libb = CreateDllBuilder (Path.Combine (projectPath, lib.ProjectName), cleanupOnDispose: false))
|
||||
using (var b = CreateApkBuilder (Path.Combine (projectPath, proj.ProjectName), cleanupOnDispose: false)) {
|
||||
Assert.IsTrue (libb.Build (lib), "Library Build should have succeeded.");
|
||||
|
@ -831,10 +824,6 @@ namespace Lib1 {
|
|||
</resources>",
|
||||
}
|
||||
},
|
||||
PackageReferences = {
|
||||
KnownPackages.SupportV7AppCompat_27_0_2_1,
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
},
|
||||
};
|
||||
using (var builder = CreateApkBuilder ()) {
|
||||
Assert.IsTrue (builder.Build (proj), "Build should have succeeded");
|
||||
|
@ -1033,13 +1022,7 @@ namespace Lib1 {
|
|||
new BuildItem.ProjectReference (@"..\Lib1\Lib1.csproj", libProj.ProjectName, libProj.ProjectGuid),
|
||||
},
|
||||
PackageReferences = {
|
||||
KnownPackages.SupportMediaCompat_27_0_2_1,
|
||||
KnownPackages.SupportFragment_27_0_2_1,
|
||||
KnownPackages.SupportCoreUtils_27_0_2_1,
|
||||
KnownPackages.SupportCoreUI_27_0_2_1,
|
||||
KnownPackages.SupportCompat_27_0_2_1,
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportV7AppCompat_27_0_2_1,
|
||||
KnownPackages.AndroidXAppCompat,
|
||||
},
|
||||
};
|
||||
appProj.SetProperty ("AndroidUseManagedDesignTimeResourceGenerator", "True");
|
||||
|
@ -1224,20 +1207,7 @@ namespace UnnamedProject
|
|||
{
|
||||
var proj = new XamarinAndroidApplicationProject ();
|
||||
proj.LayoutMain = proj.LayoutMain.Replace ("</LinearLayout>", "<android.support.design.widget.BottomNavigationView android:id=\"@+id/navigation\" /></LinearLayout>");
|
||||
proj.PackageReferences.Add (KnownPackages.Android_Arch_Core_Common_26_1_0);
|
||||
proj.PackageReferences.Add (KnownPackages.Android_Arch_Lifecycle_Common_26_1_0);
|
||||
proj.PackageReferences.Add (KnownPackages.Android_Arch_Lifecycle_Runtime_26_1_0);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidSupportV4_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportCompat_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportCoreUI_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportCoreUtils_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportDesign_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportFragment_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportMediaCompat_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportV7AppCompat_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportV7CardView_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportV7MediaRouter_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportV7RecyclerView_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
|
||||
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
|
||||
Assert.IsTrue (b.Build (proj), "first build should have succeeded");
|
||||
|
||||
|
@ -1257,7 +1227,7 @@ namespace UnnamedProject
|
|||
var r_java = Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "android", "src", proj.PackageNameJavaIntermediatePath, "R.java");
|
||||
FileAssert.Exists (r_java);
|
||||
var r_java_contents = File.ReadAllLines (r_java);
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (r_java_contents, textView1), $"android/support/compat/R.java should contain `{textView1}`!");
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (r_java_contents, textView1), $"{r_java} should contain `{textView1}`!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,6 @@ namespace Xamarin.Android.Build.Tests
|
|||
var proj = new XamarinAndroidBindingProject () {
|
||||
IsRelease = true,
|
||||
};
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidSupportV4_27_0_2_1);
|
||||
proj.Jars.Add (new AndroidItem.LibraryProjectZip ("Jars\\android-crop-1.0.1.aar") {
|
||||
WebContent = "https://repo1.maven.org/maven2/com/soundcloud/android/android-crop/1.0.1/android-crop-1.0.1.aar"
|
||||
});
|
||||
|
@ -187,13 +186,12 @@ namespace Xamarin.Android.Build.Tests
|
|||
[Test]
|
||||
[TestCaseSource (nameof (ClassParseOptions))]
|
||||
[NonParallelizable]
|
||||
public void BuildLibraryZipBindigLibraryWithAarOfJar (string classParser)
|
||||
public void BuildLibraryZipBindingLibraryWithAarOfJar (string classParser)
|
||||
{
|
||||
var proj = new XamarinAndroidBindingProject () {
|
||||
IsRelease = true,
|
||||
};
|
||||
proj.AndroidClassParser = classParser;
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidSupportV4_27_0_2_1);
|
||||
proj.Jars.Add (new AndroidItem.LibraryProjectZip ("Jars\\aFileChooserBinaries.zip") {
|
||||
WebContentFileNameFromAzure = "aFileChooserBinaries.zip"
|
||||
});
|
||||
|
@ -202,41 +200,6 @@ namespace Xamarin.Android.Build.Tests
|
|||
<attr path=""/api/package[@name='com.ipaulpro.afilechooser']/class[@name='FileListAdapter']/method[@name='getItem' and count(parameter)=1 and parameter[1][@type='int']]"" name=""managedReturn"">Java.Lang.Object</attr>
|
||||
<attr path=""/api/package[@name='com.ipaulpro.afilechooser']/class[@name='FileLoader']/method[@name='loadInBackground' and count(parameter)=0]"" name=""managedName"">LoadInBackgroundImpl</attr>
|
||||
</metadata>";
|
||||
proj.Sources.Add (new BuildItem (BuildActions.Compile, "Fixup.cs") {
|
||||
TextContent = () => @"using System;
|
||||
using System.Collections.Generic;
|
||||
using Android.App;
|
||||
using Android.Runtime;
|
||||
|
||||
namespace Com.Ipaulpro.Afilechooser {
|
||||
[Activity (Name = ""com.ipaulpro.afilechooser.FileChooserActivity"",
|
||||
Icon = ""@drawable/ic_chooser"",
|
||||
Exported = true)]
|
||||
[IntentFilter (new string [] {""android.intent.action.GET_CONTENT""},
|
||||
Categories = new string [] {
|
||||
""android.intent.category.DEFAULT"",
|
||||
//""android.intent.category.OPENABLE""
|
||||
},
|
||||
DataMimeType = ""*/*"")]
|
||||
public partial class FileChooserActivity
|
||||
{
|
||||
}
|
||||
|
||||
public partial class FileListFragment : global::Android.Support.V4.App.ListFragment, global::Android.Support.V4.App.LoaderManager.ILoaderCallbacks {
|
||||
|
||||
public void OnLoadFinished (global::Android.Support.V4.Content.Loader p0, Java.Lang.Object p1)
|
||||
{
|
||||
OnLoadFinished (p0, (IList<Java.IO.File>) new JavaList<Java.IO.File> (p1.Handle, JniHandleOwnership.DoNotTransfer));
|
||||
}
|
||||
}
|
||||
public partial class FileLoader : Android.Support.V4.Content.AsyncTaskLoader {
|
||||
public override Java.Lang.Object LoadInBackground ()
|
||||
{
|
||||
return (Java.Lang.Object) LoadInBackgroundImpl ();
|
||||
}
|
||||
}
|
||||
}"
|
||||
});
|
||||
using (var b = CreateDllBuilder ()) {
|
||||
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
|
||||
}
|
||||
|
@ -467,7 +430,6 @@ namespace Foo {
|
|||
<attr path=""/api/package[@name='com.actionbarsherlock.view']"" name=""managedName"">Xamarin.ActionbarSherlockBinding.Views</attr>
|
||||
</metadata>",
|
||||
};
|
||||
binding.PackageReferences.Add (KnownPackages.AndroidSupportV4_27_0_2_1);
|
||||
using (var bindingBuilder = CreateDllBuilder (Path.Combine ("temp", "RemoveEventHandlerResolution", "Binding"))) {
|
||||
Assert.IsTrue (bindingBuilder.Build (binding), "binding build should have succeeded");
|
||||
}
|
||||
|
|
|
@ -243,17 +243,9 @@ namespace Xamarin.Android.Build.Tests
|
|||
EmbedAssembliesIntoApk = true,
|
||||
AotAssemblies = aot,
|
||||
};
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXMigration);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompatResources);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXBrowser);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXMediaRouter);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXLegacySupportV4);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXLifecycleLiveData);
|
||||
proj.PackageReferences.Add (KnownPackages.XamarinGoogleAndroidMaterial);
|
||||
|
||||
var abis = new [] { "armeabi-v7a", "x86" };
|
||||
proj.SetAndroidSupportedAbis (abis);
|
||||
proj.SetRuntimeIdentifiers (abis);
|
||||
proj.SetProperty (proj.ActiveConfigurationProperties, "AndroidUseAssemblyStore", "True");
|
||||
|
||||
using (var b = CreateApkBuilder ()) {
|
||||
|
@ -292,10 +284,6 @@ namespace Xamarin.Android.Build.Tests
|
|||
proj.IsRelease = true;
|
||||
proj.AotAssemblies = aot;
|
||||
|
||||
if (forms) {
|
||||
proj.PackageReferences.Clear ();
|
||||
proj.PackageReferences.Add (KnownPackages.XamarinForms_4_7_0_1142);
|
||||
}
|
||||
using (var builder = CreateApkBuilder (Path.Combine (rootPath, proj.ProjectName))){
|
||||
Assert.IsTrue (builder.Build (proj), "Build should have succeeded.");
|
||||
}
|
||||
|
@ -450,19 +438,14 @@ namespace Xamarin.Android.Build.Tests
|
|||
public void ExtraAaptManifest ()
|
||||
{
|
||||
var proj = new XamarinAndroidApplicationProject ();
|
||||
proj.MainActivity = proj.DefaultMainActivity.Replace ("base.OnCreate (bundle);", "base.OnCreate (bundle);\nCrashlytics.Crashlytics.HandleManagedExceptions();");
|
||||
proj.PackageReferences.Add (KnownPackages.Xamarin_Android_Crashlytics);
|
||||
proj.PackageReferences.Add (KnownPackages.Xamarin_Android_Fabric);
|
||||
proj.MainActivity = proj.DefaultMainActivity.Replace ("base.OnCreate (bundle);", "base.OnCreate (bundle);\nFirebase.Crashlytics.FirebaseCrashlytics.Instance.SendUnsentReports();");
|
||||
proj.PackageReferences.Add (new Package { Id = "Xamarin.Firebase.Crashlytics", Version = "118.5.1.1" });
|
||||
proj.PackageReferences.Add (KnownPackages.Xamarin_Build_Download);
|
||||
using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) {
|
||||
builder.Target = "Restore";
|
||||
Assert.IsTrue (builder.Build (proj), "Restore should have succeeded.");
|
||||
builder.Target = "Build";
|
||||
Assert.IsTrue (builder.Build (proj), "Build should have succeeded.");
|
||||
var manifest = File.ReadAllText (Path.Combine (Root, builder.ProjectDirectory, "obj", "Debug", "android", "AndroidManifest.xml"));
|
||||
Assert.IsTrue (manifest.Contains ($"android:authorities=\"{proj.PackageName}.crashlyticsinitprovider\""), "placeholder not replaced");
|
||||
Assert.IsFalse (manifest.Contains ("dollar_openBracket_applicationId_closeBracket"), "`aapt/AndroidManifest.xml` not ignored");
|
||||
}
|
||||
using var builder = CreateApkBuilder ();
|
||||
Assert.IsTrue (builder.Build (proj), "Build should have succeeded.");
|
||||
var manifest = File.ReadAllText (Path.Combine (Root, builder.ProjectDirectory, "obj", "Debug", "android", "AndroidManifest.xml"));
|
||||
Assert.IsTrue (manifest.Contains ($"android:authorities=\"{proj.PackageName}.firebaseinitprovider\""), "placeholder not replaced");
|
||||
Assert.IsFalse (manifest.Contains ("dollar_openBracket_applicationId_closeBracket"), "`aapt/AndroidManifest.xml` not ignored");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -714,7 +697,10 @@ AAMMAAABzYW1wbGUvSGVsbG8uY2xhc3NQSwUGAAAAAAMAAwC9AAAA1gEAAAAA") });
|
|||
var proj = new XamarinAndroidApplicationProject ();
|
||||
proj.MainActivity = proj.DefaultMainActivity.Replace ("public class MainActivity : Activity", "public class MainActivity : AndroidX.AppCompat.App.AppCompatActivity");
|
||||
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
|
||||
proj.PackageReferences.Add (new Package {
|
||||
Id = "Xamarin.AndroidX.AppCompat",
|
||||
Version = "1.6.1.5",
|
||||
});
|
||||
|
||||
using (var b = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
|
||||
//[TearDown] will still delete if test outcome successful, I need logs if assertions fail but build passes
|
||||
|
@ -732,8 +718,8 @@ AAMMAAABzYW1wbGUvSGVsbG8uY2xhc3NQSwUGAAAAAAMAAwC9AAAA1gEAAAAA") });
|
|||
FileAssert.Exists (build_props, "build.props should exist after first build.");
|
||||
|
||||
proj.PackageReferences.Clear ();
|
||||
//NOTE: we can get all the other dependencies transitively, yay!
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat_1_6_0_1);
|
||||
//NOTE: this should be newer than specified above
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
|
||||
b.Save (proj, doNotCleanupOnUpdate: true);
|
||||
Assert.IsTrue (b.Build (proj), "second build should have succeeded.");
|
||||
Assert.IsFalse (b.Output.IsTargetSkipped ("_CleanIntermediateIfNeeded"), "`_CleanIntermediateIfNeeded` should have run for the second build!");
|
||||
|
@ -1165,6 +1151,7 @@ public class MyWorker : Worker
|
|||
"
|
||||
});
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXWorkRuntime);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXLifecycleLiveData);
|
||||
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
|
||||
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
|
||||
}
|
||||
|
@ -1436,12 +1423,7 @@ namespace UnnamedProject
|
|||
{
|
||||
string disabledIssues = "StaticFieldLeak,ObsoleteSdkInt,AllowBackup,ExportedReceiver,RedundantLabel";
|
||||
|
||||
var proj = new XamarinAndroidApplicationProject () {
|
||||
PackageReferences = {
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportConstraintLayout_1_0_2_2,
|
||||
},
|
||||
};
|
||||
var proj = new XamarinAndroidApplicationProject ();
|
||||
proj.SetProperty ("AndroidLintEnabled", true.ToString ());
|
||||
proj.SetProperty ("AndroidLintDisabledIssues", disabledIssues);
|
||||
proj.SetProperty ("AndroidLintEnabledIssues", "");
|
||||
|
@ -1458,14 +1440,12 @@ namespace UnnamedProject
|
|||
TextContent = () => {
|
||||
return @"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<ConstraintLayout xmlns:android=""http://schemas.android.com/apk/res/android""
|
||||
xmlns:app=""http://schemas.android.com/apk/res-auto""
|
||||
android:orientation=""vertical""
|
||||
android:layout_width=""fill_parent""
|
||||
android:layout_height=""fill_parent"">
|
||||
<TextView android:id=""@+id/foo""
|
||||
android:layout_width=""150dp""
|
||||
android:layout_height=""wrap_content""
|
||||
app:layout_constraintTop_toTopOf=""parent""
|
||||
/>
|
||||
</ConstraintLayout>";
|
||||
}
|
||||
|
@ -1621,25 +1601,18 @@ public class ToolbarEx {
|
|||
[Test]
|
||||
public void CheckLintResourceFileReferencesAreFixed ()
|
||||
{
|
||||
var proj = new XamarinAndroidApplicationProject () {
|
||||
PackageReferences = {
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportConstraintLayout_1_0_2_2,
|
||||
},
|
||||
};
|
||||
var proj = new XamarinAndroidApplicationProject ();
|
||||
proj.SetProperty ("AndroidLintEnabled", true.ToString ());
|
||||
proj.AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\layout\\test.axml") {
|
||||
TextContent = () => {
|
||||
return @"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<ConstraintLayout xmlns:android=""http://schemas.android.com/apk/res/android""
|
||||
xmlns:app=""http://schemas.android.com/apk/res-auto""
|
||||
android:orientation=""vertical""
|
||||
android:layout_width=""fill_parent""
|
||||
android:layout_height=""fill_parent"">
|
||||
<TextView android:id=""@+id/foo""
|
||||
android:layout_width=""150dp""
|
||||
android:layout_height=""wrap_content""
|
||||
app:layout_constraintTop_toTopOf=""parent""
|
||||
/>
|
||||
<EditText
|
||||
android:id=""@+id/phone""
|
||||
|
|
|
@ -147,11 +147,6 @@ namespace Xamarin.Android.Build.Tests
|
|||
proj.SetProperty ("LinkerDumpDependencies", "True");
|
||||
proj.SetProperty ("AndroidUseAssemblyStore", "False");
|
||||
|
||||
if (forms) {
|
||||
proj.PackageReferences.Clear ();
|
||||
proj.PackageReferences.Add (KnownPackages.XamarinForms_5_0_0_2515);
|
||||
}
|
||||
|
||||
byte [] apkDescData;
|
||||
var flavor = (forms ? "XForms" : "Simple") + "DotNet";
|
||||
var apkDescFilename = $"BuildReleaseArm64{flavor}.apkdesc";
|
||||
|
@ -236,6 +231,7 @@ namespace Xamarin.Android.Build.Tests
|
|||
var proj = xamarinForms ?
|
||||
new XamarinFormsAndroidApplicationProject () :
|
||||
new XamarinAndroidApplicationProject ();
|
||||
proj.IsRelease = isRelease;
|
||||
if (multidex) {
|
||||
proj.SetProperty ("AndroidEnableMultiDex", "True");
|
||||
}
|
||||
|
@ -244,7 +240,9 @@ namespace Xamarin.Android.Build.Tests
|
|||
// XA0119: Using Fast Deployment and Android App Bundles at the same time is not recommended.
|
||||
proj.EmbedAssembliesIntoApk = true;
|
||||
}
|
||||
proj.PackageReferences.Add (new Package { Id = "BenchmarkDotNet", Version = "0.13.1" });
|
||||
// FIXME: Precompiling failed for TraceReloggerLib.dll, Dia2Lib.dll with exit code 1
|
||||
if (!isRelease)
|
||||
proj.PackageReferences.Add (new Package { Id = "BenchmarkDotNet", Version = "0.13.1" });
|
||||
proj.SetProperty ("XamarinAndroidSupportSkipVerifyVersions", "True"); // Disables API 29 warning in Xamarin.Build.Download
|
||||
proj.SetProperty ("AndroidPackageFormat", packageFormat);
|
||||
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
|
||||
|
@ -353,71 +351,21 @@ class MemTest {
|
|||
{
|
||||
var proj = new XamarinAndroidApplicationProject ();
|
||||
var packages = proj.PackageReferences;
|
||||
packages.Add (KnownPackages.SupportV7AppCompat_27_0_2_1);
|
||||
proj.MainActivity = proj.DefaultMainActivity.Replace ("public class MainActivity : Activity", "public class MainActivity : Android.Support.V7.App.AppCompatActivity");
|
||||
packages.Add (KnownPackages.AndroidXAppCompat);
|
||||
proj.MainActivity = proj.DefaultMainActivity.Replace ("public class MainActivity : Activity", "public class MainActivity : AndroidX.AppCompat.App.AppCompatActivity");
|
||||
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
|
||||
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
[NonParallelizable]
|
||||
public void AndroidXMigration ([Values (true, false)] bool isRelease)
|
||||
{
|
||||
var proj = new XamarinFormsAndroidApplicationProject {
|
||||
IsRelease = isRelease,
|
||||
};
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXMigration);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompatResources);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXBrowser);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXMediaRouter);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXLegacySupportV4);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXLifecycleLiveData);
|
||||
proj.PackageReferences.Add (KnownPackages.XamarinGoogleAndroidMaterial);
|
||||
|
||||
using (var b = CreateApkBuilder ()) {
|
||||
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
|
||||
var dexFile = b.Output.GetIntermediaryPath (Path.Combine ("android", "bin", "classes.dex"));
|
||||
FileAssert.Exists (dexFile);
|
||||
// classes.dex should only have the androidx Java types
|
||||
var className = "Landroidx/appcompat/app/AppCompatActivity;";
|
||||
Assert.IsTrue (DexUtils.ContainsClass (className, dexFile, AndroidSdkPath), $"`{dexFile}` should include `{className}`!");
|
||||
className = "Landroid/appcompat/app/AppCompatActivity;";
|
||||
Assert.IsFalse (DexUtils.ContainsClass (className, dexFile, AndroidSdkPath), $"`{dexFile}` should *not* include `{className}`!");
|
||||
// FormsAppCompatActivity should inherit the AndroidX C# type
|
||||
var forms = GetLinkedPath (b, isRelease, "Xamarin.Forms.Platform.Android.dll");
|
||||
using (var assembly = AssemblyDefinition.ReadAssembly (forms)) {
|
||||
var activity = assembly.MainModule.GetType ("Xamarin.Forms.Platform.Android.FormsAppCompatActivity");
|
||||
Assert.AreEqual ("AndroidX.AppCompat.App.AppCompatActivity", activity.BaseType.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DuplicateRJavaOutput ()
|
||||
{
|
||||
var proj = new XamarinAndroidApplicationProject {
|
||||
PackageReferences = {
|
||||
new Package { Id = "Xamarin.Android.Support.Annotations", Version = "28.0.0.3" },
|
||||
new Package { Id = "Xamarin.Android.Support.Compat", Version = "28.0.0.3" },
|
||||
new Package { Id = "Xamarin.Android.Support.Core.UI", Version = "28.0.0.3" },
|
||||
new Package { Id = "Xamarin.Android.Support.Core.Utils", Version = "28.0.0.3" },
|
||||
new Package { Id = "Xamarin.Android.Support.Design", Version = "28.0.0.3" },
|
||||
new Package { Id = "Xamarin.Android.Support.Fragment", Version = "28.0.0.3" },
|
||||
new Package { Id = "Xamarin.Android.Support.VersionedParcelable", Version = "28.0.0.3" },
|
||||
new Package { Id = "Xamarin.Android.Support.v4", Version = "28.0.0.3" },
|
||||
new Package { Id = "Xamarin.Build.Download", Version = "0.7.1" },
|
||||
new Package { Id = "Xamarin.Essentials", Version = "1.3.1" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Ads.Identifier", Version = "71.1600.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Base", Version = "71.1610.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Basement", Version = "71.1620.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Clearcut", Version = "71.1600.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Measurement.Api", Version = "71.1630.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Measurement.Base", Version = "71.1630.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Phenotype", Version = "71.1600.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Stats", Version = "71.1601.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Tasks", Version = "71.1601.0" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Base", Version = "118.2.0.5" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Basement", Version = "118.2.0.5" },
|
||||
new Package { Id = "Xamarin.GooglePlayServices.Tasks", Version = "118.0.2.6" },
|
||||
}
|
||||
};
|
||||
using (var b = CreateApkBuilder ()) {
|
||||
|
@ -983,35 +931,25 @@ namespace UnamedProject
|
|||
|
||||
static readonly object [] BuildProguardEnabledProjectSource = new object [] {
|
||||
new object [] {
|
||||
/* isRelease */ false,
|
||||
/* linkTool */ "",
|
||||
/* rid */ "",
|
||||
},
|
||||
new object [] {
|
||||
/* isRelease */ true,
|
||||
/* linkTool */ "r8",
|
||||
/* rid */ "",
|
||||
},
|
||||
new object [] {
|
||||
/* isRelease */ true,
|
||||
/* linkTool */ "r8",
|
||||
/* rid */ "android-arm64",
|
||||
},
|
||||
};
|
||||
|
||||
[Test]
|
||||
[TestCaseSource (nameof (BuildProguardEnabledProjectSource))]
|
||||
[NonParallelizable] // On MacOS, parallel /restore causes issues
|
||||
public void BuildProguardEnabledProject (bool isRelease, string linkTool, string rid)
|
||||
public void BuildProguardEnabledProject (string rid)
|
||||
{
|
||||
var proj = new XamarinFormsAndroidApplicationProject {
|
||||
IsRelease = isRelease,
|
||||
LinkTool = linkTool,
|
||||
IsRelease = true,
|
||||
LinkTool = "r8",
|
||||
};
|
||||
if (!string.IsNullOrEmpty (rid)) {
|
||||
proj.SetProperty ("RuntimeIdentifier", rid);
|
||||
}
|
||||
using (var b = CreateApkBuilder (Path.Combine ("temp", $"BuildProguard Enabled(1){isRelease}{linkTool}{rid}"))) {
|
||||
using (var b = CreateApkBuilder (Path.Combine ("temp", $"BuildProguard Enabled(1){rid}"))) {
|
||||
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
|
||||
// warning XA4304: ProGuard configuration file 'XYZ' was not found.
|
||||
StringAssertEx.DoesNotContain ("XA4304", b.LastBuildOutput, "Output should *not* contain XA4304 warnings");
|
||||
|
@ -1022,18 +960,16 @@ namespace UnamedProject
|
|||
}
|
||||
|
||||
var toolbar_class = "androidx.appcompat.widget.Toolbar";
|
||||
if (isRelease && !string.IsNullOrEmpty (linkTool)) {
|
||||
var proguardProjectPrimary = Path.Combine (intermediate, "proguard", "proguard_project_primary.cfg");
|
||||
FileAssert.Exists (proguardProjectPrimary);
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (File.ReadAllLines (proguardProjectPrimary), $"-keep class {proj.JavaPackageName}.MainActivity"), $"`{proj.JavaPackageName}.MainActivity` should exist in `proguard_project_primary.cfg`!");
|
||||
var proguardProjectPrimary = Path.Combine (intermediate, "proguard", "proguard_project_primary.cfg");
|
||||
FileAssert.Exists (proguardProjectPrimary);
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (File.ReadAllLines (proguardProjectPrimary), $"-keep class {proj.JavaPackageName}.MainActivity"), $"`{proj.JavaPackageName}.MainActivity` should exist in `proguard_project_primary.cfg`!");
|
||||
|
||||
var aapt_rules = Path.Combine (intermediate, "aapt_rules.txt");
|
||||
FileAssert.Exists (aapt_rules);
|
||||
var lines = File.ReadAllLines (aapt_rules);
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (lines, $"-keep class {toolbar_class}"), $"`{toolbar_class}` should exist in `{aapt_rules}`!");
|
||||
var activity_class = $"{proj.PackageName}.MainActivity";
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (lines, $"-keep class {activity_class}"), $"`{activity_class}` should exist in `{aapt_rules}`!");
|
||||
}
|
||||
var aapt_rules = Path.Combine (intermediate, "aapt_rules.txt");
|
||||
FileAssert.Exists (aapt_rules);
|
||||
var lines = File.ReadAllLines (aapt_rules);
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (lines, $"-keep class {toolbar_class}"), $"`{toolbar_class}` should exist in `{aapt_rules}`!");
|
||||
var activity_class = $"{proj.PackageName}.MainActivity";
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (lines, $"-keep class {activity_class}"), $"`{activity_class}` should exist in `{aapt_rules}`!");
|
||||
|
||||
var dexFile = Path.Combine (intermediate, "android", "bin", "classes.dex");
|
||||
FileAssert.Exists (dexFile);
|
||||
|
|
|
@ -350,6 +350,9 @@ namespace Xamarin.Android.Build.Tests
|
|||
BinaryContent = () => new byte[10],
|
||||
MetadataValues = "Link=libs\\x86\\libtest.so",
|
||||
},
|
||||
new AndroidItem.AndroidNativeLibrary ("armeabi-v7a\\libRSSupport.so") {
|
||||
BinaryContent = () => new byte[10],
|
||||
},
|
||||
},
|
||||
};
|
||||
var dll2 = new XamarinAndroidLibraryProject () {
|
||||
|
@ -379,12 +382,9 @@ namespace Xamarin.Android.Build.Tests
|
|||
new AndroidItem.AndroidNativeLibrary ("armeabi-v7a\\libRSSupport.so") {
|
||||
BinaryContent = () => new byte[10],
|
||||
},
|
||||
},
|
||||
PackageReferences = {
|
||||
KnownPackages.Xamarin_Android_Support_v8_RenderScript_28_0_0_3,
|
||||
}
|
||||
};
|
||||
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86");
|
||||
proj.SetRuntimeIdentifiers (["armeabi-v7a", "x86"]);
|
||||
var path = Path.Combine (Root, "temp", string.Format ("BuildWithNativeLibraries_{0}", isRelease));
|
||||
using (var b1 = CreateDllBuilder (Path.Combine (path, dll2.ProjectName))) {
|
||||
Assert.IsTrue (b1.Build (dll2), "Build should have succeeded.");
|
||||
|
|
|
@ -31,16 +31,7 @@ namespace Xamarin.Android.Build.Tests
|
|||
},
|
||||
},
|
||||
};
|
||||
var proj = new XamarinAndroidApplicationProject () {
|
||||
PackageReferences = {
|
||||
KnownPackages.SupportMediaCompat_27_0_2_1,
|
||||
KnownPackages.SupportFragment_27_0_2_1,
|
||||
KnownPackages.SupportCoreUtils_27_0_2_1,
|
||||
KnownPackages.SupportCoreUI_27_0_2_1,
|
||||
KnownPackages.SupportCompat_27_0_2_1,
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportV7AppCompat_27_0_2_1,
|
||||
},
|
||||
var proj = new XamarinFormsAndroidApplicationProject () {
|
||||
References = { new BuildItem ("ProjectReference", "..\\Library1\\Library1.csproj") },
|
||||
Imports = {
|
||||
new Import ("foo.targets") {
|
||||
|
@ -152,7 +143,7 @@ namespace UnnamedProject
|
|||
var resourcepathscache = Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath, "designtime", "libraryprojectimports.cache");
|
||||
FileAssert.Exists (resourcepathscache);
|
||||
var doc = XDocument.Load (resourcepathscache);
|
||||
Assert.AreEqual (37, doc.Root.Element ("Jars").Elements ("Jar").Count (), "libraryprojectimports.cache did not contain expected jar files");
|
||||
Assert.AreEqual (54, doc.Root.Element ("Jars").Elements ("Jar").Count (), "libraryprojectimports.cache did not contain expected jar files");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -212,17 +203,7 @@ namespace UnnamedProject
|
|||
public void GetExtraLibraryLocationsForDesigner ()
|
||||
{
|
||||
var target = "GetExtraLibraryLocationsForDesigner";
|
||||
var proj = new XamarinAndroidApplicationProject () {
|
||||
PackageReferences = {
|
||||
KnownPackages.SupportMediaCompat_27_0_2_1,
|
||||
KnownPackages.SupportFragment_27_0_2_1,
|
||||
KnownPackages.SupportCoreUtils_27_0_2_1,
|
||||
KnownPackages.SupportCoreUI_27_0_2_1,
|
||||
KnownPackages.SupportCompat_27_0_2_1,
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportV7AppCompat_27_0_2_1,
|
||||
},
|
||||
};
|
||||
var proj = new XamarinFormsAndroidApplicationProject ();
|
||||
string jar = "gson-2.7.jar";
|
||||
proj.OtherBuildItems.Add (new BuildItem ("AndroidJavaLibrary", jar) {
|
||||
WebContent = $"https://repo1.maven.org/maven2/com/google/code/gson/gson/2.7/{jar}"
|
||||
|
@ -231,7 +212,7 @@ namespace UnnamedProject
|
|||
WebContent = "https://repo1.maven.org/maven2/com/soundcloud/android/android-crop/1.0.1/android-crop-1.0.1.aar"
|
||||
});
|
||||
// Each NuGet package and AAR file are in libraryprojectimports.cache, AndroidJavaSource is not
|
||||
int libraryProjectImportsJars = 14;
|
||||
const int libraryProjectImportsJars = 55;
|
||||
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName), false, false)) {
|
||||
// GetExtraLibraryLocationsForDesigner on new project
|
||||
Assert.IsTrue (b.RunTarget (proj, target, parameters: DesignerParameters), $"build should have succeeded for target `{target}` 1");
|
||||
|
|
|
@ -819,10 +819,10 @@ namespace Lib2
|
|||
Assert.IsTrue (b.Build (proj), "second build should have succeeded.");
|
||||
FileAssert.Exists (cacheFile);
|
||||
var actual = ReadCache (cacheFile);
|
||||
CollectionAssert.AreEqual (actual.Jars.Select (j => j.ItemSpec),
|
||||
expected.Jars.Select (j => j.ItemSpec));
|
||||
CollectionAssert.AreEqual (actual.ResolvedResourceDirectories.Select (j => j.ItemSpec),
|
||||
expected.ResolvedResourceDirectories.Select (j => j.ItemSpec));
|
||||
CollectionAssert.AreEqual (actual.Jars.Select (j => j.ItemSpec).OrderBy (j => j),
|
||||
expected.Jars.Select (j => j.ItemSpec).OrderBy (j => j));
|
||||
CollectionAssert.AreEqual (actual.ResolvedResourceDirectories.Select (j => j.ItemSpec).OrderBy (j => j),
|
||||
expected.ResolvedResourceDirectories.Select (j => j.ItemSpec).OrderBy (j => j));
|
||||
|
||||
// Add a new AAR file to the project
|
||||
var aar = new AndroidItem.AndroidAarLibrary ("Jars\\android-crop-1.0.1.aar") {
|
||||
|
@ -1363,39 +1363,6 @@ namespace Lib2
|
|||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
[NonParallelizable]
|
||||
public void AndroidXMigrationBug ()
|
||||
{
|
||||
var proj = new XamarinFormsAndroidApplicationProject ();
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXMigration);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompatResources);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXBrowser);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXMediaRouter);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXLegacySupportV4);
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXLifecycleLiveData);
|
||||
proj.PackageReferences.Add (KnownPackages.XamarinGoogleAndroidMaterial);
|
||||
|
||||
string source = "class Foo { }";
|
||||
proj.Sources.Add (new BuildItem.Source ("Foo.cs") { TextContent = () => source });
|
||||
|
||||
using (var b = CreateApkBuilder ()) {
|
||||
Assert.IsTrue (b.Build (proj), "first build should have succeeded.");
|
||||
source = source.Replace ("Foo", "Bar");
|
||||
proj.Touch ("Foo.cs");
|
||||
Assert.IsTrue (b.Build (proj, doNotCleanupOnUpdate: true), "second build should have succeeded.");
|
||||
var targets = new [] {
|
||||
"_CompileResources",
|
||||
"_UpdateAndroidResgen",
|
||||
"_GenerateAndroidResourceDir",
|
||||
};
|
||||
foreach (var target in targets) {
|
||||
Assert.IsTrue (b.Output.IsTargetSkipped (target), $"`{target}` should be skipped.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ChangeSupportedAbis ()
|
||||
{
|
||||
|
|
|
@ -763,13 +763,7 @@ namespace Bug12935
|
|||
new BuildItem.ProjectReference ("..\\Binding1\\Binding1.csproj", lib.ProjectGuid)
|
||||
},
|
||||
PackageReferences = {
|
||||
KnownPackages.SupportMediaCompat_27_0_2_1,
|
||||
KnownPackages.SupportFragment_27_0_2_1,
|
||||
KnownPackages.SupportCoreUtils_27_0_2_1,
|
||||
KnownPackages.SupportCoreUI_27_0_2_1,
|
||||
KnownPackages.SupportCompat_27_0_2_1,
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportV7AppCompat_27_0_2_1,
|
||||
KnownPackages.AndroidXAppCompat,
|
||||
},
|
||||
};
|
||||
proj.SetProperty ("AndroidManifestMerger", "legacy");
|
||||
|
@ -785,7 +779,7 @@ using Android.OS;
|
|||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.Support.V4.App;
|
||||
using AndroidX.Fragment.App;
|
||||
using Android.Util;
|
||||
[Activity (Label = ""TestActivity1"")]
|
||||
[IntentFilter (new[]{Intent.ActionMain}, Categories = new[]{ ""com.xamarin.sample"" })]
|
||||
|
@ -805,7 +799,7 @@ using Android.OS;
|
|||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Android.Support.V4.App;
|
||||
using AndroidX.Fragment.App;
|
||||
using Android.Util;
|
||||
[Activity (Label = ""TestActivity2"")]
|
||||
[IntentFilter (new[]{Intent.ActionMain}, Categories = new[]{ ""com.xamarin.sample"" })]
|
||||
|
@ -826,8 +820,8 @@ public class TestActivity2 : FragmentActivity {
|
|||
"${applicationId}.FacebookInitProvider was not replaced with com.xamarin.manifest.FacebookInitProvider");
|
||||
Assert.IsTrue (manifest.Contains ("com.xamarin.test.internal.FacebookInitProvider"),
|
||||
".internal.FacebookInitProvider was not replaced with com.xamarin.test.internal.FacebookInitProvider");
|
||||
Assert.AreEqual (manifest.IndexOf ("meta-data", StringComparison.OrdinalIgnoreCase),
|
||||
manifest.LastIndexOf ("meta-data", StringComparison.OrdinalIgnoreCase), "There should be only one meta-data element");
|
||||
Assert.AreEqual (manifest.IndexOf ("android.support.VERSION", StringComparison.OrdinalIgnoreCase),
|
||||
manifest.LastIndexOf ("android.support.VERSION", StringComparison.OrdinalIgnoreCase), "There should be only one android.support.VERSION meta-data element");
|
||||
|
||||
var doc = XDocument.Parse (manifest);
|
||||
var ns = XNamespace.Get ("http://schemas.android.com/apk/res/android");
|
||||
|
|
|
@ -261,25 +261,7 @@ Console.WriteLine ($""{DateTime.UtcNow.AddHours(-30).Humanize(culture:c)}"");
|
|||
public void CheckMetadataSkipItemsAreProcessedCorrectly ()
|
||||
{
|
||||
var packages = new List<Package> () {
|
||||
KnownPackages.Android_Arch_Core_Common_26_1_0,
|
||||
KnownPackages.Android_Arch_Lifecycle_Common_26_1_0,
|
||||
KnownPackages.Android_Arch_Lifecycle_Runtime_26_1_0,
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportCompat_27_0_2_1,
|
||||
KnownPackages.SupportCoreUI_27_0_2_1,
|
||||
KnownPackages.SupportCoreUtils_27_0_2_1,
|
||||
KnownPackages.SupportDesign_27_0_2_1,
|
||||
KnownPackages.SupportFragment_27_0_2_1,
|
||||
KnownPackages.SupportMediaCompat_27_0_2_1,
|
||||
KnownPackages.SupportV7AppCompat_27_0_2_1,
|
||||
KnownPackages.SupportV7CardView_27_0_2_1,
|
||||
KnownPackages.SupportV7MediaRouter_27_0_2_1,
|
||||
KnownPackages.SupportV7RecyclerView_27_0_2_1,
|
||||
KnownPackages.VectorDrawable_27_0_2_1,
|
||||
new Package () { Id = "Xamarin.Android.Support.Annotations", Version = "27.0.2.1" },
|
||||
new Package () { Id = "Xamarin.Android.Support.Transition", Version = "27.0.2.1" },
|
||||
new Package () { Id = "Xamarin.Android.Support.v7.Palette", Version = "27.0.2.1" },
|
||||
new Package () { Id = "Xamarin.Android.Support.Animated.Vector.Drawable", Version = "27.0.2.1" },
|
||||
KnownPackages.Xamarin_Jetbrains_Annotations,
|
||||
};
|
||||
|
||||
string metaDataTemplate = @"<AndroidCustomMetaDataForReferences Include=""%"">
|
||||
|
@ -644,20 +626,8 @@ public class Test
|
|||
[TestCase (-1, 200)]
|
||||
public void BuildApkWithZipFlushLimits (int filesLimit, int sizeLimit)
|
||||
{
|
||||
var proj = new XamarinAndroidApplicationProject {
|
||||
var proj = new XamarinFormsAndroidApplicationProject {
|
||||
IsRelease = false,
|
||||
PackageReferences = {
|
||||
KnownPackages.SupportDesign_27_0_2_1,
|
||||
KnownPackages.SupportV7CardView_27_0_2_1,
|
||||
KnownPackages.AndroidSupportV4_27_0_2_1,
|
||||
KnownPackages.SupportCoreUtils_27_0_2_1,
|
||||
KnownPackages.SupportMediaCompat_27_0_2_1,
|
||||
KnownPackages.SupportFragment_27_0_2_1,
|
||||
KnownPackages.SupportCoreUI_27_0_2_1,
|
||||
KnownPackages.SupportCompat_27_0_2_1,
|
||||
KnownPackages.SupportV7AppCompat_27_0_2_1,
|
||||
KnownPackages.SupportV7MediaRouter_27_0_2_1,
|
||||
},
|
||||
};
|
||||
proj.SetProperty ("EmbedAssembliesIntoApk", "true");
|
||||
if (filesLimit > 0)
|
||||
|
|
|
@ -7,27 +7,6 @@ namespace Xamarin.Android.Build.Tests
|
|||
[TestFixture]
|
||||
public class WearTests : BaseTest
|
||||
{
|
||||
[Test]
|
||||
public void ResolveLibraryImportsWithReadonlyFiles ()
|
||||
{
|
||||
//NOTE: doesn't need to be a full Android Wear app
|
||||
var proj = new XamarinAndroidApplicationProject {
|
||||
PackageReferences = {
|
||||
KnownPackages.AndroidWear_2_2_0,
|
||||
KnownPackages.Android_Arch_Core_Common_26_1_0,
|
||||
KnownPackages.Android_Arch_Lifecycle_Common_26_1_0,
|
||||
KnownPackages.Android_Arch_Lifecycle_Runtime_26_1_0,
|
||||
KnownPackages.SupportCompat_27_0_2_1,
|
||||
KnownPackages.SupportCoreUI_27_0_2_1,
|
||||
KnownPackages.SupportPercent_27_0_2_1,
|
||||
KnownPackages.SupportV7RecyclerView_27_0_2_1,
|
||||
},
|
||||
};
|
||||
using (var b = CreateApkBuilder ()) {
|
||||
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BasicProject ([Values (true, false)] bool isRelease)
|
||||
{
|
||||
|
@ -42,7 +21,6 @@ namespace Xamarin.Android.Build.Tests
|
|||
[Test]
|
||||
public void BundledWearApp ()
|
||||
{
|
||||
var target = "_UpdateAndroidResgen";
|
||||
var path = Path.Combine ("temp", TestName);
|
||||
var app = new XamarinAndroidApplicationProject {
|
||||
ProjectName = "MyApp",
|
||||
|
@ -71,7 +49,7 @@ namespace Xamarin.Android.Build.Tests
|
|||
IsRelease = true,
|
||||
EnableDefaultItems = true,
|
||||
PackageReferences = {
|
||||
new Package { Id = "Xamarin.AndroidX.Wear", Version = "1.2.0.5" },
|
||||
KnownPackages.XamarinAndroidXWear,
|
||||
new Package { Id = "Xamarin.Android.Wear", Version = "2.2.0" },
|
||||
new Package { Id = "Xamarin.AndroidX.PercentLayout", Version = "1.0.0.14" },
|
||||
new Package { Id = "Xamarin.AndroidX.Legacy.Support.Core.UI", Version = "1.0.0.14" },
|
||||
|
@ -81,12 +59,7 @@ namespace Xamarin.Android.Build.Tests
|
|||
var builder = CreateApkBuilder ();
|
||||
builder.ThrowOnBuildFailure = false;
|
||||
Assert.IsFalse (builder.Build (proj), $"{proj.ProjectName} should fail.");
|
||||
var text = $"java.lang.RuntimeException";
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (builder.LastBuildOutput, text), $"Output did not contain '{text}'");
|
||||
text = $"is defined multiple times";
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (builder.LastBuildOutput, text), $"Output did not contain '{text}'");
|
||||
text = $"is from 'androidx.core.core.aar'";
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (builder.LastBuildOutput, text), $"Output did not contain '{text}'");
|
||||
Assert.IsTrue (StringAssertEx.ContainsText (builder.LastBuildOutput, "error XA1039"), "Should receive error XA1039");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,339 +4,49 @@ namespace Xamarin.ProjectTools
|
|||
{
|
||||
public static class KnownPackages
|
||||
{
|
||||
public static Package AndroidSupportV4_27_0_2_1 = new Package () {
|
||||
Id = "Xamarin.Android.Support.v4",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.v4") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.v4.27.0.2.1\\lib\\MonoAndroid70\\Xamarin.Android.Support.v4.dll" }
|
||||
}
|
||||
public static Package XamarinAndroidXWear = new Package {
|
||||
Id = "Xamarin.AndroidX.Wear",
|
||||
Version = "1.2.0.5"
|
||||
};
|
||||
public static Package AndroidWear_2_2_0 = new Package () {
|
||||
Id = "Xamarin.Android.Wear",
|
||||
Version = "2.2.0",
|
||||
TargetFramework = "MonoAndroid80",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Wearable") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Wear.2.2.0\\lib\\MonoAndroid80\\Xamarin.Android.Wear.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportV7RecyclerView_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.v7.RecyclerView",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.V7.RecyclerView") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.v7.RecyclerView.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.v7.RecyclerView.dll"
|
||||
}
|
||||
}
|
||||
};
|
||||
public static Package SupportV7CardView_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.v7.Cardview",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.v7.CardView") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.v7.CardView.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.v7.CardView.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportV7AppCompat_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.v7.AppCompat",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.v7.AppCompat") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.v7.AppCompat.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.v7.AppCompat.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportCompat_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.Compat",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Compat") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Compat.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.Compat.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportCoreUI_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.Core.UI",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Core.UI") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Core.UI.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.Core.UI.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportCoreUtils_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.Core.Utils",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Core.Utils") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Core.Utils.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.Core.Utils.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportFragment_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.Fragment",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Fragment") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Fragment.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.Fragment.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportMediaCompat_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.Media.Compat",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Media.Compat") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Media.Compat.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.Media.Compat.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportPercent_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.Percent",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Percent") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Percent.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.Percent.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportV7MediaRouter_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.v7.MediaRouter",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.v7.MediaRouter") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.v7.MediaRouter.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.v7.MediaRouter.dll" }
|
||||
}
|
||||
};
|
||||
public static Package SupportConstraintLayout_1_0_2_2 = new Package {
|
||||
Id = "Xamarin.Android.Support.Constraint.Layout",
|
||||
Version = "1.0.2.2",
|
||||
TargetFramework = "MonoAndroid70",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Constraint.Layout") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Constraint.Layout.1.0.2.2\\lib\\MonoAndroid70\\Xamarin.Android.Support.Constraint.Layout.dll"
|
||||
}
|
||||
}
|
||||
};
|
||||
public static Package VectorDrawable_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.Vector.Drawable",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Vector.Drawable") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Vector.Drawable.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.Vector.Drawable.dll" }
|
||||
},
|
||||
};
|
||||
public static Package SupportDesign_27_0_2_1 = new Package {
|
||||
Id = "Xamarin.Android.Support.Design",
|
||||
Version = "27.0.2.1",
|
||||
TargetFramework = "MonoAndroid81",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Android.Support.Design") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.Design.27.0.2.1\\lib\\MonoAndroid81\\Xamarin.Android.Support.Design.dll" }
|
||||
}
|
||||
};
|
||||
public static Package XamarinFormsPCL_2_3_4_231 = new Package {
|
||||
public static Package XamarinForms = new Package {
|
||||
Id = "Xamarin.Forms",
|
||||
Version = "2.3.4.231",
|
||||
TargetFramework = "portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Forms.Core") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.2.3.4.231\\lib\\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\\Xamarin.Forms.Core.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Xaml") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.2.3.4.231\\lib\\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\\Xamarin.Forms.Xaml.dll"
|
||||
},
|
||||
}
|
||||
Version = "5.0.0.2622",
|
||||
};
|
||||
public static Package XamarinForms_2_3_4_231 = new Package {
|
||||
Id = "Xamarin.Forms",
|
||||
Version = "2.3.4.231",
|
||||
TargetFramework = "MonoAndroid44",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Forms.Platform.Android") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.2.3.4.231\\lib\\MonoAndroid10\\Xamarin.Forms.Platform.Android.dll"
|
||||
},
|
||||
new BuildItem.Reference ("FormsViewGroup") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.2.3.4.231\\lib\\MonoAndroid10\\FormsViewGroup.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Core") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.2.3.4.231\\lib\\MonoAndroid10\\Xamarin.Forms.Core.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Xaml") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.2.3.4.231\\lib\\MonoAndroid10\\Xamarin.Forms.Xaml.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Platform") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.2.3.4.231\\lib\\MonoAndroid10\\Xamarin.Forms.Platform.dll"
|
||||
},
|
||||
}
|
||||
};
|
||||
public static Package XamarinForms_4_0_0_425677 = new Package {
|
||||
Id = "Xamarin.Forms",
|
||||
Version = "4.0.0.425677",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Forms.Platform.Android") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.0.0.425677\\lib\\MonoAndroid90\\Xamarin.Forms.Platform.Android.dll"
|
||||
},
|
||||
new BuildItem.Reference ("FormsViewGroup") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.0.0.425677\\lib\\MonoAndroid90\\FormsViewGroup.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Core") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.0.0.425677\\lib\\MonoAndroid90\\Xamarin.Forms.Core.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Xaml") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.0.0.425677\\lib\\MonoAndroid90\\Xamarin.Forms.Xaml.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Platform") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.0.0.425677\\lib\\MonoAndroid90\\Xamarin.Forms.Platform.dll"
|
||||
},
|
||||
}
|
||||
};
|
||||
public static Package XamarinForms_4_7_0_1142 = new Package {
|
||||
Id = "Xamarin.Forms",
|
||||
Version = "4.7.0.1142",
|
||||
TargetFramework = "MonoAndroid10.0",
|
||||
};
|
||||
public static Package XamarinForms_5_0_0_2515 = new Package {
|
||||
Id = "Xamarin.Forms",
|
||||
Version = "5.0.0.2515",
|
||||
TargetFramework = "MonoAndroid10.0",
|
||||
};
|
||||
public static Package XamarinFormsMaps_4_7_0_1142 = new Package {
|
||||
public static Package XamarinFormsMaps = new Package {
|
||||
Id = "Xamarin.Forms.Maps",
|
||||
Version = "4.7.0.1142",
|
||||
TargetFramework = "MonoAndroid10.0",
|
||||
Version = "5.0.0.2622",
|
||||
};
|
||||
public static Package XamarinFormsMaps_5_0_0_2515 = new Package {
|
||||
Id = "Xamarin.Forms.Maps",
|
||||
Version = "5.0.0.2515",
|
||||
TargetFramework = "MonoAndroid10.0",
|
||||
};
|
||||
public static Package XamarinFormsMaps_4_0_0_425677 = new Package {
|
||||
Id = "Xamarin.Forms.Maps",
|
||||
Version = "4.0.0.425677",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Forms.Maps.Android") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.Maps.4.0.0.425677\\lib\\MonoAndroid90\\Xamarin.Forms.Maps.Android.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Maps") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.Maps.4.0.0.425677\\lib\\MonoAndroid90\\Xamarin.Forms.Maps.dll"
|
||||
},
|
||||
}
|
||||
};
|
||||
public static Package XamarinForms_4_4_0_991265 = new Package {
|
||||
Id = "Xamarin.Forms",
|
||||
Version = "4.4.0.991265",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Forms.Platform.Android") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.4.0.991265\\lib\\MonoAndroid90\\Xamarin.Forms.Platform.Android.dll"
|
||||
},
|
||||
new BuildItem.Reference ("FormsViewGroup") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.4.0.991265\\lib\\MonoAndroid90\\FormsViewGroup.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Core") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.4.0.991265\\lib\\MonoAndroid90\\Xamarin.Forms.Core.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Xaml") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.4.0.991265\\lib\\MonoAndroid90\\Xamarin.Forms.Xaml.dll"
|
||||
},
|
||||
new BuildItem.Reference ("Xamarin.Forms.Platform") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Forms.4.4.0.991265\\lib\\MonoAndroid90\\Xamarin.Forms.Platform.dll"
|
||||
},
|
||||
}
|
||||
};
|
||||
public static Package AndroidXMigration = new Package {
|
||||
Id = "Xamarin.AndroidX.Migration",
|
||||
Version = "1.0.6.1",
|
||||
TargetFramework = "MonoAndroid10",
|
||||
public static Package AndroidXConstraintLayout = new Package {
|
||||
Id = "Xamarin.AndroidX.ConstraintLayout",
|
||||
Version = "2.1.4.9",
|
||||
};
|
||||
public static Package AndroidXAppCompat = new Package {
|
||||
Id = "Xamarin.AndroidX.AppCompat",
|
||||
Version = "1.1.0.1",
|
||||
TargetFramework = "MonoAndroid10",
|
||||
};
|
||||
public static Package AndroidXAppCompat_1_6_0_1 = new Package {
|
||||
Id = "Xamarin.AndroidX.AppCompat",
|
||||
Version = "1.6.0.1",
|
||||
TargetFramework = "MonoAndroid10",
|
||||
Version = "1.6.1.6",
|
||||
};
|
||||
public static Package AndroidXBrowser = new Package {
|
||||
Id = "Xamarin.AndroidX.Browser",
|
||||
Version = "1.2.0.1",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.AndroidX.Browser") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.AndroidX.Browser.1.0.0\\lib\\MonoAndroid90\\Xamarin.AndroidX.Browser.dll"
|
||||
},
|
||||
}
|
||||
};
|
||||
public static Package AndroidXMediaRouter = new Package {
|
||||
Id = "Xamarin.AndroidX.MediaRouter",
|
||||
Version = "1.1.0.1",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.AndroidX.MediaRouter") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.AndroidX.MediaRouter.1.1.0\\lib\\MonoAndroid90\\Xamarin.AndroidX.MediaRouter.dll"
|
||||
},
|
||||
}
|
||||
Version = "1.5.0.3",
|
||||
};
|
||||
public static Package AndroidXLegacySupportV4 = new Package {
|
||||
Id = "Xamarin.AndroidX.Legacy.Support.V4",
|
||||
Version = "1.0.0.1",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.AndroidX.Legacy.Support.V4") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.AndroidX.Legacy.Support.V4.1.0.0\\lib\\MonoAndroid90\\Xamarin.AndroidX.Legacy.Support.V4.dll"
|
||||
},
|
||||
}
|
||||
};
|
||||
public static Package AndroidXLifecycleLiveData = new Package {
|
||||
Id = "Xamarin.AndroidX.Lifecycle.LiveData",
|
||||
Version = "2.2.0.1",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.AndroidX.Lifecycle.LiveData") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.AndroidX.Lifecycle.LiveData.2.1.0\\lib\\MonoAndroid90\\Xamarin.AndroidX.Lifecycle.LiveData.dll"
|
||||
},
|
||||
}
|
||||
Version = "1.0.0.22",
|
||||
};
|
||||
public static Package AndroidXAppCompatResources = new Package {
|
||||
Id = "Xamarin.AndroidX.AppCompat.AppCompatResources",
|
||||
Version = "1.1.0.1",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.AndroidX.AppCompat.AppCompatResources") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.AndroidX.AppCompat.AppCompatResources.1.1.0.1\\lib\\MonoAndroid90\\Xamarin.AndroidX.AppCompat.AppCompatResources.dll"
|
||||
},
|
||||
}
|
||||
Version = "1.6.1.7",
|
||||
};
|
||||
public static Package AndroidXLifecycleLiveData = new Package {
|
||||
Id = "Xamarin.AndroidX.Lifecycle.LiveData",
|
||||
Version = "2.6.2.3",
|
||||
};
|
||||
public static Package AndroidXWorkRuntime = new Package {
|
||||
Id = "Xamarin.AndroidX.Work.Runtime",
|
||||
Version = "2.3.4.3",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference("Xamarin.AndroidX.Work.Runtime") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.AndroidX.Work.Runtime.2.3.4.3\\lib\\MonoAndroid90\\Xamarin.AndroidX.Work.Runtime.dll"
|
||||
}
|
||||
}
|
||||
Version = "2.9.0",
|
||||
};
|
||||
public static Package XamarinGoogleAndroidMaterial = new Package {
|
||||
Id = "Xamarin.Google.Android.Material",
|
||||
Version = "1.0.0.1",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("Xamarin.Google.Android.Material") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Google.Android.Material.1.0.0\\lib\\MonoAndroid90\\Xamarin.Google.Android.Material.dll"
|
||||
},
|
||||
}
|
||||
Version = "1.10.0.2",
|
||||
};
|
||||
public static Package CocosSharp_PCL_Shared_1_5_0_0 = new Package {
|
||||
Id = "CocosSharp.PCL.Shared",
|
||||
|
@ -364,16 +74,6 @@ namespace Xamarin.ProjectTools
|
|||
},
|
||||
}
|
||||
};
|
||||
public static Package Xamarin_Android_Support_v8_RenderScript_28_0_0_3 = new Package {
|
||||
Id = "Xamarin.Android.Support.v8.RenderScript",
|
||||
Version = "28.0.0.3",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference ("MonoGame.Framework") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Support.v8.RenderScript.28.0.0.3\\lib\\MonoAndroid90\\Xamarin.Android.Support.v8.RenderScript.dll"
|
||||
},
|
||||
}
|
||||
};
|
||||
public static Package FSharp_Core_Latest = new Package {
|
||||
Id = "FSharp.Core",
|
||||
Version = "4.7.1",
|
||||
|
@ -425,79 +125,9 @@ namespace Xamarin.ProjectTools
|
|||
}
|
||||
}
|
||||
};
|
||||
public static Package Android_Arch_Core_Common_26_1_0 = new Package {
|
||||
Id = "Xamarin.Android.Arch.Core.Common",
|
||||
Version = "26.1.0",
|
||||
TargetFramework = "MonoAndroid80",
|
||||
References = {
|
||||
new BuildItem.Reference("Xamarin.Android.Arch.Core.Common") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Arch.Core.Common.26.1.0\\lib\\MonoAndroid80\\Xamarin.Android.Arch.Core.Common.dll"
|
||||
}
|
||||
}
|
||||
};
|
||||
public static Package Android_Arch_Lifecycle_Common_26_1_0 = new Package {
|
||||
Id = "Xamarin.Android.Arch.Lifecycle.Common",
|
||||
Version = "26.1.0",
|
||||
TargetFramework = "MonoAndroid80",
|
||||
References = {
|
||||
new BuildItem.Reference("Xamarin.Android.Arch.Lifecycle.Common") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Arch.Lifecycle.Common.26.1.0\\lib\\MonoAndroid80\\Xamarin.Android.Arch.Lifecycle.Common.dll"
|
||||
}
|
||||
}
|
||||
};
|
||||
public static Package Android_Arch_Lifecycle_Runtime_26_1_0 = new Package {
|
||||
Id = "Xamarin.Android.Arch.Lifecycle.Runtime",
|
||||
Version = "26.1.0",
|
||||
TargetFramework = "MonoAndroid80",
|
||||
References = {
|
||||
new BuildItem.Reference("Xamarin.Android.Arch.Lifecycle.Runtime") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Arch.Lifecycle.Runtime.26.1.0\\lib\\MonoAndroid80\\Xamarin.Android.Arch.Lifecycle.Runtime.dll"
|
||||
}
|
||||
}
|
||||
};
|
||||
public static Package Android_Arch_Work_Runtime = new Package {
|
||||
Id = "Xamarin.Android.Arch.Work.Runtime",
|
||||
Version = "1.0.0",
|
||||
TargetFramework = "MonoAndroid90",
|
||||
References = {
|
||||
new BuildItem.Reference("Xamarin.Android.Arch.Work.Runtime") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Arch.Work.Runtime.1.0.0\\lib\\MonoAndroid90\\Xamarin.Android.Arch.Work.Runtime.dll"
|
||||
}
|
||||
}
|
||||
};
|
||||
public static Package Xamarin_Android_Crashlytics = new Package {
|
||||
Id = "Xamarin.Android.Crashlytics",
|
||||
Version = "2.9.4.4",
|
||||
TargetFramework = "MonoAndroid60",
|
||||
References = {
|
||||
new BuildItem.Reference("Xamarin.Android.Crashlytics") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Crashlytics.2.9.4.4\\lib\\MonoAndroid60\\Xamarin.Android.Crashlytics.dll"
|
||||
}
|
||||
}
|
||||
};
|
||||
public static Package Xamarin_Android_Fabric = new Package {
|
||||
Id = "Xamarin.Android.Fabric",
|
||||
Version = "1.4.3.4",
|
||||
TargetFramework = "MonoAndroid60",
|
||||
References = {
|
||||
new BuildItem.Reference("Xamarin.Android.Fabric") {
|
||||
MetadataValues = "HintPath=..\\packages\\Xamarin.Android.Fabric.1.4.3.4\\lib\\MonoAndroid60\\Xamarin.Android.Fabric.dll"
|
||||
}
|
||||
}
|
||||
};
|
||||
public static Package Xamarin_Build_Download = new Package {
|
||||
Id = "Xamarin.Build.Download",
|
||||
Version = "0.11.2",
|
||||
};
|
||||
|
||||
public static Package Xamarin_Build_Download_0_11_3 = new Package {
|
||||
Id = "Xamarin.Build.Download",
|
||||
Version = "0.11.3",
|
||||
};
|
||||
// NOTE: old version required for some tests
|
||||
public static Package Xamarin_Build_Download_0_4_11 = new Package {
|
||||
Id = "Xamarin.Build.Download",
|
||||
Version = "0.4.11",
|
||||
Version = "0.11.4",
|
||||
};
|
||||
public static Package NuGet_Build_Packaging = new Package {
|
||||
Id = "NuGet.Build.Packaging",
|
||||
|
@ -571,7 +201,7 @@ namespace Xamarin.ProjectTools
|
|||
};
|
||||
public static Package ZXing_Net_Mobile = new Package {
|
||||
Id = "ZXing.Net.Mobile",
|
||||
Version = "2.4.1",
|
||||
Version = "3.0.0-beta5", // version with AndroidX
|
||||
TargetFramework = "MonoAndroid10",
|
||||
};
|
||||
public static Package Xamarin_Legacy_OpenTK = new Package {
|
||||
|
@ -584,6 +214,10 @@ namespace Xamarin.ProjectTools
|
|||
Version = "0.0.1-alpha",
|
||||
TargetFramework = "MonoAndroid10",
|
||||
};
|
||||
public static Package Xamarin_Jetbrains_Annotations = new Package {
|
||||
Id = "Xamarin.Jetbrains.Annotations",
|
||||
Version = "24.1.0.1",
|
||||
};
|
||||
public static Package Mono_AotProfiler_Android = new Package {
|
||||
Id = "Mono.AotProfiler.Android",
|
||||
Version = "7.0.0-preview1",
|
||||
|
|
|
@ -3,13 +3,18 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Linq;
|
||||
|
||||
namespace Xamarin.ProjectTools
|
||||
{
|
||||
/// <summary>
|
||||
/// Migrated from Android.Support to AndroidX
|
||||
/// see: https://android-developers.googleblog.com/2016/04/build-beautifully-for-android-wear.html
|
||||
/// </summary>
|
||||
public class XamarinAndroidWearApplicationProject : XamarinAndroidApplicationProject
|
||||
{
|
||||
static readonly string default_strings_xml, default_main_activity;
|
||||
static readonly string default_layout_main, default_layout_rect_main, default_layout_round_main;
|
||||
static readonly string default_layout_rect_main, default_layout_round_main;
|
||||
|
||||
static XamarinAndroidWearApplicationProject ()
|
||||
{
|
||||
|
@ -17,8 +22,6 @@ namespace Xamarin.ProjectTools
|
|||
default_main_activity = sr.ReadToEnd ();
|
||||
using (var sr = new StreamReader (typeof(XamarinAndroidApplicationProject).Assembly.GetManifestResourceStream ("Xamarin.ProjectTools.Resources.Wear.Strings.xml")))
|
||||
default_strings_xml = sr.ReadToEnd ();
|
||||
using (var sr = new StreamReader (typeof(XamarinAndroidApplicationProject).Assembly.GetManifestResourceStream ("Xamarin.ProjectTools.Resources.Wear.LayoutMain.axml")))
|
||||
default_layout_main = sr.ReadToEnd ();
|
||||
using (var sr = new StreamReader (typeof(XamarinAndroidApplicationProject).Assembly.GetManifestResourceStream ("Xamarin.ProjectTools.Resources.Wear.LayoutRectMain.axml")))
|
||||
default_layout_rect_main = sr.ReadToEnd ();
|
||||
using (var sr = new StreamReader (typeof(XamarinAndroidApplicationProject).Assembly.GetManifestResourceStream ("Xamarin.ProjectTools.Resources.Wear.LayoutRoundMain.axml")))
|
||||
|
@ -28,16 +31,23 @@ namespace Xamarin.ProjectTools
|
|||
public XamarinAndroidWearApplicationProject (string debugConfigurationName = "Debug", string releaseConfigurationName = "Release", [CallerMemberName] string packageName = "")
|
||||
: base (debugConfigurationName, releaseConfigurationName, packageName)
|
||||
{
|
||||
PackageReferences.Add (KnownPackages.AndroidWear_2_2_0);
|
||||
PackageReferences.Add (KnownPackages.XamarinAndroidXWear);
|
||||
|
||||
// uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library androidx.wear.wear.aar as the library might be using APIs not available in 21
|
||||
SupportedOSPlatformVersion = "23";
|
||||
|
||||
MainActivity = default_main_activity;
|
||||
StringsXml = default_strings_xml;
|
||||
LayoutMain = default_layout_main;
|
||||
LayoutRectMain = default_layout_rect_main;
|
||||
LayoutRoundMain = default_layout_round_main;
|
||||
|
||||
AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\layout\\RectangleMain.axml") { TextContent = () => LayoutRectMain });
|
||||
AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\layout\\RoundMain.axml") { TextContent = () => LayoutRoundMain });
|
||||
// Remove Resources\layout\Main.axml
|
||||
var main = AndroidResources.FirstOrDefault (a => a.Include () == "Resources\\layout\\Main.axml");
|
||||
if (main != null)
|
||||
AndroidResources.Remove (main);
|
||||
|
||||
AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\layout-notround\\activity_main.axml") { TextContent = () => LayoutRectMain });
|
||||
AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\layout-round\\activity_main.axml") { TextContent = () => LayoutRoundMain });
|
||||
}
|
||||
|
||||
public string LayoutRectMain { get; set; }
|
||||
|
|
|
@ -43,7 +43,11 @@ namespace Xamarin.ProjectTools
|
|||
{
|
||||
// Don't opt into ImplicitUsings
|
||||
RemoveProperty (KnownProperties.ImplicitUsings);
|
||||
PackageReferences.Add (KnownPackages.XamarinForms_4_7_0_1142);
|
||||
PackageReferences.Add (KnownPackages.XamarinForms);
|
||||
|
||||
// Workarounds for Guava.ListenableFuture
|
||||
// See: https://github.com/xamarin/AndroidX/issues/535
|
||||
PackageReferences.Add (KnownPackages.AndroidXBrowser);
|
||||
|
||||
AndroidResources.Add (new AndroidItem.AndroidResource ("Resources\\values\\colors.xml") {
|
||||
TextContent = () => colors_xml,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
|
@ -17,7 +17,7 @@ namespace Xamarin.ProjectTools
|
|||
public XamarinFormsMapsApplicationProject ([CallerMemberName] string packageName = "")
|
||||
: base (packageName: packageName)
|
||||
{
|
||||
PackageReferences.Add (KnownPackages.XamarinFormsMaps_4_7_0_1142);
|
||||
PackageReferences.Add (KnownPackages.XamarinFormsMaps);
|
||||
PackageReferences.Add (KnownPackages.Xamarin_GooglePlayServices_Base);
|
||||
PackageReferences.Add (KnownPackages.Xamarin_GooglePlayServices_Basement);
|
||||
PackageReferences.Add (KnownPackages.Xamarin_GooglePlayServices_Maps);
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
"Comment": null,
|
||||
"Entries": {
|
||||
"AndroidManifest.xml": {
|
||||
"Size": 3904
|
||||
"Size": 6652
|
||||
},
|
||||
"assemblies/_Microsoft.Android.Resource.Designer.dll": {
|
||||
"Size": 2281
|
||||
},
|
||||
"assemblies/FormsViewGroup.dll": {
|
||||
"Size": 8099
|
||||
"Size": 8100
|
||||
},
|
||||
"assemblies/Java.Interop.dll": {
|
||||
"Size": 69705
|
||||
},
|
||||
"assemblies/Mono.Android.dll": {
|
||||
"Size": 456294
|
||||
"Size": 458238
|
||||
},
|
||||
"assemblies/Mono.Android.Runtime.dll": {
|
||||
"Size": 5148
|
||||
"Size": 5151
|
||||
},
|
||||
"assemblies/mscorlib.dll": {
|
||||
"Size": 4052
|
||||
"Size": 4002
|
||||
},
|
||||
"assemblies/netstandard.dll": {
|
||||
"Size": 5643
|
||||
|
@ -95,7 +95,7 @@
|
|||
"Size": 8699
|
||||
},
|
||||
"assemblies/System.Private.CoreLib.dll": {
|
||||
"Size": 850036
|
||||
"Size": 849922
|
||||
},
|
||||
"assemblies/System.Private.DataContractSerialization.dll": {
|
||||
"Size": 193991
|
||||
|
@ -140,13 +140,13 @@
|
|||
"Size": 5015
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.Activity.dll": {
|
||||
"Size": 13842
|
||||
"Size": 16149
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.AppCompat.AppCompatResources.dll": {
|
||||
"Size": 6227
|
||||
"Size": 6225
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.AppCompat.dll": {
|
||||
"Size": 134494
|
||||
"Size": 138721
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.CardView.dll": {
|
||||
"Size": 6977
|
||||
|
@ -155,67 +155,85 @@
|
|||
"Size": 17886
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.Core.dll": {
|
||||
"Size": 120018
|
||||
"Size": 127505
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.CursorAdapter.dll": {
|
||||
"Size": 9002
|
||||
"Size": 8997
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.DrawerLayout.dll": {
|
||||
"Size": 15330
|
||||
"Size": 15319
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.Fragment.dll": {
|
||||
"Size": 45683
|
||||
"Size": 51744
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.Legacy.Support.Core.UI.dll": {
|
||||
"Size": 6242
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.Lifecycle.Common.dll": {
|
||||
"Size": 6574
|
||||
"Size": 6900
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.Lifecycle.LiveData.Core.dll": {
|
||||
"Size": 6749
|
||||
"Size": 6743
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.Lifecycle.ViewModel.dll": {
|
||||
"Size": 6289
|
||||
"Size": 7011
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.Loader.dll": {
|
||||
"Size": 13087
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.MultiDex.dll": {
|
||||
"Size": 8354
|
||||
"Size": 13082
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.RecyclerView.dll": {
|
||||
"Size": 93990
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.SavedState.dll": {
|
||||
"Size": 4969
|
||||
"Size": 5114
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.SwipeRefreshLayout.dll": {
|
||||
"Size": 13974
|
||||
},
|
||||
"assemblies/Xamarin.AndroidX.ViewPager.dll": {
|
||||
"Size": 19073
|
||||
"Size": 19060
|
||||
},
|
||||
"assemblies/Xamarin.Forms.Core.dll": {
|
||||
"Size": 561410
|
||||
"Size": 565831
|
||||
},
|
||||
"assemblies/Xamarin.Forms.Platform.Android.dll": {
|
||||
"Size": 372848
|
||||
"Size": 374486
|
||||
},
|
||||
"assemblies/Xamarin.Forms.Platform.dll": {
|
||||
"Size": 17182
|
||||
"Size": 18767
|
||||
},
|
||||
"assemblies/Xamarin.Forms.Xaml.dll": {
|
||||
"Size": 63517
|
||||
"Size": 63655
|
||||
},
|
||||
"assemblies/Xamarin.Google.Android.Material.dll": {
|
||||
"Size": 66417
|
||||
},
|
||||
"assemblies/Xamarin.Google.Guava.ListenableFuture.dll": {
|
||||
"Size": 10640
|
||||
},
|
||||
"classes.dex": {
|
||||
"Size": 5908848
|
||||
"Size": 9458972
|
||||
},
|
||||
"classes2.dex": {
|
||||
"Size": 103648
|
||||
},
|
||||
"kotlin/annotation/annotation.kotlin_builtins": {
|
||||
"Size": 928
|
||||
},
|
||||
"kotlin/collections/collections.kotlin_builtins": {
|
||||
"Size": 3685
|
||||
},
|
||||
"kotlin/coroutines/coroutines.kotlin_builtins": {
|
||||
"Size": 200
|
||||
},
|
||||
"kotlin/internal/internal.kotlin_builtins": {
|
||||
"Size": 646
|
||||
},
|
||||
"kotlin/kotlin.kotlin_builtins": {
|
||||
"Size": 18640
|
||||
},
|
||||
"kotlin/ranges/ranges.kotlin_builtins": {
|
||||
"Size": 3399
|
||||
},
|
||||
"kotlin/reflect/reflect.kotlin_builtins": {
|
||||
"Size": 2396
|
||||
},
|
||||
"lib/arm64-v8a/libmono-component-marshal-ilgen.so": {
|
||||
"Size": 87080
|
||||
|
@ -236,7 +254,7 @@
|
|||
"Size": 155568
|
||||
},
|
||||
"lib/arm64-v8a/libxamarin-app.so": {
|
||||
"Size": 113968
|
||||
"Size": 115280
|
||||
},
|
||||
"META-INF/androidx.activity_activity.version": {
|
||||
"Size": 6
|
||||
|
@ -251,13 +269,13 @@
|
|||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.arch.core_core-runtime.version": {
|
||||
"Size": 6
|
||||
"Size": 67
|
||||
},
|
||||
"META-INF/androidx.asynclayoutinflater_asynclayoutinflater.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.browser_browser.version": {
|
||||
"Size": 6
|
||||
"Size": 60
|
||||
},
|
||||
"META-INF/androidx.cardview_cardview.version": {
|
||||
"Size": 6
|
||||
|
@ -265,9 +283,12 @@
|
|||
"META-INF/androidx.coordinatorlayout_coordinatorlayout.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.core_core.version": {
|
||||
"META-INF/androidx.core_core-ktx.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.core_core.version": {
|
||||
"Size": 7
|
||||
},
|
||||
"META-INF/androidx.cursoradapter_cursoradapter.version": {
|
||||
"Size": 6
|
||||
},
|
||||
|
@ -283,6 +304,12 @@
|
|||
"META-INF/androidx.dynamicanimation_dynamicanimation.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.emoji2_emoji2-views-helper.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.emoji2_emoji2.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.fragment_fragment.version": {
|
||||
"Size": 6
|
||||
},
|
||||
|
@ -304,9 +331,12 @@
|
|||
"META-INF/androidx.lifecycle_lifecycle-livedata.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.lifecycle_lifecycle-runtime.version": {
|
||||
"META-INF/androidx.lifecycle_lifecycle-process.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.lifecycle_lifecycle-runtime.version": {
|
||||
"Size": 72
|
||||
},
|
||||
"META-INF/androidx.lifecycle_lifecycle-viewmodel-savedstate.version": {
|
||||
"Size": 6
|
||||
},
|
||||
|
@ -337,6 +367,9 @@
|
|||
"META-INF/androidx.print_print.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.profileinstaller_profileinstaller.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.recyclerview_recyclerview.version": {
|
||||
"Size": 6
|
||||
},
|
||||
|
@ -346,6 +379,9 @@
|
|||
"META-INF/androidx.slidingpanelayout_slidingpanelayout.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.startup_startup-runtime.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/androidx.swiperefreshlayout_swiperefreshlayout.version": {
|
||||
"Size": 6
|
||||
},
|
||||
|
@ -374,13 +410,34 @@
|
|||
"Size": 1223
|
||||
},
|
||||
"META-INF/BNDLTOOL.SF": {
|
||||
"Size": 89914
|
||||
"Size": 97490
|
||||
},
|
||||
"META-INF/com.android.tools/proguard/coroutines.pro": {
|
||||
"Size": 1345
|
||||
},
|
||||
"META-INF/com.android.tools/r8-from-1.6.0/coroutines.pro": {
|
||||
"Size": 899
|
||||
},
|
||||
"META-INF/com.android.tools/r8-upto-3.0.0/coroutines.pro": {
|
||||
"Size": 558
|
||||
},
|
||||
"META-INF/com.android.tools/r8/coroutines.pro": {
|
||||
"Size": 1190
|
||||
},
|
||||
"META-INF/com.google.android.material_material.version": {
|
||||
"Size": 6
|
||||
},
|
||||
"META-INF/kotlin-project-structure-metadata.json": {
|
||||
"Size": 552
|
||||
},
|
||||
"META-INF/kotlinx_coroutines_android.version": {
|
||||
"Size": 5
|
||||
},
|
||||
"META-INF/kotlinx_coroutines_core.version": {
|
||||
"Size": 5
|
||||
},
|
||||
"META-INF/MANIFEST.MF": {
|
||||
"Size": 89787
|
||||
"Size": 97363
|
||||
},
|
||||
"META-INF/maven/com.google.guava/listenablefuture/pom.properties": {
|
||||
"Size": 96
|
||||
|
@ -391,6 +448,15 @@
|
|||
"META-INF/proguard/androidx-annotations.pro": {
|
||||
"Size": 433
|
||||
},
|
||||
"META-INF/proguard/coroutines.pro": {
|
||||
"Size": 1363
|
||||
},
|
||||
"META-INF/services/kotlinx.coroutines.CoroutineExceptionHandler": {
|
||||
"Size": 54
|
||||
},
|
||||
"META-INF/services/kotlinx.coroutines.internal.MainDispatcherFactory": {
|
||||
"Size": 52
|
||||
},
|
||||
"res/anim-v21/design_bottom_sheet_slide_in.xml": {
|
||||
"Size": 616
|
||||
},
|
||||
|
@ -916,6 +982,24 @@
|
|||
"res/color/test_mtrl_calendar_day.xml": {
|
||||
"Size": 340
|
||||
},
|
||||
"res/drawable-anydpi-v21/ic_call_answer_low.xml": {
|
||||
"Size": 1320
|
||||
},
|
||||
"res/drawable-anydpi-v21/ic_call_answer_video_low.xml": {
|
||||
"Size": 736
|
||||
},
|
||||
"res/drawable-anydpi-v21/ic_call_answer_video.xml": {
|
||||
"Size": 772
|
||||
},
|
||||
"res/drawable-anydpi-v21/ic_call_answer.xml": {
|
||||
"Size": 1356
|
||||
},
|
||||
"res/drawable-anydpi-v21/ic_call_decline_low.xml": {
|
||||
"Size": 1492
|
||||
},
|
||||
"res/drawable-anydpi-v21/ic_call_decline.xml": {
|
||||
"Size": 1528
|
||||
},
|
||||
"res/drawable-hdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png": {
|
||||
"Size": 272
|
||||
},
|
||||
|
@ -1015,6 +1099,24 @@
|
|||
"res/drawable-hdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png": {
|
||||
"Size": 178
|
||||
},
|
||||
"res/drawable-hdpi-v4/ic_call_answer_low.png": {
|
||||
"Size": 472
|
||||
},
|
||||
"res/drawable-hdpi-v4/ic_call_answer_video_low.png": {
|
||||
"Size": 254
|
||||
},
|
||||
"res/drawable-hdpi-v4/ic_call_answer_video.png": {
|
||||
"Size": 254
|
||||
},
|
||||
"res/drawable-hdpi-v4/ic_call_answer.png": {
|
||||
"Size": 472
|
||||
},
|
||||
"res/drawable-hdpi-v4/ic_call_decline_low.png": {
|
||||
"Size": 375
|
||||
},
|
||||
"res/drawable-hdpi-v4/ic_call_decline.png": {
|
||||
"Size": 375
|
||||
},
|
||||
"res/drawable-hdpi-v4/icon.png": {
|
||||
"Size": 2178
|
||||
},
|
||||
|
@ -1033,6 +1135,24 @@
|
|||
"res/drawable-hdpi-v4/notify_panel_notification_icon_bg.png": {
|
||||
"Size": 107
|
||||
},
|
||||
"res/drawable-ldpi-v4/ic_call_answer_low.png": {
|
||||
"Size": 270
|
||||
},
|
||||
"res/drawable-ldpi-v4/ic_call_answer_video_low.png": {
|
||||
"Size": 199
|
||||
},
|
||||
"res/drawable-ldpi-v4/ic_call_answer_video.png": {
|
||||
"Size": 199
|
||||
},
|
||||
"res/drawable-ldpi-v4/ic_call_answer.png": {
|
||||
"Size": 270
|
||||
},
|
||||
"res/drawable-ldpi-v4/ic_call_decline_low.png": {
|
||||
"Size": 201
|
||||
},
|
||||
"res/drawable-ldpi-v4/ic_call_decline.png": {
|
||||
"Size": 201
|
||||
},
|
||||
"res/drawable-ldrtl-hdpi-v17/abc_spinner_mtrl_am_alpha.9.png": {
|
||||
"Size": 345
|
||||
},
|
||||
|
@ -1147,6 +1267,24 @@
|
|||
"res/drawable-mdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png": {
|
||||
"Size": 178
|
||||
},
|
||||
"res/drawable-mdpi-v4/ic_call_answer_low.png": {
|
||||
"Size": 317
|
||||
},
|
||||
"res/drawable-mdpi-v4/ic_call_answer_video_low.png": {
|
||||
"Size": 206
|
||||
},
|
||||
"res/drawable-mdpi-v4/ic_call_answer_video.png": {
|
||||
"Size": 206
|
||||
},
|
||||
"res/drawable-mdpi-v4/ic_call_answer.png": {
|
||||
"Size": 317
|
||||
},
|
||||
"res/drawable-mdpi-v4/ic_call_decline_low.png": {
|
||||
"Size": 264
|
||||
},
|
||||
"res/drawable-mdpi-v4/ic_call_decline.png": {
|
||||
"Size": 264
|
||||
},
|
||||
"res/drawable-mdpi-v4/icon.png": {
|
||||
"Size": 1490
|
||||
},
|
||||
|
@ -1303,6 +1441,24 @@
|
|||
"res/drawable-xhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png": {
|
||||
"Size": 182
|
||||
},
|
||||
"res/drawable-xhdpi-v4/ic_call_answer_low.png": {
|
||||
"Size": 623
|
||||
},
|
||||
"res/drawable-xhdpi-v4/ic_call_answer_video_low.png": {
|
||||
"Size": 290
|
||||
},
|
||||
"res/drawable-xhdpi-v4/ic_call_answer_video.png": {
|
||||
"Size": 290
|
||||
},
|
||||
"res/drawable-xhdpi-v4/ic_call_answer.png": {
|
||||
"Size": 623
|
||||
},
|
||||
"res/drawable-xhdpi-v4/ic_call_decline_low.png": {
|
||||
"Size": 452
|
||||
},
|
||||
"res/drawable-xhdpi-v4/ic_call_decline.png": {
|
||||
"Size": 452
|
||||
},
|
||||
"res/drawable-xhdpi-v4/icon.png": {
|
||||
"Size": 3098
|
||||
},
|
||||
|
@ -1420,6 +1576,24 @@
|
|||
"res/drawable-xxhdpi-v4/abc_textfield_search_default_mtrl_alpha.9.png": {
|
||||
"Size": 186
|
||||
},
|
||||
"res/drawable-xxhdpi-v4/ic_call_answer_low.png": {
|
||||
"Size": 884
|
||||
},
|
||||
"res/drawable-xxhdpi-v4/ic_call_answer_video_low.png": {
|
||||
"Size": 384
|
||||
},
|
||||
"res/drawable-xxhdpi-v4/ic_call_answer_video.png": {
|
||||
"Size": 384
|
||||
},
|
||||
"res/drawable-xxhdpi-v4/ic_call_answer.png": {
|
||||
"Size": 884
|
||||
},
|
||||
"res/drawable-xxhdpi-v4/ic_call_decline_low.png": {
|
||||
"Size": 628
|
||||
},
|
||||
"res/drawable-xxhdpi-v4/ic_call_decline.png": {
|
||||
"Size": 628
|
||||
},
|
||||
"res/drawable-xxhdpi-v4/icon.png": {
|
||||
"Size": 4674
|
||||
},
|
||||
|
@ -1462,6 +1636,24 @@
|
|||
"res/drawable-xxxhdpi-v4/abc_text_select_handle_right_mtrl.png": {
|
||||
"Size": 513
|
||||
},
|
||||
"res/drawable-xxxhdpi-v4/ic_call_answer_low.png": {
|
||||
"Size": 1171
|
||||
},
|
||||
"res/drawable-xxxhdpi-v4/ic_call_answer_video_low.png": {
|
||||
"Size": 465
|
||||
},
|
||||
"res/drawable-xxxhdpi-v4/ic_call_answer_video.png": {
|
||||
"Size": 465
|
||||
},
|
||||
"res/drawable-xxxhdpi-v4/ic_call_answer.png": {
|
||||
"Size": 1171
|
||||
},
|
||||
"res/drawable-xxxhdpi-v4/ic_call_decline_low.png": {
|
||||
"Size": 823
|
||||
},
|
||||
"res/drawable-xxxhdpi-v4/ic_call_decline.png": {
|
||||
"Size": 823
|
||||
},
|
||||
"res/drawable-xxxhdpi-v4/icon.png": {
|
||||
"Size": 6832
|
||||
},
|
||||
|
@ -1732,6 +1924,9 @@
|
|||
"res/drawable/test_custom_background.xml": {
|
||||
"Size": 336
|
||||
},
|
||||
"res/drawable/test_level_drawable.xml": {
|
||||
"Size": 448
|
||||
},
|
||||
"res/drawable/tooltip_frame_dark.xml": {
|
||||
"Size": 484
|
||||
},
|
||||
|
@ -1850,7 +2045,7 @@
|
|||
"Size": 1536
|
||||
},
|
||||
"res/layout/abc_alert_dialog_material.xml": {
|
||||
"Size": 2476
|
||||
"Size": 2648
|
||||
},
|
||||
"res/layout/abc_alert_dialog_title_material.xml": {
|
||||
"Size": 1560
|
||||
|
@ -2279,8 +2474,8 @@
|
|||
"Size": 268
|
||||
},
|
||||
"resources.arsc": {
|
||||
"Size": 777972
|
||||
"Size": 812848
|
||||
}
|
||||
},
|
||||
"PackageSize": 9593384
|
||||
"PackageSize": 10864931
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.wearable.view.WatchViewStub xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/watch_view_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:rectLayout="@layout/RectangleMain"
|
||||
app:roundLayout="@layout/RoundMain"
|
||||
tools:context=".MainActivity"
|
||||
tools:deviceIds="wear" />
|
|
@ -1,13 +1,12 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using Android.Runtime;
|
||||
using Android.Support.V4.App;
|
||||
using Android.Support.Wearable.Views;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using AndroidX.Core.App;
|
||||
//${USINGS}
|
||||
|
||||
namespace ${ROOT_NAMESPACE}
|
||||
|
@ -22,26 +21,22 @@ namespace ${ROOT_NAMESPACE}
|
|||
base.OnCreate (bundle);
|
||||
|
||||
// Set our view from the "main" layout resource
|
||||
SetContentView (Resource.Layout.Main);
|
||||
SetContentView (Resource.Layout.activity_main);
|
||||
|
||||
var v = FindViewById<WatchViewStub> (Resource.Id.watch_view_stub);
|
||||
v.LayoutInflated += delegate {
|
||||
// Get our button from the layout resource,
|
||||
// and attach an event to it
|
||||
Button button = FindViewById<Button> (Resource.Id.myButton);
|
||||
|
||||
// Get our button from the layout resource,
|
||||
// and attach an event to it
|
||||
Button button = FindViewById<Button> (Resource.Id.myButton);
|
||||
button.Click += delegate {
|
||||
var notification = new NotificationCompat.Builder (this)
|
||||
.SetContentTitle ("Button tapped")
|
||||
.SetContentText ("Button tapped " + count++ + " times!")
|
||||
.SetSmallIcon (Android.Resource.Drawable.StatNotifyVoicemail)
|
||||
.SetGroup ("group_key_demo").Build ();
|
||||
|
||||
button.Click += delegate {
|
||||
var notification = new NotificationCompat.Builder (this)
|
||||
.SetContentTitle ("Button tapped")
|
||||
.SetContentText ("Button tapped " + count++ + " times!")
|
||||
.SetSmallIcon (Android.Resource.Drawable.StatNotifyVoicemail)
|
||||
.SetGroup ("group_key_demo").Build ();
|
||||
|
||||
var manager = NotificationManagerCompat.From (this);
|
||||
manager.Notify (1, notification);
|
||||
button.Text = "Check Notification!";
|
||||
};
|
||||
var manager = NotificationManagerCompat.From (this);
|
||||
manager.Notify (1, notification);
|
||||
button.Text = "Check Notification!";
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -483,6 +483,21 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
|
|||
/>
|
||||
</Target>
|
||||
|
||||
<Target Name="_CheckUnsupportedPackages" AfterTargets="ResolvePackageAssets">
|
||||
<ItemGroup>
|
||||
<_AndroidUnsupportedPackages
|
||||
Include="%(ResolvedCompileFileDefinitions.NuGetPackageId)"
|
||||
Condition=" '%(ResolvedCompileFileDefinitions.NuGetPackageId)' != '' and
|
||||
( $([System.String]::Copy(%(ResolvedCompileFileDefinitions.NuGetPackageId)).StartsWith ('Xamarin.Android.Arch.')) or
|
||||
$([System.String]::Copy(%(ResolvedCompileFileDefinitions.NuGetPackageId)).StartsWith ('Xamarin.Android.Support.')) )"
|
||||
/>
|
||||
</ItemGroup>
|
||||
<AndroidError Code="XA1039"
|
||||
ResourceName="XA1039"
|
||||
Condition=" '@(_AndroidUnsupportedPackages->Count())' != '0' "
|
||||
/>
|
||||
</Target>
|
||||
|
||||
<Target Name="_CheckNonIdealConfigurations">
|
||||
<AndroidWarning Code="XA0119"
|
||||
ResourceName="XA0119_AOT"
|
||||
|
@ -1528,6 +1543,10 @@ because xbuild doesn't support framework reference assemblies.
|
|||
<Output TaskParameter="GeneratedBinaryTypeMaps" ItemName="_AndroidTypeMapping" Condition=" '$(_InstantRunEnabled)' == 'True' " />
|
||||
</GenerateJavaStubs>
|
||||
|
||||
<ItemGroup Condition=" '$(_InstantRunEnabled)' == 'True' and '@(_AndroidTypeMapping->Count())' == '0' ">
|
||||
<_AndroidTypeMapping Include="$(_NativeAssemblySourceDir)typemaps\*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="@(_TypeMapAssemblySource)" />
|
||||
<FileWrites Include="@(_TypeMapAssemblyInclude)" />
|
||||
|
|
|
@ -9,7 +9,7 @@ using Android.OS;
|
|||
|
||||
namespace UnnamedProject
|
||||
{
|
||||
[Register("unnamedproject.unnamedproject.MainActivity"), Activity(Label = "UnnamedProject", MainLauncher = true, Icon = "@drawable/icon")]
|
||||
[Register("unnamedproject.unnamedproject.MainActivity"), Activity(Label = "UnnamedProject", MainLauncher = true, Icon = "@drawable/icon", Theme = "@style/MainTheme")]
|
||||
public class MainActivity : Activity
|
||||
{
|
||||
int count = 1;
|
||||
|
|
|
@ -257,13 +257,7 @@ namespace Library1 {
|
|||
new BuildItem ("ProjectReference", "..\\LinkTestLib\\LinkTestLib.csproj"),
|
||||
},
|
||||
PackageReferences = {
|
||||
KnownPackages.AndroidXMigration,
|
||||
KnownPackages.AndroidXAppCompat,
|
||||
KnownPackages.AndroidXAppCompatResources,
|
||||
KnownPackages.AndroidXBrowser,
|
||||
KnownPackages.AndroidXMediaRouter,
|
||||
KnownPackages.AndroidXLegacySupportV4,
|
||||
KnownPackages.AndroidXLifecycleLiveData,
|
||||
KnownPackages.XamarinGoogleAndroidMaterial,
|
||||
},
|
||||
Sources = {
|
||||
|
|
|
@ -142,9 +142,8 @@ namespace Xamarin.Android.Build.Tests
|
|||
AndroidFastDeploymentType = "Assemblies:Dexes",
|
||||
};
|
||||
proj.SetDefaultTargetDevice ();
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidSupportV4_27_0_2_1);
|
||||
proj.PackageReferences.Add (KnownPackages.SupportV7AppCompat_27_0_2_1);
|
||||
proj.MainActivity = proj.DefaultMainActivity.Replace (": Activity", ": Android.Support.V7.App.AppCompatActivity");
|
||||
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
|
||||
proj.MainActivity = proj.DefaultMainActivity.Replace (": Activity", ": AndroidX.AppCompat.App.AppCompatActivity");
|
||||
var b = CreateApkBuilder (Path.Combine ("temp", TestName));
|
||||
Assert.IsTrue (b.Install (proj), "install should have succeeded.");
|
||||
File.WriteAllLines (Path.Combine (Root, b.ProjectDirectory, b.BuildLogFile + ".bak"), b.LastBuildOutput);
|
||||
|
@ -156,8 +155,14 @@ namespace Xamarin.Android.Build.Tests
|
|||
Assert.IsTrue (b.Install (proj, doNotCleanupOnUpdate: true, saveProject: false), "install should have succeeded.");
|
||||
Assert.IsFalse (b.Output.IsApkInstalled, "app apk was installed");
|
||||
Assert.IsTrue (b.LastBuildOutput.Any (l => l.Contains ("UnnamedProject.dll") && l.Contains ("NotifySync CopyFile")), "app dll not uploaded");
|
||||
Assert.IsTrue (b.LastBuildOutput.Any (l => l.Contains ("Xamarin.Android.Support.v4.dll") && l.Contains ("NotifySync SkipCopyFile")), "v4 should be skipped, but no relevant log line");
|
||||
Assert.IsTrue (b.LastBuildOutput.Any (l => l.Contains ("Xamarin.Android.Support.v7.AppCompat.dll") && l.Contains ("NotifySync SkipCopyFile")), "v7 should be skipped, but no relevant log line");
|
||||
|
||||
var assemblies = new[] {
|
||||
"Xamarin.AndroidX.AppCompat.dll",
|
||||
"Xamarin.AndroidX.Core.dll",
|
||||
};
|
||||
foreach (var assembly in assemblies) {
|
||||
Assert.IsTrue (b.LastBuildOutput.Any (l => l.Contains (assembly) && l.Contains ("NotifySync SkipCopyFile")), $"{assembly} should be skipped, but no relevant log line");
|
||||
}
|
||||
|
||||
Assert.IsTrue (b.Uninstall (proj), "uninstall should have succeeded.");
|
||||
b.Dispose ();
|
||||
|
@ -166,7 +171,7 @@ namespace Xamarin.Android.Build.Tests
|
|||
#pragma warning disable 414
|
||||
static object [] SkipFastDevAlreadyInstalledResourcesSource = new object [] {
|
||||
new object[] { Array.Empty<Package> (), null },
|
||||
new object[] { new Package [] { KnownPackages.AndroidSupportV4_27_0_2_1, KnownPackages.SupportV7AppCompat_27_0_2_1}, "Android.Support.V7.App.AppCompatActivity" },
|
||||
new object[] { new Package [] { KnownPackages.AndroidXAppCompat }, "AndroidX.AppCompat.App.AppCompatActivity" },
|
||||
};
|
||||
#pragma warning restore 414
|
||||
|
||||
|
|
|
@ -323,7 +323,8 @@ namespace Xamarin.Android.Build.Tests
|
|||
app.Sources.Add (new BuildItem.Source ("Foo.cs") {
|
||||
TextContent = () => "public class Foo : Bar { }"
|
||||
});
|
||||
app.PackageReferences.Add (KnownPackages.XamarinForms_4_0_0_425677);
|
||||
app.PackageReferences.Add (KnownPackages.XamarinForms);
|
||||
app.PackageReferences.Add (KnownPackages.AndroidXBrowser); // Guava.ListenableFuture: https://github.com/xamarin/AndroidX/issues/535
|
||||
//NOTE: this will skip a 382ms <VerifyVersionsTask/> from the support library
|
||||
app.SetProperty ("XamarinAndroidSupportSkipVerifyVersions", "True");
|
||||
|
||||
|
@ -341,7 +342,7 @@ namespace Xamarin.Android.Build.Tests
|
|||
}
|
||||
},
|
||||
PackageReferences = {
|
||||
KnownPackages.XamarinForms_4_0_0_425677
|
||||
KnownPackages.XamarinForms,
|
||||
}
|
||||
};
|
||||
lib.SetProperty ("ProduceReferenceAssembly", produceReferenceAssembly.ToString ());
|
||||
|
|
Загрузка…
Ссылка в новой задаче