Skip to content

Android O Preview support #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<MonoSgenBridgeVersion Condition=" '$(MonoSgenBridgeVersion)' == '' ">5</MonoSgenBridgeVersion>
<HOME Condition=" '$(HOME)' == '' ">$(HOMEDRIVE)$(HOMEPATH)</HOME>
<AndroidApiLevel Condition=" '$(AndroidApiLevel)' == '' ">25</AndroidApiLevel>
<AndroidPlatformId Condition=" '$(AndroidPlatformId)' == '' ">$(AndroidApiLevel)</AndroidPlatformId>
<AndroidPreviousFrameworkVersion Condition=" '$(AndroidPreviousFrameworkVersion)' == '' ">v1.0</AndroidPreviousFrameworkVersion>
<AndroidFrameworkVersion Condition=" '$(AndroidFrameworkVersion)' == '' ">$(AndroidLatestFrameworkVersion)</AndroidFrameworkVersion>
<AndroidToolchainCacheDirectory Condition=" '$(AndroidToolchainCacheDirectory)' == '' ">$(HOME)\android-archives</AndroidToolchainCacheDirectory>
Expand All @@ -61,7 +62,8 @@
<AllSupported32BitTargetAndroidAbis>armeabi;armeabi-v7a;x86</AllSupported32BitTargetAndroidAbis>
<AllSupported64BitTargetAndroidAbis>arm64-v8a;x86_64</AllSupported64BitTargetAndroidAbis>
<AllSupportedTargetAndroidAbis>$(AllSupported32BitTargetAndroidAbis);$(AllSupported64BitTargetAndroidAbis)</AllSupportedTargetAndroidAbis>
<XABuildToolsVersion>25.0.1</XABuildToolsVersion>
<XABuildToolsVersion>26-rc1</XABuildToolsVersion>
<XABuildToolsFolder Condition="'$(XABuildToolsFolder)' == ''">26.0.0-rc1</XABuildToolsFolder>
</PropertyGroup>
<PropertyGroup>
<_MingwPrefixTail Condition=" '$(HostOS)' == 'Darwin' ">.static</_MingwPrefixTail>
Expand All @@ -85,7 +87,9 @@
<PropertyGroup>
<AdbToolPath Condition=" '$(AdbToolPath)' == '' ">$(AndroidSdkFullPath)\platform-tools</AdbToolPath>
<AdbToolExe Condition=" '$(AdbToolExe)' == '' ">adb</AdbToolExe>
<AvdManagerToolExe Condition=" '$(AvdManagerToolExe)' == '' ">avdmanager</AvdManagerToolExe>
<AndroidToolPath Condition=" '$(AndroidToolPath)' == '' ">$(AndroidSdkFullPath)\tools</AndroidToolPath>
<AndroidToolsBinPath Condition=" '$(AndroidToolsBinPath)' == '' ">$(AndroidToolPath)\bin</AndroidToolsBinPath>
<AndroidToolExe Condition=" '$(AndroidToolExe)' == '' ">android</AndroidToolExe>
<EmulatorToolPath Condition=" '$(EmulatorToolPath)' == '' ">$(AndroidSdkFullPath)\tools</EmulatorToolPath>
<EmulatorToolExe Condition=" '$(EmulatorToolExe)' == '' ">emulator</EmulatorToolExe>
Expand Down
3 changes: 2 additions & 1 deletion build-tools/android-toolchain/android-toolchain.mdproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
_UnzipFiles;
_CreateNdkToolchains;
_CreateMxeToolchains;
_AcceptAndroidSdkLicenses;
</BuildDependsOn>
</PropertyGroup>
<ItemGroup>
Expand All @@ -44,4 +45,4 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
</Project>
32 changes: 22 additions & 10 deletions build-tools/android-toolchain/android-toolchain.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,39 @@
-->
<AndroidSdkItem Include="build-tools_r$(XABuildToolsVersion)-linux.zip">
<HostOS>Linux</HostOS>
<DestDir>build-tools\$(XABuildToolsVersion)</DestDir>
<DestDir>build-tools\$(XABuildToolsFolder)</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="platform-tools_r23-linux.zip">
<AndroidSdkItem Include="platform-tools_r26.0.0-rc1-linux.zip">
<HostOS>Linux</HostOS>
<DestDir>platform-tools</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="tools_r24.4.1-linux.zip">
<AndroidSdkItem Include="sdk-tools-linux-3859397.zip">
<HostOS>Linux</HostOS>
<DestDir>tools</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="emulator-linux-3887480.zip">
<HostOS>Linux</HostOS>
<DestDir>emulator</DestDir>
</AndroidSdkItem>
<AndroidNdkItem Include="android-ndk-r11c-darwin-x86_64.zip">
<HostOS>Darwin</HostOS>
</AndroidNdkItem>
<AndroidSdkItem Include="build-tools_r$(XABuildToolsVersion)-macosx.zip">
<HostOS>Darwin</HostOS>
<DestDir>build-tools\$(XABuildToolsVersion)</DestDir>
<DestDir>build-tools\$(XABuildToolsFolder)</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="platform-tools_r23-macosx.zip">
<AndroidSdkItem Include="platform-tools_r26.0.0-rc1-darwin.zip">
<HostOS>Darwin</HostOS>
<DestDir>platform-tools</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="tools_r24.4.1-macosx.zip">
<AndroidSdkItem Include="sdk-tools-darwin-3859397.zip">
<HostOS>Darwin</HostOS>
<DestDir>tools</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="emulator-darwin-3887480.zip">
<HostOS>Darwin</HostOS>
<DestDir>emulator</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="android-2.3.3_r02-linux.zip">
<HostOS></HostOS>
<DestDir>platforms\android-10</DestDir>
Expand Down Expand Up @@ -86,18 +94,22 @@
<HostOS></HostOS>
<DestDir>platforms\android-25</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="android_m2repository_r16.zip">
<AndroidSdkItem Include="platform-O_r01.zip">
<HostOS></HostOS>
<DestDir>extras\android\m2repository</DestDir>
<DestDir>platforms\android-O</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="docs-24_r01.zip">
<HostOS></HostOS>
<DestDir>docs</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="sysimg_x86-21_r03.zip">
<AndroidSdkItem Include="android_m2repository_r16.zip">
<HostOS></HostOS>
<DestDir>extras\android\m2repository</DestDir>
</AndroidSdkItem>
<AndroidSdkItem Include="x86-21_r04.zip">
<HostOS></HostOS>
<RelUrl>sys-img/android/</RelUrl>
<DestDir>system-images\android-21\x86</DestDir>
<DestDir>system-images\android-21\default\x86</DestDir>
</AndroidSdkItem>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions build-tools/android-toolchain/android-toolchain.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Import Project="..\..\Configuration.props" />
<Import Project="android-toolchain.projitems" />
<Import Project="..\scripts\RequiredPrograms.targets" />
<UsingTask AssemblyFile="$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.AcceptAndroidSdkLicenses" />
<Target Name="_CopyBootstrapTasksAssembly"
Outputs="$(OutputPath)\Xamarin.Android.Tools.BootstrapTasks.dll">
<MSBuild
Expand Down Expand Up @@ -123,6 +124,9 @@
<_AndroidMxeOutput Include="@(_AndroidMxeToolchain->'$(AndroidMxeFullPath)\%(Identity)\include\zlib.h')" />
<_AndroidMxeOutput Include="@(_AndroidMxeToolchain->'$(AndroidMxeFullPath)\%(Identity)\lib\libz.a')" />
</ItemGroup>
<Target Name="_AcceptAndroidSdkLicenses">
<AcceptAndroidSdkLicenses AndroidSdkDirectory="$(AndroidSdkDirectory)" />
</Target>
<Target Name="_CreateMxeToolchains"
DependsOnTargets="_SetMxeToolchainMakefileTimeToLastCommitTimestamp"
Condition=" '$(NeedMxe)' == 'true' And ($(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win32:')) Or $(AndroidSupportedHostJitAbisForConditionalChecks.Contains (':mxe-Win64:')))"
Expand Down
9 changes: 8 additions & 1 deletion build-tools/api-xml-adjuster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ API_XML_TOOL = $(BUILDBIN)/api-xml-adjuster.exe
RUNTIME = mono
RUN_CLASS_PARSE = $(RUNTIME) $(CLASS_PARSE)
RUN_API_XML_TOOL = $(RUNTIME) $(API_XML_TOOL)
API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25
API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25 O

XML_OUTPUT_DIR = .

Expand Down Expand Up @@ -81,6 +81,9 @@ docs-%.zip:
docs-25_web.zip:
curl -L https://dl.dropboxusercontent.com/u/493047/2016/docs-25-web.zip > $@ || exit 1

docs-O_web.zip:
curl -L https://www.dropbox.com/s/3xr11fpd08xpolg/docs-O-web.zip?dl=0 > $@ || exit 1

# API level 10 is Android v2.3.3; it's API level 9 (Android v2.3) with a few
# bugfixes which don't impact the documentation.
$(DOCS_DIR)/docs-api-10: docs-2.3_r01-linux.zip
Expand Down Expand Up @@ -119,3 +122,7 @@ $(DOCS_DIR)/docs-api-24: docs-24_r01.zip

$(DOCS_DIR)/docs-api-25: docs-25_web.zip # Google hadn't published docs component yet!
$(call extract-docs,$<,docs)

docs-api-O: docs-O_web.zip # No preview docs yet
$(call extract-docs,$<,docs)

21 changes: 10 additions & 11 deletions build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ ZIP_OUTPUT = $(ZIP_OUTPUT_BASENAME).zip


# $(ALL_API_LEVELS) and $(ALL_FRAMEWORKS) must be kept in sync w/ each other
ALL_API_LEVELS = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# this was different when API Level 21 was "L". Same could happen in the future.
ALL_PLATFORM_IDS = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
ALL_API_LEVELS = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
# this was different from ALL_API_LEVELS when API Level 26 was "O". Same could happen in the future.
ALL_PLATFORM_IDS = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 O
# supported api levels
ALL_FRAMEWORKS = _ _ _ _ _ _ _ _ _ v2.3 _ _ _ _ v4.0.3 v4.1 v4.2 v4.3 v4.4 v4.4.87 v5.0 v5.1 v6.0 v7.0 v7.1
API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25
ALL_FRAMEWORKS = _ _ _ _ _ _ _ _ _ v2.3 _ _ _ _ v4.0.3 v4.1 v4.2 v4.3 v4.4 v4.4.87 v5.0 v5.1 v6.0 v7.0 v7.1 v7.99.0
API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25 26
STABLE_API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24

FRAMEWORKS = $(foreach a, $(API_LEVELS), $(word $(a),$(ALL_FRAMEWORKS)))
Expand Down Expand Up @@ -92,17 +92,16 @@ task-assemblies:

framework-assemblies:
PREV_VERSION="v1.0"; \
for a in $(API_LEVELS); do \
CUR_VERSION=`echo "$(ALL_FRAMEWORKS)"|tr -s " "|cut -d " " -s -f $${a}`; \
$(foreach a, $(API_LEVELS), \
CUR_VERSION=`echo "$(ALL_FRAMEWORKS)"|tr -s " "|cut -d " " -s -f $(a)`; \
$(foreach conf, $(CONFIGURATIONS), \
REDIST_FILE=bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \
grep -q $${PREV_VERSION} $${REDIST_FILE}; \
if [ $$? -ne 0 ] ; then \
rm -f bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/$${CUR_VERSION}/RedistList/FrameworkList.xml; \
fi; \
$(MSBUILD) $(MSBUILD_FLAGS) src/Mono.Android/Mono.Android.csproj /p:Configuration=$(conf) $(_MSBUILD_ARGS) /p:AndroidApiLevel=$${a} /p:AndroidFrameworkVersion=$${CUR_VERSION} /p:AndroidPreviousFrameworkVersion=$${PREV_VERSION}; ) \
PREV_VERSION=$${CUR_VERSION}; \
done
$(MSBUILD) $(MSBUILD_FLAGS) src/Mono.Android/Mono.Android.csproj /p:Configuration=$(conf) $(_MSBUILD_ARGS) /p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$${CUR_VERSION} /p:AndroidPreviousFrameworkVersion=$${PREV_VERSION}; ) \
PREV_VERSION=$${CUR_VERSION}; ) \
$(foreach conf, $(CONFIGURATIONS), \
rm -f bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/v1.0/Xamarin.Android.NUnitLite.dll; \
$(MSBUILD) $(MSBUILD_FLAGS) src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj /p:Configuration=$(conf) $(_MSBUILD_ARGS) /p:AndroidApiLevel=$(firstword $(API_LEVELS)) /p:AndroidFrameworkVersion=$(firstword $(FRAMEWORKS)); )
Expand All @@ -115,7 +114,7 @@ opentk-jcw:
$(foreach a, $(API_LEVELS), \
$(foreach conf, $(CONFIGURATIONS), \
touch bin/$(conf)/lib/xbuild-frameworks/MonoAndroid/*/OpenTK-1.0.dll; \
$(MSBUILD) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj /t:GenerateJavaCallableWrappers /p:Configuration=$(conf) $(_MSBUILD_ARGS) /p:AndroidApiLevel=$(a) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)); ))
$(MSBUILD) $(MSBUILD_FLAGS) src/OpenTK-1.0/OpenTK.csproj /t:GenerateJavaCallableWrappers /p:Configuration=$(conf) $(_MSBUILD_ARGS) /p:AndroidApiLevel=$(a) /p:AndroidPlatformId=$(word $(a), $(ALL_PLATFORM_IDS)) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)); ))

_BUNDLE_ZIPS_INCLUDE = \
$(ZIP_OUTPUT_BASENAME)/bin/Debug \
Expand Down
2 changes: 1 addition & 1 deletion build-tools/scripts/JavaCallableWrappers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PropertyGroup>
<_Target>-source $(JavacSourceVersion) -target $(JavacSourceVersion)</_Target>
<_D>-d "$(IntermediateOutputPath)jcw\bin"</_D>
<_AndroidJar>"$(AndroidToolchainDirectory)\sdk\platforms\android-$(AndroidApiLevel)\android.jar"</_AndroidJar>
<_AndroidJar>"$(AndroidToolchainDirectory)\sdk\platforms\android-$(AndroidPlatformId)\android.jar"</_AndroidJar>
<_MonoAndroidJar>$(OutputPath)mono.android.jar</_MonoAndroidJar>
</PropertyGroup>
<Exec
Expand Down
4 changes: 2 additions & 2 deletions build-tools/scripts/UnitTestApks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
AndroidSdkHome="$(AndroidSdkDirectory)"
SdkVersion="21"
ImageName="$(_TestImageName)"
ToolExe="$(AndroidToolExe)"
ToolPath="$(AndroidToolPath)"
ToolExe="$(AvdManagerToolExe)"
ToolPath="$(AndroidToolsBinPath)"
/>
<StartAndroidEmulator
Condition=" '$(_ValidAdbTarget)' != 'True' "
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Diagnostics;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace Xamarin.Android.BuildTools.PrepTasks
{
public class AcceptAndroidSdkLicenses : Task
{
[Required]
public string AndroidSdkDirectory { get; set; }

public override bool Execute ()
{
var licdir = Path.Combine (Path.Combine (AndroidSdkDirectory, "licenses"));
Directory.CreateDirectory (licdir);

var psi = new ProcessStartInfo (Path.Combine (AndroidSdkDirectory, "tools", "bin", "sdkmanager"), "--licenses") { UseShellExecute = false, RedirectStandardInput = true };
var proc = Process.Start (psi);
for (int i = 0; i < 10; i++)
proc.StandardInput.WriteLine ('y');
proc.WaitForExit ();

return true;
}
}
}
1 change: 1 addition & 0 deletions build-tools/xa-prep-tasks/xa-prep-tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<Compile Include="Xamarin.Android.BuildTools.PrepTasks\GitCommitsInRange.cs" />
<Compile Include="Xamarin.Android.BuildTools.PrepTasks\ReplaceFileContents.cs" />
<Compile Include="Xamarin.Android.BuildTools.PrepTasks\PrepareInstall.cs" />
<Compile Include="Xamarin.Android.BuildTools.PrepTasks\AcceptAndroidSdkLicenses.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="xa-prep-tasks.targets" />
Expand Down
23 changes: 1 addition & 22 deletions src/Mono.Android/Mono.Android.targets
Original file line number Diff line number Diff line change
Expand Up @@ -107,31 +107,10 @@
</ItemGroup>
<Target Name="_GenerateMonoAndroidDex16"
AfterTargets="GenerateJavaCallableWrappers"
Condition="'$(JavacSourceVersion)' == '1.6'"
Inputs="$(OutputPath)mono.android.jar"
Outputs="$(OutputPath)mono.android.dex">
<Exec
Command="&quot;$(AndroidSdkDirectory)&quot;\build-tools\$(XABuildToolsVersion)\dx --dex --output=&quot;$(OutputPath)mono.android.dex&quot; &quot;$(OutputPath)mono.android.jar&quot;"
/>
</Target>
<Target Name="_GenerateMonoAndroidDex18"
AfterTargets="GenerateJavaCallableWrappers"
Condition="'$(JavacSourceVersion)' == '1.8'"
Inputs="$(OutputPath)mono.android.jar"
Outputs="$(OutputPath)mono.android.dex">
<MakeDir
Directories="$(IntermediateOutputPath)__dex"
/>
<Exec
Command="java -jar &quot;$(AndroidSdkDirectory)&quot;\build-tools\$(XABuildToolsVersion)\jack.jar --output-dex=&quot;$(IntermediateOutputPath)__dex&quot; -cp &quot;$(AndroidToolchainDirectory)\sdk\platforms\android-$(AndroidApiLevel)\android.jar&quot; @&quot;$(IntermediateOutputPath)jcw\classes.txt&quot;"
/>
<Copy
SourceFiles="$(IntermediateOutputPath)__dex\classes.dex"
DestinationFiles="$(OutputPath)mono.android.dex"
/>
<Touch Files="$(OutputPath)mono.android.dex" />
<RemoveDir
Directories="$(IntermediateOutputPath)__dex"
Command="&quot;$(AndroidSdkDirectory)\build-tools\$(XABuildToolsFolder)\dx&quot; --dex --no-strict --output=&quot;$(OutputPath)mono.android.dex&quot; &quot;$(OutputPath)mono.android.jar&quot;"
/>
</Target>
<Target Name="_GenerateFrameworkList"
Expand Down
Loading