Skip to content
New issue

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

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

Already on GitHub? # to your account

android: Update Gradle, Android plugin, build tools, NDK #942

Merged
merged 15 commits into from
Sep 2, 2022
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
20 changes: 12 additions & 8 deletions .github/workflows/test-java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,23 @@ jobs:

android-tests:
name: Android emulator
runs-on: macos-10.15
runs-on: macos-11
steps:
# This particular version of CMake confuses Gradle by not being semver.
# We're fine with 3.10.2 which is also installed. Keep an eye on the
# virtual environments though:
# https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#android
- name: Nuke CMake 3.18.1-g262b901
run: |
~/Library/Android/sdk/tools/bin/sdkmanager --uninstall 'cmake;3.18.1'
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
- name: Install Android SDK
run: |
~/Library/Android/sdk/tools/bin/sdkmanager \
'build-tools;30.0.3' \
'cmake;3.22.1' \
'platforms;android-30' \
'ndk;25.0.8775105'
# macos-11 defaults to Java 8, but Gradle requires Java 11.
# Do this after sdkmanager usage, because *it* needs Java 8.
- name: Use Java 11
run: echo "JAVA_HOME=$JAVA_HOME_11_X64" >> "$GITHUB_ENV"
- name: Build Themis
# This step tends to randomly hang up. Use a shorter timeout here
# instead of the default 6-hour one.
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Changes that are currently in development and have not been released yet.

_Code:_

- **Android**

- AndroidThemis build from source now requires Gradle 7.3, Android SDK 11, Android NDK 25 ([#942](https://github.com/cossacklabs/themis/pull/942)).

- **Node.js**

- Node.js v8 is no longer supported ([#901](https://github.com/cossacklabs/themis/pull/901)).
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ allprojects {
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

// Set common Kotlin version that we are going to use.
ext.kotlin_version = '1.3.72'
// Can't use higher versions if we are to maintain API 21 as our minimum.
// > Invoke-customs are only supported starting with Android O (--min-api 26)
ext.kotlin_version = '1.4.32'
}

repositories {
google()
jcenter()
mavenCentral()
}
}
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Sun Aug 28 12:43:21 JST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
115 changes: 0 additions & 115 deletions jni/Android.mk

This file was deleted.

24 changes: 0 additions & 24 deletions jni/Application.mk

This file was deleted.

66 changes: 66 additions & 0 deletions jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# CMake project configuration for Android.
project(AndroidThemis C)
cmake_minimum_required(VERSION 3.22.1)

# BoringSSL
# =========

add_subdirectory(../third_party/boringssl/src boringssl)

# Soter
# =====

file(GLOB SOTER_SOURCES
../src/soter/*.c
../src/soter/ed25519/*.c
../src/soter/boringssl/*.c
)
add_library(soter STATIC ${SOTER_SOURCES})
target_compile_definitions(soter
PRIVATE
-DBORINGSSL
-DCRYPTO_ENGINE_PATH=boringssl
)
target_include_directories(soter
PUBLIC
../include
PRIVATE
../src
../third_party/boringssl/src/include
)

# Themis
# ======

file(GLOB THEMIS_SOURCES ../src/themis/*.c)
add_library(themis STATIC ${THEMIS_SOURCES})
target_compile_definitions(themis
PRIVATE
-DBORINGSSL
-DCRYPTO_ENGINE_PATH=boringssl
)
target_include_directories(themis
PUBLIC
../include
PRIVATE
../src
../third_party/boringssl/src/include
)

# JNI library
# ===========

file(GLOB THEMIS_JNI_SOURCES *.c)
add_library(themis_jni SHARED ${THEMIS_JNI_SOURCES})
target_compile_definitions(themis_jni
PRIVATE
-DBORINGSSL
-DCRYPTO_ENGINE_PATH=boringssl
)
target_include_directories(themis_jni
PRIVATE
../include
../src
../third_party/boringssl/src/include
)
target_link_libraries(themis_jni PRIVATE themis soter crypto decrepit)
3 changes: 0 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
include ':boringssl'
project(':boringssl').projectDir = new File('third_party/boringssl')

include ':android'
project(':android').projectDir = new File('src/wrappers/themis/android')

Expand Down
Loading