diff --git a/README.md b/README.md index 3da9ed432..f718c9fc8 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,11 @@ ninja ## Build Android version +Build prerequisites on Ubuntu: +```sh +sudo apt install openjdk-17-jdk # require java 17 +``` + ```sh git clone https://github.com/Samsung/escargot.git cd escargot @@ -46,10 +51,13 @@ git submodule update --init third_party export ANDROID_SDK_ROOT=.... # set your android SDK root first cd build/android/ ./gradlew bundleReleaseAar # build escargot AAR +./gradlew bundleHostJar # bundle jar for host +./gradlew javadocJar # create java doc +./gradlew sourcesJar # create sources jar + ./gradlew assembleDebug # build debug test shell ./gradlew :escargot:connectedDebugAndroidTest # run escargot-jni tests on android device ./gradlew :escargot:testDebugUnitTest # run escargot-jni tests on host -./gradlew bundleHostJar # bundle jar for host ``` ## Build Windows version diff --git a/build/android/escargot/build.gradle b/build/android/escargot/build.gradle index 476a71420..5bd427803 100644 --- a/build/android/escargot/build.gradle +++ b/build/android/escargot/build.gradle @@ -82,7 +82,7 @@ android { } } - ndkVersion '25.2.9519653' + ndkVersion '27.0.12077973' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -158,7 +158,7 @@ project.afterEvaluate { } task clearHostJar(type: Delete) { - delete 'build/outputs/escargot.jar' + delete 'build/libs/escargot.jar' } task bundleHostJar(type: Jar) { diff --git a/build/android/escargot/src/main/cpp/CMakeLists.txt b/build/android/escargot/src/main/cpp/CMakeLists.txt index a53331f16..4fddf5d8f 100644 --- a/build/android/escargot/src/main/cpp/CMakeLists.txt +++ b/build/android/escargot/src/main/cpp/CMakeLists.txt @@ -33,11 +33,13 @@ endif () if (UNDER_NDK) FIND_LIBRARY(LOG_LIBRARY log) -else (UNDER_NDK) +else () FIND_PACKAGE(JNI REQUIRED) INCLUDE_DIRECTORIES(${JNI_INCLUDE_DIRS}) endif () +# enable 16KB page size (require version of Android NDK >= 27) +ADD_LINK_OPTIONS(-Wl,-z,max-page-size=16384) TARGET_LINK_LIBRARIES (escargot-jni PRIVATE escargot ${LOG_LIBRARY}) if (ENABLE_SHELL) @@ -53,4 +55,4 @@ if (ENABLE_SHELL) ADD_EXECUTABLE(test-data-runner ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../tools/test/test-data-runner/test-data-runner.cpp) TARGET_COMPILE_OPTIONS(test-data-runner PRIVATE -std=c++11) -endif () \ No newline at end of file +endif ()