Skip to content
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

Update android build #1367

Merged
merged 1 commit into from
Jul 31, 2024
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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,25 @@ 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
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
Expand Down
4 changes: 2 additions & 2 deletions build/android/escargot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ android {
}
}

ndkVersion '25.2.9519653'
ndkVersion '27.0.12077973'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -158,7 +158,7 @@ project.afterEvaluate {
}

task clearHostJar(type: Delete) {
delete 'build/outputs/escargot.jar'
delete 'build/libs/escargot.jar'
}

task bundleHostJar(type: Jar) {
Expand Down
6 changes: 4 additions & 2 deletions build/android/escargot/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 ()
endif ()
Loading