diff options
author | Ludovic Henry <luhenry@microsoft.com> | 2018-08-17 22:10:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 22:10:39 +0300 |
commit | a1aa022dca6be465e1f5e82c7cae57d252b96fb1 (patch) | |
tree | bde5036722b14426d8773464c11b800aab4c7b50 /sdks | |
parent | 9bc111e2f4b67c3a7d4678c338ba23b6c7d44311 (diff) |
[sdks] Fix local testing for Android (#10169)
Diffstat (limited to 'sdks')
24 files changed, 544 insertions, 287 deletions
diff --git a/sdks/android/.gitignore b/sdks/android/.gitignore index 52604230fc8..b59b4682e74 100644 --- a/sdks/android/.gitignore +++ b/sdks/android/.gitignore @@ -1 +1,6 @@ -apk/
\ No newline at end of file +/.gradle +/.idea +/app/assets/asm +/app/src/main/jniLibs/ +/lldb-mono-0.1 +/local.properties diff --git a/sdks/android/AndroidManifest.xml b/sdks/android/AndroidManifest.xml deleted file mode 100644 index 26e4cebfce1..00000000000 --- a/sdks/android/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.mono.android.AndroidTestRunner" - android:versionCode="1" - android:versionName="1.0"> - <uses-sdk android:minSdkVersion="14" /> - <uses-permission - android:name="android.permission.INTERNET"/> - <application android:label="@string/app_name" android:debuggable="true"> - <activity android:name="org.mono.android.AndroidActivity" android:label="@string/app_name"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> - <instrumentation android:name="org.mono.android.AndroidRunner" android:targetPackage="org.mono.android.AndroidTestRunner" /> -</manifest> diff --git a/sdks/android/Makefile b/sdks/android/Makefile index fd0b7811b63..f489bc8f7a0 100644 --- a/sdks/android/Makefile +++ b/sdks/android/Makefile @@ -2,6 +2,10 @@ TOP=$(realpath $(CURDIR)/../..) -include $(TOP)/sdks/Make.config include $(TOP)/sdks/versions.mk include $(TOP)/sdks/paths.mk + +SDK_DIR = $(ANDROID_TOOLCHAIN_DIR)/sdk +NDK_DIR = $(ANDROID_TOOLCHAIN_DIR)/ndk + ADB = $(SDK_DIR)/platform-tools/adb ANDROID = $(SDK_DIR)/tools/android ANT = ant @@ -11,15 +15,13 @@ PACKAGE = org.mono.android.AndroidTestRunner RUNNER = org.mono.android.AndroidRunner ACTIVITY = org.mono.android.AndroidActivity -RELEASE?=true - -CONFIGURATION=$(if $(filter $(RELEASE),true),release,debug) +CONFIGURATION?=release APK_DIR=apk -BCL_RUNNER_EXE = $(APK_DIR)/assets/asm/main.exe -DEBUGGER_RUNNER_EXE = $(APK_DIR)/assets/asm/dtest-app.exe -DEBUGGER_RUNNER_PDB = $(APK_DIR)/assets/asm/dtest-app.pdb +BCL_RUNNER_EXE = app/assets/asm/main.exe +DEBUGGER_RUNNER_EXE = app/assets/asm/dtest-app.exe +DEBUGGER_RUNNER_PDB = app/assets/asm/dtest-app.pdb BCL_CHECKS= \ @@ -77,28 +79,8 @@ shell: ## Check targets -BCL_LIBS= \ - mscorlib.dll \ - System.dll \ - System.Core.dll \ - System.Xml.dll \ - System.Data.dll \ - System.IO.Compression.FileSystem.dll \ - System.IO.Compression.dll \ - System.Json.dll \ - System.Net.Http.dll \ - System.Numerics.dll \ - System.Runtime.Serialization.dll \ - System.ServiceModel.Web.dll \ - System.Transactions.dll \ - System.Xml.Linq.dll \ - Mono.CSharp.dll \ - Mono.Data.Sqlite.dll \ - Mono.Data.Tds.dll \ - Mono.Security.dll - -BCL_PDBS=$(patsubst %.dll,%.pdb,$(BCL_LIBS)) - +BCL_LIBS=$(subst corlib.dll,mscorlib.dll,$(patsubst %,%.dll,$(BCL_CHECKS))) +BCL_PDBS=$(subst corlib.pdb,mscorlib.pdb,$(patsubst %,%.pdb,$(BCL_CHECKS))) BCL_REFERENCES=$(patsubst %,-r:$(TOP)/sdks/out/bcl/monodroid/%,$(BCL_LIBS)) NUNIT_LIBS= \ @@ -106,152 +88,78 @@ NUNIT_LIBS= \ NUNIT_REFERENCES=$(patsubst %,-r:$(TOP)/sdks/out/bcl/monodroid/%,$(NUNIT_LIBS)) -$(APK_DIR) $(APK_DIR)/jni $(APK_DIR)/jni/armeabi $(APK_DIR)/jni/armeabi-v7a $(APK_DIR)/jni/arm64-v8a $(APK_DIR)/jni/x86 $(APK_DIR)/jni/x86_64 $(APK_DIR)/assets $(APK_DIR)/assets/asm: - mkdir -p $@ - -$(APK_DIR)/AndroidManifest.xml: $(APK_DIR)/%: % | $(APK_DIR) - cp $< $@ - -$(APK_DIR)/build.xml $(APK_DIR)/local.properties $(APK_DIR)/project.properties: $(APK_DIR)/AndroidManifest.xml | $(APK_DIR) - cd $(APK_DIR) && $(ANDROID) update project -p . -t "android-14" +local.properties: + echo "sdk.dir=$(SDK_DIR)" > $@ + echo "ndk.dir=$(NDK_DIR)" >> $@ -.PHONY: res/ src/ -$(APK_DIR)/res/ $(APK_DIR)/src/: $(APK_DIR)/%: % | $(APK_DIR) - cp -r $< $@ +app/assets/asm: + mkdir -p $@ -$(APK_DIR)/jni/Android.mk $(APK_DIR)/jni/Application.mk $(APK_DIR)/jni/runtime-bootstrap.c: $(APK_DIR)/%: % | $(APK_DIR)/jni - cp $< $@ +## Package the monosgen-2.0 and MonoPosixHelper libraries MONO_LIBS= \ libmonosgen-2.0.so \ libMonoPosixHelper.so -$(patsubst %,$(APK_DIR)/jni/armeabi/%,$(MONO_LIBS)): $(APK_DIR)/jni/armeabi/%: $(TOP)/sdks/out/android-armeabi-$(CONFIGURATION)/lib/% | $(APK_DIR)/jni/armeabi - cp $< $@ - -$(patsubst %,$(APK_DIR)/jni/armeabi-v7a/%,$(MONO_LIBS)): $(APK_DIR)/jni/armeabi-v7a/%: $(TOP)/sdks/out/android-armeabi-v7a-$(CONFIGURATION)/lib/% | $(APK_DIR)/jni/armeabi-v7a - cp $< $@ - -$(patsubst %,$(APK_DIR)/jni/arm64-v8a/%,$(MONO_LIBS)): $(APK_DIR)/jni/arm64-v8a/%: $(TOP)/sdks/out/android-arm64-v8a-$(CONFIGURATION)/lib/% | $(APK_DIR)/jni/arm64-v8a - cp $< $@ - -$(patsubst %,$(APK_DIR)/jni/x86/%,$(MONO_LIBS)): $(APK_DIR)/jni/x86/%: $(TOP)/sdks/out/android-x86-$(CONFIGURATION)/lib/% | $(APK_DIR)/jni/x86 - cp $< $@ - -$(patsubst %,$(APK_DIR)/jni/x86_64/%,$(MONO_LIBS)): $(APK_DIR)/jni/x86_64/%: $(TOP)/sdks/out/android-x86_64-$(CONFIGURATION)/lib/% | $(APK_DIR)/jni/x86_64 - cp $< $@ +## +# Parameters: +# $(1): arch +define RuntimeTemplate +app/src/main/jniLibs/$(1): + mkdir -p $$@ -$(APK_DIR)/assets/mconfig: machine.config | $(APK_DIR)/assets - cp $< $@ +$$(patsubst %,app/src/main/jniLibs/$(1)/%,$$(MONO_LIBS)): app/src/main/jniLibs/$(1)/%: $$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION)/lib/% | app/src/main/jniLibs/$(1) + cp $$< $$@ -$(APK_DIR)/assets/asm/main.exe: managed/main.cs | $(APK_DIR)/assets/asm - mcs /nostdlib -unsafe -out:$@ $(BCL_REFERENCES) $(NUNIT_REFERENCES) $< +.PHONY: package +package: $$(patsubst %,app/src/main/jniLibs/$(1)/%,$$(MONO_LIBS)) +endef -$(APK_DIR)/assets/asm/Mono.Android.dll: managed/fake-monodroid.cs | $(APK_DIR)/assets/asm - mcs /nostdlib -target:library -out:$@ $(BCL_REFERENCES) $< +$(eval $(call RuntimeTemplate,armeabi)) +$(eval $(call RuntimeTemplate,armeabi-v7a)) +$(eval $(call RuntimeTemplate,arm64-v8a)) +$(eval $(call RuntimeTemplate,x86)) +$(eval $(call RuntimeTemplate,x86_64)) -$(patsubst %,$(APK_DIR)/assets/asm/%,$(BCL_LIBS)) $(patsubst %,$(APK_DIR)/assets/asm/%,$(NUNIT_LIBS)): $(APK_DIR)/assets/asm/%: $(TOP)/sdks/out/bcl/monodroid/% | $(APK_DIR)/assets/asm - cp $< $@ +## Package the main.exe and Mono.Android.dll -$(APK_DIR)/lldb-mono-0.1/xa-lldb: - cd $(APK_DIR) && curl -L -O 'https://github.com/mono/lldb-binaries/releases/download/v0.1/lldb-mono-0.1.tar.gz' - cd $(APK_DIR) && tar xfv lldb-mono-0.1.tar.gz && rm lldb-mono-0.1.tar.gz - cd $(APK_DIR) && rm lldb-mono-0.1/xa-lldb - cd $(APK_DIR) && cp ../xa-lldb lldb-mono-0.1 +app/assets/asm/main.exe: managed/main.cs | app/assets/asm + csc /nostdlib /noconfig /langversion:latest /unsafe /out:$@ $(BCL_REFERENCES) $(NUNIT_REFERENCES) $< -$(patsubst %,$(APK_DIR)/assets/asm/%,$(BCL_PDBS)): $(APK_DIR)/assets/asm/%: $(TOP)/sdks/out/bcl/monodroid/% | $(APK_DIR)/assets/asm - cp $< $@ +app/assets/asm/Mono.Android.dll: managed/fake-monodroid.cs | app/assets/asm + csc /nostdlib /noconfig /langversion:latest /t:library /out:$@ $(BCL_REFERENCES) $< .PHONY: package -package: $(APK_DIR)/AndroidManifest.xml -package: $(APK_DIR)/build.xml -package: $(APK_DIR)/local.properties -package: $(APK_DIR)/project.properties -package: $(APK_DIR)/res/ -package: $(APK_DIR)/src/ -package: $(APK_DIR)/jni/Android.mk -package: $(APK_DIR)/jni/Application.mk -package: $(APK_DIR)/jni/runtime-bootstrap.c -package: $(patsubst %,$(APK_DIR)/jni/armeabi/%,$(MONO_LIBS)) -package: $(patsubst %,$(APK_DIR)/jni/armeabi-v7a/%,$(MONO_LIBS)) -package: $(patsubst %,$(APK_DIR)/jni/arm64-v8a/%,$(MONO_LIBS)) -package: $(patsubst %,$(APK_DIR)/jni/x86/%,$(MONO_LIBS)) -package: $(patsubst %,$(APK_DIR)/jni/x86_64/%,$(MONO_LIBS)) -package: $(APK_DIR)/assets/mconfig -package: $(APK_DIR)/assets/asm/Mono.Android.dll -package: $(patsubst %,$(APK_DIR)/assets/asm/%,$(BCL_LIBS)) -package: $(patsubst %,$(APK_DIR)/assets/asm/%,$(BCL_PDBS)) -package: $(patsubst %,$(APK_DIR)/assets/asm/%,$(NUNIT_LIBS)) -package: $(patsubst %,$(APK_DIR)/assets/asm/monodroid_%_test.dll,$(CHECKS)) -ifneq ($(MONO_WAIT_LLDB),) -package: $(APK_DIR)/lldb-mono-0.1/xa-lldb -endif - -package-bcl: package - rm -rf $(APK_DIR)/bin/AndroidActivity-debug.apk - rm -rf $(DEBUGGER_RUNNER_EXE) - $(MAKE) $(BCL_RUNNER_EXE) - -package-debugger: package - rm -rf $(BCL_RUNNER_EXE) - rm -rf $(APK_DIR)/bin/AndroidActivity-debug.apk - rm -rf $(APK_DIR)/assets/asm/testassembly.txt - $(MAKE) $(DEBUGGER_RUNNER_EXE) - $(MAKE) $(DEBUGGER_RUNNER_PDB) +package: app/assets/asm/main.exe app/assets/asm/Mono.Android.dll -.PHONY: $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.exe $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.pdb -$(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.exe $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.pdb: - $(MAKE) PROFILE='monodroid' -C $(TOP)/mcs/class/Mono.Debugger.Soft dtest-app.exe +## Package the BCL assemblies -$(APK_DIR)/assets/asm/dtest-app.exe: $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.exe +$(patsubst %,app/assets/asm/%,$(BCL_LIBS)) $(patsubst %,app/assets/asm/%,$(BCL_PDBS)) $(patsubst %,app/assets/asm/%,$(NUNIT_LIBS)): app/assets/asm/%: $(TOP)/sdks/out/bcl/monodroid/% | app/assets/asm cp $< $@ -$(APK_DIR)/assets/asm/dtest-app.pdb: $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.pdb - cp $< $@ +.PHONY: package +package: $(patsubst %,app/assets/asm/%,$(BCL_LIBS)) $(patsubst %,app/assets/asm/%,$(BCL_PDBS)) $(patsubst %,app/assets/asm/%,$(NUNIT_LIBS)) -make-debugger-test: package-debugger - cd $(APK_DIR) && RUN_WITH_MANAGED_DEBUGGER=1 MONO_DEBUGGER_TESTS=1 $(NDK_BUILD) - cd $(APK_DIR) && $(ANT) debug - -# fixme: -# eventual api: -# MONO_EXE=foo.exe make run-debug-managed-droid -# MONO_EXE=foo.exe make run-debug-unmanaged-droid -# -# mono.debugger tests can just run those targets in the setup function -run-debugger-test: make-debugger-test - cd $(APK_DIR) && $(ADB) uninstall $(PACKAGE) || true - cd $(APK_DIR) && $(ADB) install bin/AndroidActivity-debug.apk - $(ADB) reverse tcp:6100 tcp:6100 - cd $(APK_DIR) && $(ADB) shell am instrument $(PACKAGE)/$(RUNNER) +## Package the BCL test assemblies -# Skip rerunning build steps / cleanup steps -# And run unattended -.PHONY: dirty-run-debugger-test -dirty-run-debugger-test: - $(ADB) shell am instrument $(PACKAGE)/$(RUNNER) +## +# Parameters: +# $(1): assembly name (corlib, System, etc.) +define BCLTestAssemblyTemplate +.PHONY: $$(TOP)/mcs/class/lib/monodroid/tests/monodroid_$(1)_test.dll +$$(TOP)/mcs/class/lib/monodroid/tests/monodroid_$(1)_test.dll: + $$(MAKE) PROFILE='monodroid' -C $$(TOP)/mcs/class/$(1) build-test-lib -.PHONY: run-debugger-test-cleanup -run-debugger-test-cleanup: - $(ADB) reverse --remove-all +app/assets/asm/monodroid_$(1)_test.dll: $$(TOP)/mcs/class/lib/monodroid/tests/monodroid_$(1)_test.dll + cp $$< $$@ -.PHONY: build-% -build-%: package-bcl - printf "monodroid_$*_test.dll" > $(APK_DIR)/assets/asm/testassembly.txt - cd $(APK_DIR) && MONO_BCL_TESTS=1 $(NDK_BUILD) - cd $(APK_DIR) && $(ANT) debug +.PHONY: package +package: app/assets/asm/monodroid_$(1)_test.dll +endef -.PHONY: check-% -check-%: build-% - cd $(APK_DIR) && $(ADB) uninstall $(PACKAGE) || true - cd $(APK_DIR) && $(ADB) install bin/AndroidActivity-debug.apk -ifneq ($(MONO_WAIT_LLDB),) - cd $(APK_DIR) && ./lldb-mono-0.1/xa-lldb -else - cd $(APK_DIR) && $(ADB) shell am instrument -w $(PACKAGE)/$(RUNNER) -endif +$(foreach check,$(BCL_CHECKS),$(eval $(call BCLTestAssemblyTemplate,$(check)))) -## Mini tests +## Package the mini test assembly MINI_TEST_SOURCES= \ $(TOP)/mono/mini/aot-tests.cs \ @@ -268,22 +176,46 @@ MINI_TEST_SOURCES= \ $(TOP)/mono/mini/TestDriver.cs \ managed/mini-test-runner.cs -$(APK_DIR)/assets/asm/monodroid_mini_test.dll: $(MINI_TEST_SOURCES) - mcs /nostdlib /unsafe -target:library -out:$@ -define:__MOBILE__ $(BCL_REFERENCES) $(NUNIT_REFERENCES) $(MINI_TEST_SOURCES) +app/assets/asm/monodroid_mini_test.dll: $(MINI_TEST_SOURCES) + csc /nostdlib /noconfig /langversion:latest /unsafe /t:library /out:$@ /d:__MOBILE__ $(BCL_REFERENCES) $(NUNIT_REFERENCES) $(MINI_TEST_SOURCES) -## BCL tests +.PHONY: package +package: app/assets/asm/monodroid_mini_test.dll -## -# $(1): assembly name (corlib, System, etc.) -define TestAssemblyTemplate +## Package Mono.Debugger.Soft test assemblies -.PHONY: $$(TOP)/mcs/class/lib/monodroid/tests/monodroid_$(1)_test.dll -$$(TOP)/mcs/class/lib/monodroid/tests/monodroid_$(1)_test.dll: - $$(MAKE) PROFILE='monodroid' -C $$(TOP)/mcs/class/$(1) build-test-lib +.PHONY: $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.exe $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.pdb +$(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.exe $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.pdb: + $(MAKE) PROFILE='monodroid' -C $(TOP)/mcs/class/Mono.Debugger.Soft dtest-app.exe -$(APK_DIR)/assets/asm/monodroid_$(1)_test.dll: $$(TOP)/mcs/class/lib/monodroid/tests/monodroid_$(1)_test.dll - cp $$< $$@ +app/assets/asm/dtest-app.exe: $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.exe + cp $< $@ -endef +app/assets/asm/dtest-app.pdb: $(TOP)/mcs/class/Mono.Debugger.Soft/dtest-app.pdb + cp $< $@ + +package: app/assets/asm/dtest-app.exe app/assets/asm/dtest-app.pdb + +## LLDB support + +lldb-mono-0.1/xa-lldb: xa-lldb + wget --no-verbose -O - 'https://github.com/mono/lldb-binaries/releases/download/v0.1/lldb-mono-0.1.tar.gz' | tar xvf - + cp xa-lldb lldb-mono-0.1/xa-lldb -$(foreach check,$(BCL_CHECKS),$(eval $(call TestAssemblyTemplate,$(check)))) +## Run Mono.Debugger.Soft and BCL tests + +build-Mono.Debugger.Soft: package local.properties + ./gradlew uninstallAll assembleDebug installDebug -Pmono.debuggertests $(if $(MONO_WAIT_LLDB),-Pmono.waitforlldb) + +check-Mono.Debugger.Soft: build-Mono.Debugger.Soft $(if $(MONO_WAIT_LLDB),lldb-mono-0.1/xa-lldb) + $(ADB) reverse tcp:6100 tcp:6100 + $(if $(MONO_WAIT_LLDB),lldb-mono-0.1/xa-lldb,$(ADB) shell am instrument -w $(PACKAGE)/$(RUNNER)) + +.PHONY: build-% +build-%: package local.properties + printf "monodroid_$*_test.dll" > app/assets/asm/testassembly.txt + ./gradlew uninstallAll assembleDebug installDebug -Pmono.bcltests $(if $(MONO_WAIT_LLDB),-Pmono.waitforlldb) + +.PHONY: check-% +check-%: build-% $(if $(MONO_WAIT_LLDB),lldb-mono-0.1/xa-lldb) + $(if $(MONO_WAIT_LLDB),lldb-mono-0.1/xa-lldb,$(ADB) shell am instrument -w $(PACKAGE)/$(RUNNER))
\ No newline at end of file diff --git a/sdks/android/app/.gitignore b/sdks/android/app/.gitignore new file mode 100644 index 00000000000..796b96d1c40 --- /dev/null +++ b/sdks/android/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/sdks/android/app/CMakeLists.txt b/sdks/android/app/CMakeLists.txt new file mode 100644 index 00000000000..f1fdedd6aff --- /dev/null +++ b/sdks/android/app/CMakeLists.txt @@ -0,0 +1,48 @@ +# For more information about using CMake with Android Studio, read the +# documentation: https://d.android.com/studio/projects/add-native-code.html + +# Sets the minimum version of CMake required to build the native library. + +cmake_minimum_required(VERSION 3.4.1) + +# Creates and names a library, sets it as either STATIC +# or SHARED, and provides the relative paths to its source code. +# You can define multiple libraries, and CMake builds them for you. +# Gradle automatically packages shared libraries with your APK. + +add_library( # Sets the name of the library. + runtime-bootstrap + + # Sets the library as a shared library. + SHARED + + # Provides a relative path to your source file(s). + src/main/c/runtime-bootstrap.c ) + +# Searches for a specified prebuilt library and stores the path as a +# variable. Because CMake includes system libraries in the search path by +# default, you only need to specify the name of the public NDK library +# you want to add. CMake verifies that the library exists before +# completing its build. + +find_library( # Sets the name of the path variable. + log-lib + + # Specifies the name of the NDK library that + # you want CMake to locate. + log ) + +# Specifies libraries CMake should link to your target library. You +# can link multiple libraries, such as libraries you define in this +# build script, prebuilt third-party libraries, or system libraries. + +target_link_libraries( # Specifies the target library. + runtime-bootstrap + + # Specifies the mono libraries + ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libmonosgen-2.0.so + ${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libMonoPosixHelper.so + + # Links the target library to the log library + # included in the NDK. + ${log-lib} )
\ No newline at end of file diff --git a/sdks/android/machine.config b/sdks/android/app/assets/mconfig index b00cb565040..b00cb565040 100644 --- a/sdks/android/machine.config +++ b/sdks/android/app/assets/mconfig diff --git a/sdks/android/app/build.gradle b/sdks/android/app/build.gradle new file mode 100644 index 00000000000..46f30b6ba1d --- /dev/null +++ b/sdks/android/app/build.gradle @@ -0,0 +1,48 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 28 + defaultConfig { + applicationId "org.mono.android.AndroidTestRunner" + minSdkVersion 15 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + externalNativeBuild { + cmake { + cFlags "-O0 -g" + if (project.hasProperty('mono.bcltests')) + cFlags "-DMONO_BCL_TESTS=1" + else if (project.hasProperty('mono.debuggertests')) + cFlags "-DMONO_DEBUGGER_TESTS=1" + + if (project.hasProperty('mono.waitforlldb')) + cFlags "-DMONO_WAIT_LLDB=1" + } + } + ndk { + abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' + } + } + sourceSets { + main { + assets.srcDirs = ['assets'] + } + } + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } + packagingOptions{ + doNotStrip "**/*.so" + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/sdks/android/app/proguard-rules.pro b/sdks/android/app/proguard-rules.pro new file mode 100644 index 00000000000..f1b424510da --- /dev/null +++ b/sdks/android/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/sdks/android/app/src/main/AndroidManifest.xml b/sdks/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000000..cb657e19a69 --- /dev/null +++ b/sdks/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="org.mono.android.AndroidTestRunner"> + + <uses-sdk + android:minSdkVersion="14" /> + <uses-permission + android:name="android.permission.INTERNET"/> + + <application> + <activity android:name="org.mono.android.AndroidActivity"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + + <instrumentation + android:name="org.mono.android.AndroidRunner" + android:targetPackage="org.mono.android.AndroidTestRunner" /> +</manifest>
\ No newline at end of file diff --git a/sdks/android/jni/runtime-bootstrap.c b/sdks/android/app/src/main/c/runtime-bootstrap.c index 5635cb871cf..72e39750a36 100644 --- a/sdks/android/jni/runtime-bootstrap.c +++ b/sdks/android/app/src/main/c/runtime-bootstrap.c @@ -150,31 +150,33 @@ static MonoAssembly *main_assembly; static void *runtime_bootstrap_dso; static void *mono_posix_helper_dso; +static jclass AndroidRunner_klass = NULL; +static jmethodID AndroidRunner_WriteLineToInstrumentation_method = NULL; + //forward decls static void* my_dlsym (void *handle, const char *name, char **err, void *user_data); static void* my_dlopen (const char *name, int flags, char **err, void *user_data); +static JNIEnv* mono_jvm_get_jnienv (void); //stuff static void _runtime_log (const char *log_domain, const char *log_level, const char *message, int32_t fatal, void *user_data) { - static jclass AndroidRunner_klass = NULL; - static jmethodID AndroidRunner_WriteLineToInstrumentation_method = NULL; JNIEnv *env; jstring j_message; if (jvm == NULL) __android_log_assert ("", "mono-sdks", "%s: jvm is NULL", __func__); - (*jvm)->GetEnv (jvm, (void**)&env, JNI_VERSION_1_6); + if (AndroidRunner_klass == NULL) + __android_log_assert ("", "mono-sdks", "%s: AndroidRunner_klass is NULL", __func__); + if (AndroidRunner_WriteLineToInstrumentation_method == NULL) + __android_log_assert ("", "mono-sdks", "%s: AndroidRunner_WriteLineToInstrumentation_method is NULL", __func__); - if (AndroidRunner_klass == NULL || AndroidRunner_WriteLineToInstrumentation_method == NULL) { - AndroidRunner_klass = (*env)->FindClass (env, "org/mono/android/AndroidRunner"); - AndroidRunner_WriteLineToInstrumentation_method = (*env)->GetStaticMethodID (env, AndroidRunner_klass, "WriteLineToInstrumentation", "(Ljava/lang/String;)V"); - } + env = mono_jvm_get_jnienv (); j_message = (*env)->NewStringUTF(env, message); @@ -431,7 +433,7 @@ Java_org_mono_android_AndroidRunner_runTests (JNIEnv* env, jobject thiz, jstring wait_for_unmanaged_debugger (); -#ifdef RUN_WITH_MANAGED_DEBUGGER +#ifdef MONO_DEBUGGER_TESTS // Using adb reverse char *host = "127.0.0.1"; int sdb_port = 6100; @@ -744,15 +746,66 @@ _monodroid_get_dns_servers (void **dns_servers_array) return count; } +static int initialized = 0; + +static jobject +lref_to_gref (JNIEnv *env, jobject lref) +{ + jobject g; + if (lref == 0) + return 0; + g = (*env)->NewGlobalRef (env, lref); + (*env)->DeleteLocalRef (env, lref); + return g; +} + +static void +mono_jvm_initialize (JavaVM *vm) +{ + JNIEnv *env; + + if (initialized) + return; + + jvm = vm; + + int res = (*jvm)->GetEnv (jvm, (void**)&env, JNI_VERSION_1_6); + if (!env) + __android_log_assert ("", "mono-sdks", "%s: fatal error: Could not create env, res = %d", __func__, res); + + AndroidRunner_klass = lref_to_gref(env, (*env)->FindClass (env, "org/mono/android/AndroidRunner")); + if (!AndroidRunner_klass) + __android_log_assert ("", "mono-sdks", "%s: fatal error: Could not find AndroidRunner_klass", __func__); + + AndroidRunner_WriteLineToInstrumentation_method = (*env)->GetStaticMethodID (env, AndroidRunner_klass, "WriteLineToInstrumentation", "(Ljava/lang/String;)V"); + if (!AndroidRunner_WriteLineToInstrumentation_method) + __android_log_assert ("", "mono-sdks", "%s: fatal error: Could not find AndroidRunner_WriteLineToInstrumentation_method", __func__); + + initialized = 1; +} + JNIEXPORT jint JNICALL JNI_OnLoad (JavaVM *vm, void *reserved) { + mono_jvm_initialize (vm); + return JNI_VERSION_1_6; +} + +static JNIEnv* +mono_jvm_get_jnienv (void) +{ JNIEnv *env; - jvm = vm; + if (!initialized) + __android_log_assert ("", "mono-sdks", "%s: Fatal error: jvm not initialized", __func__); (*jvm)->GetEnv (jvm, (void**)&env, JNI_VERSION_1_6); - // FIXME do something with env + if (env) + return env; - return JNI_VERSION_1_6; + (*jvm)->AttachCurrentThread(jvm, (void **)&env, NULL); + if (env) + return env; + + __android_log_assert ("", "mono-sdks", "%s: Fatal error: Could not create env", __func__); } diff --git a/sdks/android/src/org/mono/android/main/AndroidRunner.java b/sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java index 9d53cd51eb7..9d53cd51eb7 100644 --- a/sdks/android/src/org/mono/android/main/AndroidRunner.java +++ b/sdks/android/app/src/main/java/org/mono/android/AndroidRunner.java diff --git a/sdks/android/build.gradle b/sdks/android/build.gradle new file mode 100644 index 00000000000..077cb2fc551 --- /dev/null +++ b/sdks/android/build.gradle @@ -0,0 +1,27 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.1.4' + + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/sdks/android/gradle/wrapper/gradle-wrapper.jar b/sdks/android/gradle/wrapper/gradle-wrapper.jar Binary files differnew file mode 100644 index 00000000000..7a3265ee94c --- /dev/null +++ b/sdks/android/gradle/wrapper/gradle-wrapper.jar diff --git a/sdks/android/gradle/wrapper/gradle-wrapper.properties b/sdks/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..660b6bfa92a --- /dev/null +++ b/sdks/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Aug 16 10:31:31 EDT 2018 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/sdks/android/gradlew b/sdks/android/gradlew new file mode 100755 index 00000000000..cccdd3d517f --- /dev/null +++ b/sdks/android/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/sdks/android/jni/Android.mk b/sdks/android/jni/Android.mk deleted file mode 100644 index 8edaa02a526..00000000000 --- a/sdks/android/jni/Android.mk +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (C) 2009 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_LDLIBS := -llog -LOCAL_MODULE := runtime-bootstrap -LOCAL_SRC_FILES := runtime-bootstrap.c - -ifneq ($(MONO_BCL_TESTS),) -LOCAL_CFLAGS += -DMONO_BCL_TESTS=1 -endif - -ifneq ($(MONO_DEBUGGER_TESTS),) -LOCAL_CFLAGS += -DMONO_DEBUGGER_TESTS=1 -endif - -ifneq ($(RUN_WITH_MANAGED_DEBUGGER),) -LOCAL_CFLAGS += -DRUN_WITH_MANAGED_DEBUGGER=1 -endif - -ifneq ($(MONO_WAIT_LLDB),) -LOCAL_CFLAGS += -DMONO_WAIT_LLDB=1 -endif - -include $(BUILD_SHARED_LIBRARY) - - -include $(CLEAR_VARS) - -LOCAL_MODULE := lib-monosgen -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libmonosgen-2.0.so -include $(PREBUILT_SHARED_LIBRARY) - - -include $(CLEAR_VARS) - -LOCAL_MODULE := lib-suppport -LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libMonoPosixHelper.so -include $(PREBUILT_SHARED_LIBRARY) diff --git a/sdks/android/jni/Application.mk b/sdks/android/jni/Application.mk deleted file mode 100644 index 89204a796a3..00000000000 --- a/sdks/android/jni/Application.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Build both ARMv5TE and ARMv7-A machine code. -APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 diff --git a/sdks/android/managed/main.cs b/sdks/android/managed/main.cs index 84b6081cb56..1644b918aab 100644 --- a/sdks/android/managed/main.cs +++ b/sdks/android/managed/main.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; // using System.Collections.Generic; using System.IO; // using System.Linq; @@ -14,19 +15,31 @@ public class Driver public static void RunTests () { - string assembly = File.ReadAllText ($"{AppDomain.CurrentDomain.BaseDirectory}/testassembly.txt"); - - Console.WriteLine ($"Testing assembly \"{assembly}\""); - Console.WriteLine ($""); - string exclude = "NotOnMac,NotWorking,ValueAdd,CAS,InetAccess,MobileNotWorking,SatelliteAssembliesNotWorking,AndroidNotWorking"; if (IntPtr.Size == 4) exclude += ",LargeFileSupport"; - string[] args = new string[] { + string assembly = null; + if (File.Exists($"{AppDomain.CurrentDomain.BaseDirectory}/testassembly.txt")) + assembly = File.ReadAllText ($"{AppDomain.CurrentDomain.BaseDirectory}/testassembly.txt"); + + if (assembly != null) { + assembly = $"{AppDomain.CurrentDomain.BaseDirectory}/{assembly}"; + Console.WriteLine ($"Testing single assembly \"{assembly}\""); + } else { + Console.WriteLine($"Looking for assemblies in ${AppDomain.CurrentDomain.BaseDirectory}"); + + assembly = ""; + foreach (var file in Directory.EnumerateFiles(AppDomain.CurrentDomain.BaseDirectory, "monodroid_*_test.dll", SearchOption.TopDirectoryOnly)) + assembly += $"{AppDomain.CurrentDomain.BaseDirectory}/{file} "; + + Console.WriteLine ($"Testing multiple assemblies \"{assembly}\""); + } + + string[] args = new string [] { $"-labels", $"-exclude={exclude}", - $"{AppDomain.CurrentDomain.BaseDirectory}/{assembly}", + $"{assembly}", }; Runner = new TextUI (); diff --git a/sdks/android/res/layout/main.xml b/sdks/android/res/layout/main.xml deleted file mode 100644 index 7e6675103f4..00000000000 --- a/sdks/android/res/layout/main.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/content_run_mono" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <Button - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="Run Tests" android:id="@+id/button" /> - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="NO RUN" - android:id="@+id/text" /> - <EditText - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:id="@+id/input" /> -</LinearLayout> diff --git a/sdks/android/res/values/strings.xml b/sdks/android/res/values/strings.xml deleted file mode 100644 index c7085a2fe0f..00000000000 --- a/sdks/android/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="app_name">Mono Runtime Test runner</string> -</resources> diff --git a/sdks/android/settings.gradle b/sdks/android/settings.gradle new file mode 100644 index 00000000000..e7b4def49cb --- /dev/null +++ b/sdks/android/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/sdks/android/xa-lldb b/sdks/android/xa-lldb index f6e5a5beed8..77b4371a989 100755 --- a/sdks/android/xa-lldb +++ b/sdks/android/xa-lldb @@ -1,6 +1,8 @@ #!/bin/bash -PLATFORM_TOOLS_DIR=/Users/akyte/Library/Developer/Xamarin/android-sdk-macosx/platform-tools +set -xi + +PLATFORM_TOOLS_DIR=$HOME/android-toolchain/sdk/platform-tools shell() { diff --git a/sdks/builds/android.mk b/sdks/builds/android.mk index e627de3e25d..7bbf70fe13a 100644 --- a/sdks/builds/android.mk +++ b/sdks/builds/android.mk @@ -2,13 +2,11 @@ include runtime.mk ANDROID_URI?=https://dl.google.com/android/repository/ -ANDROID_TOOLCHAIN_PREFIX?=$(HOME)/android-toolchain/toolchains -ANDROID_TOOLCHAIN_DIR?=$(HOME)/android-toolchain -ANDROID_TOOLCHAIN_CACHE_DIR?=$(HOME)/android-archives - ANT_URI?=https://archive.apache.org/dist/ant/binaries/ -$(ANDROID_TOOLCHAIN_CACHE_DIR): +ANDROID_TOOLCHAIN_PREFIX?=$(ANDROID_TOOLCHAIN_DIR)/toolchains + +$(ANDROID_TOOLCHAIN_CACHE_DIR) $(ANDROID_TOOLCHAIN_DIR): mkdir -p $@ ## @@ -22,7 +20,7 @@ define AndroidProvisioningTemplate $$(ANDROID_TOOLCHAIN_CACHE_DIR)/$(1).zip: | $$(ANDROID_TOOLCHAIN_CACHE_DIR) wget --no-verbose -O $$@ $(4)$(1).zip -$$(ANDROID_TOOLCHAIN_DIR)/$(3)$$(if $(2),/$(2))/.stamp-$(1): $$(ANDROID_TOOLCHAIN_CACHE_DIR)/$(1).zip +$$(ANDROID_TOOLCHAIN_DIR)/$(3)$$(if $(2),/$(2))/.stamp-$(1): $$(ANDROID_TOOLCHAIN_CACHE_DIR)/$(1).zip | $$(ANDROID_TOOLCHAIN_DIR) rm -rf $$(ANDROID_TOOLCHAIN_DIR)/$(3)$$(if $(2),/$(2)) ./unzip-android-archive.sh "$$<" "$$(ANDROID_TOOLCHAIN_DIR)/$(3)$$(if $(2),/$(2))" touch $$@ diff --git a/sdks/paths.mk b/sdks/paths.mk index ec89afb7cd8..f0df1febc56 100644 --- a/sdks/paths.mk +++ b/sdks/paths.mk @@ -8,3 +8,10 @@ $(error Could not find Xcode at $(XCODE_DIR)) endif endif # DISABLE_IOS + +ifndef DISABLE_ANDROID + +ANDROID_TOOLCHAIN_DIR?=$(HOME)/android-toolchain +ANDROID_TOOLCHAIN_CACHE_DIR?=$(HOME)/android-archives + +endif
\ No newline at end of file |