Skip to content

Commit aa6b3bf

Browse files
atsushienojonpryor
authored andcommitted
[Mono.Android] Android API-O Preview 2 API Binding (#625)
Note that API Level 26 (O) is not built by default. To build it, you'll have to specify extra `make` arguments: # as usual.... make prepare all # for API-O: make framework-assemblies API_LEVELS=26 # -or- xbuild src/Mono.Android/Mono.Android.csproj \ /p:AndroidLatestApiLevel=26 \ /p:AndroidLatestFrameworkVersion=v7.99.0 \ /p:AndroidPlatformId=O Alternatively, if you want to build *only* API-O, you can override the `$(AndroidLatestApiLevel)`, `$(AndroidLatestFrameworkVersion)`, and `$(AndroidPlatformId)` MSBuild properties within `Configuration.Override.props`.
1 parent 57c8bee commit aa6b3bf

File tree

7 files changed

+3843
-1029
lines changed

7 files changed

+3843
-1029
lines changed

Configuration.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
<AllSupported32BitTargetAndroidAbis>armeabi;armeabi-v7a;x86</AllSupported32BitTargetAndroidAbis>
6464
<AllSupported64BitTargetAndroidAbis>arm64-v8a;x86_64</AllSupported64BitTargetAndroidAbis>
6565
<AllSupportedTargetAndroidAbis>$(AllSupported32BitTargetAndroidAbis);$(AllSupported64BitTargetAndroidAbis)</AllSupportedTargetAndroidAbis>
66-
<XABuildToolsVersion>26-rc1</XABuildToolsVersion>
67-
<XABuildToolsFolder Condition="'$(XABuildToolsFolder)' == ''">26.0.0-rc1</XABuildToolsFolder>
66+
<XABuildToolsVersion>26-rc2</XABuildToolsVersion>
67+
<XABuildToolsFolder Condition="'$(XABuildToolsFolder)' == ''">26.0.0-rc2</XABuildToolsFolder>
6868
</PropertyGroup>
6969
<PropertyGroup>
7070
<_MingwPrefixTail Condition=" '$(HostOS)' == 'Darwin' ">.static</_MingwPrefixTail>

build-tools/android-toolchain/android-toolchain.projitems

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
<HostOS>Linux</HostOS>
1616
<DestDir>build-tools\$(XABuildToolsFolder)</DestDir>
1717
</AndroidSdkItem>
18-
<AndroidSdkItem Include="platform-tools_r26.0.0-rc1-linux.zip">
18+
<AndroidSdkItem Include="platform-tools_r26.0.0-rc2-linux.zip">
1919
<HostOS>Linux</HostOS>
2020
<DestDir>platform-tools</DestDir>
2121
</AndroidSdkItem>
22-
<AndroidSdkItem Include="sdk-tools-linux-3859397.zip">
22+
<AndroidSdkItem Include="sdk-tools-linux-3952940.zip">
2323
<HostOS>Linux</HostOS>
2424
<DestDir>tools</DestDir>
2525
</AndroidSdkItem>
26-
<AndroidSdkItem Include="emulator-linux-3887480.zip">
26+
<AndroidSdkItem Include="emulator-linux-3965150.zip">
2727
<HostOS>Linux</HostOS>
2828
<DestDir>emulator</DestDir>
2929
</AndroidSdkItem>
@@ -34,15 +34,15 @@
3434
<HostOS>Darwin</HostOS>
3535
<DestDir>build-tools\$(XABuildToolsFolder)</DestDir>
3636
</AndroidSdkItem>
37-
<AndroidSdkItem Include="platform-tools_r26.0.0-rc1-darwin.zip">
37+
<AndroidSdkItem Include="platform-tools_r26.0.0-rc2-darwin.zip">
3838
<HostOS>Darwin</HostOS>
3939
<DestDir>platform-tools</DestDir>
4040
</AndroidSdkItem>
41-
<AndroidSdkItem Include="sdk-tools-darwin-3859397.zip">
41+
<AndroidSdkItem Include="sdk-tools-darwin-3952940.zip">
4242
<HostOS>Darwin</HostOS>
4343
<DestDir>tools</DestDir>
4444
</AndroidSdkItem>
45-
<AndroidSdkItem Include="emulator-darwin-3887480.zip">
45+
<AndroidSdkItem Include="emulator-darwin-3965150.zip">
4646
<HostOS>Darwin</HostOS>
4747
<DestDir>emulator</DestDir>
4848
</AndroidSdkItem>
@@ -94,7 +94,7 @@
9494
<HostOS></HostOS>
9595
<DestDir>platforms\android-25</DestDir>
9696
</AndroidSdkItem>
97-
<AndroidSdkItem Include="platform-O_r01.zip">
97+
<AndroidSdkItem Include="platform-O_r02.zip">
9898
<HostOS></HostOS>
9999
<DestDir>platforms\android-O</DestDir>
100100
</AndroidSdkItem>

build-tools/api-xml-adjuster/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ clean-api-xml:
4949

5050
$(CLASS_PARSE_XML): $(CLASS_PARSE) $(ANDROID_JAR) $(DOCS_DIR_CUR_LEVEL)
5151
mkdir -p $(CLASS_PARSE_XML_DIR)
52-
if [ $(LEVEL) -ge 24 ]; then \
52+
if [ '$(LEVEL)' -eq 'O' ]; then \
5353
$(RUN_CLASS_PARSE) $(ANDROID_JAR) -docspath=$(DOCS_DIR_CUR_LEVEL)/reference --docstype=droiddoc2 > $(CLASS_PARSE_XML) || rm -f $(CLASS_PARSE_XML) ;\
54-
else \
54+
elif [ $(LEVEL) -le 25 ]; then \
5555
$(RUN_CLASS_PARSE) $(ANDROID_JAR) -docspath=$(DOCS_DIR_CUR_LEVEL)/reference --docstype=droiddoc > $(CLASS_PARSE_XML) || rm -f $(CLASS_PARSE_XML) ;\
56+
else \
57+
$(RUN_CLASS_PARSE) $(ANDROID_JAR) -docspath=$(DOCS_DIR_CUR_LEVEL)/reference --docstype=droiddoc2 > $(CLASS_PARSE_XML) || rm -f $(CLASS_PARSE_XML) ;\
5658
fi
5759

5860
$(ANALYZED_XML): $(API_XML_TOOL) $(CLASS_PARSE_XML)
@@ -71,7 +73,7 @@ DOCS_DIR_CUR_LEVEL: $(DOCS_DIR_CUR_LEVEL)
7173

7274
define extract-docs
7375
mkdir -p $(DOCS_DIR)
74-
unzip -d $(DOCS_DIR) $1 || exit 1
76+
unzip $1 || exit 1
7577
mv $2 $@
7678
endef
7779

@@ -82,7 +84,7 @@ docs-25_web.zip:
8284
curl -L https://dl.dropboxusercontent.com/u/493047/2016/docs-25-web.zip > $@ || exit 1
8385

8486
docs-O_web.zip:
85-
curl -L https://www.dropbox.com/s/3xr11fpd08xpolg/docs-O-web.zip?dl=0 > $@ || exit 1
87+
curl -L https://www.dropbox.com/s/35sty6h7oszc488/docs-api-O.zip?dl=0 > $@ || exit 1
8688

8789
# API level 10 is Android v2.3.3; it's API level 9 (Android v2.3) with a few
8890
# bugfixes which don't impact the documentation.
@@ -123,6 +125,6 @@ $(DOCS_DIR)/docs-api-24: docs-24_r01.zip
123125
$(DOCS_DIR)/docs-api-25: docs-25_web.zip # Google hadn't published docs component yet!
124126
$(call extract-docs,$<,docs)
125127

126-
docs-api-O: docs-O_web.zip # No preview docs yet
128+
$(DOCS_DIR)/docs-api-O: docs-O_web.zip # No preview docs yet
127129
$(call extract-docs,$<,docs)
128130

build-tools/api-xml-adjuster/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ MSBuild /t:Clean.
3030
It had existed as such, and it's not part of the build, no need to be
3131
built on Windows so far.
3232

33+
34+
## How do you get the docs archive for the preview APIs?
35+
36+
Google publishes the docs SDK component only against the stable API,
37+
which means that preview API types are not included.
38+
That makes our parameter names retrieval impossible for the preview API.
39+
40+
To workaround the issue, we create corresponding API docs zip archive
41+
from developer.android.com using the following tool:
42+
https://github.com/xamarin/components/tree/master/AndroidDocUtil
43+

0 commit comments

Comments
 (0)