-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] Improved Fast Deployment (#609)
Context: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.0/#Fast_Deployment Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=55050 What do we want? To fast deploy *all the things*! Not just assemblies, as is currently supported, but `.dex` files, Android resources, Android assets, shared libraries (`.so` files), the works. If we can avoid updating and re-installing the `.apk`, we want to do so. TODO: Support Fast Deployment of `.jm` and `.mj` files; see #1917 *How* do we do that? Previously, we used `StubApplication.java`, which would "work some magic" to better support loading types from multiple `.dex` files, allow loading Android Resources from multiple locations, etc. The problem with `StubApplication.java` is that it's "too late" in process startup: certain constructs such as `ContentProvider`s are created *before* the `andorid.app.Application` instance is created, meaning those constructs couldn't be handled like the rest of multidex. Avoid that special case by "moving" the `StubApplication.java` logic into the new `MultiDexLoader` types, which are `ContentProvider`s in the spirit of `MonoRuntimeProvider`, and are thus created *before* the `Application` is created. This in turn allows `Application` subclasses to be located *outside* the default `classes.dex` file (multidex!), while still allowing the `Application` type to be resolved and instantiated. Add a new `ResourcePatcher` ContentProvider which "fixes up" various Android types to permit looking up Android Resources from their fast deployment locations. Previously, resource patching required that the Application be created, which prevented custom `Application` types in a multidex environment (it couldn't be found). Moving Resource patching into a separate content provider allows separation of responsibility, and supports custom `Application` subclasses. Finally, rework `monodroid-glue.c` to copy over any `.so` files which are found in the `.__override__` directory into the local app directory, as **dlopen**(3) won't load `.so` files located outside of the local app directory. This enables fast deployment of native libraries.
- Loading branch information
1 parent
6c2cb23
commit 3f360c0
Showing
43 changed files
with
1,872 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> | ||
<HasSharedItems>true</HasSharedItems> | ||
<SharedGUID>{0AB4956E-6FB9-4DA0-9D49-AB65A3FF403A}</SharedGUID> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Configuration"> | ||
<Import_RootNamespace>Mono.Android-Test.Shared</Import_RootNamespace> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Resources\Resource.designer.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Properties\AssemblyInfo.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.App\ApplicationTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.Content\IntentTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.Runtime\CharSequenceTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.Runtime\JavaCollectionTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.Runtime\JnienvArrayMarshaling.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.Runtime\XmlReaderPullParserTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.Runtime\XmlReaderResourceParserTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.Widget\AdapterTests.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Java.Interop\JavaConvertTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Java.Lang\ObjectArrayMarshaling.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Java.Lang\ObjectTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Java.Interop\JnienvTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System\AppDomainTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System\AssemblyInformationalVersionAttributeTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System\ExceptionTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System\TimeZoneTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System.IO\DriveInfoTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System.IO.Compression\GZipStreamTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System.Net\ProxyTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System.Net\SslTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System.Net\NetworkInterfaces.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\System.Threading\InterlockedTest.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Java.Interop\JavaObjectExtensionsTests.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Xamarin.Android.Net\AndroidClientHandlerTests.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Xamarin.Android.Net\HttpClientIntegrationTests.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Xamarin.Android.RuntimeTests\MainActivity.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Xamarin.Android.RuntimeTests\MyIntent.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Xamarin.Android.RuntimeTests\NonJavaObject.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Xamarin.Android.RuntimeTests\TestInstrumentation.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\Android.OS\BundleTest.cs" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<ProjectGuid>{0AB4956E-6FB9-4DA0-9D49-AB65A3FF403A}</ProjectGuid> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" /> | ||
<Import Project="Mono.Android-Test.Shared.projitems" Label="Shared" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.