Skip to content

Commit

Permalink
[Xamarim.Android.Build.Tasks] Add support for new InstantRun
Browse files Browse the repository at this point in the history
This commit does a couple of things.

1) It reworks the monodroid-glue to copy any .so file it finds
in the .__override__ directory over to the local app directory.
This should allow us to fast deploy native libraries. Which means
we no longer need to re-build the apk if a native library changes.

2) Replaces the StubApplication with a new MultiDexLoader
ContentProvider. This provider is reposible for doing all the things
the previous StubApplication used to do. But because it is not
derived from an Application it means we can now support custom
Application types for our debug builds.
  • Loading branch information
dellis1972 committed Jun 15, 2017
1 parent c0ea8a5 commit a2ad397
Show file tree
Hide file tree
Showing 33 changed files with 959 additions and 114 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ run-ji-tests:
TEST_APK_PROJECTS = \
src/Mono.Android/Test/Mono.Android-Tests.csproj \
tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj \
tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj
tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj \
tests/Runtime-MultiDex/Mono.Android-TestsMultiDex.csproj

# Syntax: $(call BUILD_TEST_APK,path/to/project.csproj)
define BUILD_TEST_APK
Expand Down
44 changes: 44 additions & 0 deletions src/Mono.Android/Test/Mono.Android-Test.Shared.projitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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" />
</ItemGroup>
</Project>
11 changes: 11 additions & 0 deletions src/Mono.Android/Test/Mono.Android-Test.Shared.shproj
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>
54 changes: 1 addition & 53 deletions src/Mono.Android/Test/Mono.Android-Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
</PropertyGroup>
<Import Project="Mono.Android-Test.Shared.projitems" Label="Shared" Condition="Exists('Mono.Android-Test.Shared.projitems')" />
<Import Project="..\..\..\Configuration.props" />
<PropertyGroup>
<TargetFrameworkVersion>$(AndroidFrameworkVersion)</TargetFrameworkVersion>
Expand Down Expand Up @@ -52,39 +53,6 @@
<Reference Include="Mono.Android.Export" />
<Reference Include="Xamarin.Android.NUnitLite" />
</ItemGroup>
<ItemGroup>
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Android.App\ApplicationTest.cs" />
<Compile Include="Android.Content\IntentTest.cs" />
<Compile Include="Android.Runtime\CharSequenceTest.cs" />
<Compile Include="Android.Runtime\JavaCollectionTest.cs" />
<Compile Include="Android.Runtime\JnienvArrayMarshaling.cs" />
<Compile Include="Android.Runtime\XmlReaderPullParserTest.cs" />
<Compile Include="Android.Runtime\XmlReaderResourceParserTest.cs" />
<Compile Include="Android.Widget\AdapterTests.cs" />
<Compile Include="Java.Interop\JavaConvertTest.cs" />
<Compile Include="Java.Lang\ObjectArrayMarshaling.cs" />
<Compile Include="Java.Lang\ObjectTest.cs" />
<Compile Include="Java.Interop\JnienvTest.cs" />
<Compile Include="System\AppDomainTest.cs" />
<Compile Include="System\AssemblyInformationalVersionAttributeTest.cs" />
<Compile Include="System\ExceptionTest.cs" />
<Compile Include="System\TimeZoneTest.cs" />
<Compile Include="System.IO\DriveInfoTest.cs" />
<Compile Include="System.IO.Compression\GZipStreamTest.cs" />
<Compile Include="System.Net\ProxyTest.cs" />
<Compile Include="System.Net\SslTest.cs" />
<Compile Include="System.Net\NetworkInterfaces.cs" />
<Compile Include="System.Threading\InterlockedTest.cs" />
<Compile Include="Java.Interop\JavaObjectExtensionsTests.cs" />
<Compile Include="Xamarin.Android.Net\AndroidClientHandlerTests.cs" />
<Compile Include="Xamarin.Android.Net\HttpClientIntegrationTests.cs" />
<Compile Include="Xamarin.Android.RuntimeTests\MainActivity.cs" />
<Compile Include="Xamarin.Android.RuntimeTests\MyIntent.cs" />
<Compile Include="Xamarin.Android.RuntimeTests\NonJavaObject.cs" />
<Compile Include="Xamarin.Android.RuntimeTests\TestInstrumentation.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
Expand All @@ -100,24 +68,4 @@
</ItemGroup>
<Import Project="..\..\..\bin\$(Configuration)\lib\xbuild\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="Mono.Android-Tests.targets" />
<ItemGroup>
<ProjectReference Include="..\..\..\build-tools\android-toolchain\android-toolchain.mdproj">
<Name>android-toolchain</Name>
<Project>{8FF78EB6-6FC8-46A7-8A15-EBBA9045C5FA}</Project>
<Private>False</Private>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\Xamarin.Android.Build.Tasks\Xamarin.Android.Build.Tasks.csproj">
<Name>Xamarin.Android.Build.Tasks</Name>
<Project>{3F1F2F50-AF1A-4A5A-BEDB-193372F068D7}</Project>
<Private>False</Private>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\Xamarin.Android.NUnitLite\Xamarin.Android.NUnitLite.csproj">
<Name>Xamarin.Android.NUnitLite</Name>
<Project>{4D603AA3-3BFD-43C8-8050-0CD6C2601126}</Project>
<Private>False</Private>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
</Project>
Loading

0 comments on commit a2ad397

Please sign in to comment.