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 of Android build (with Gradle) #926

Merged
merged 3 commits into from
Nov 6, 2018
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
67 changes: 35 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,38 +84,41 @@ matrix:
sources:
- ubuntu-toolchain-r-test
# Android
# - language: android
# android:
# addons:
# apt:
# update: true
# components:
# - tools
# - platform-tools
# - android-21
# - sys-img-armeabi-v7a-android-21
# env:
# - ANDROID=true
# before_install:
# - git submodule update --init --recursive
# - sudo apt-get install wget unzip tree
# install:
# # Accept SDK Licenses + Install NDK
# - yes | sdkmanager --update > /dev/null 2>&1
# - sdkmanager ndk-bundle > /dev/null 2>&1
# # Download Gradle 4.3.1
# - wget https://services.gradle.org/distributions/gradle-4.3.1-bin.zip
# - mkdir -p gradle
# - unzip -q -d ./gradle gradle-4.3.1-bin.zip
# - export GRADLE=${TRAVIS_BUILD_DIR}/gradle/gradle-4.3.1/bin/gradle
# before_script:
# - bash $GRADLE --version
# - cd ./support
# script:
# - bash $GRADLE clean assemble
# after_success:
# - cd ${TRAVIS_BUILD_DIR}
# - tree ./libs
luncliff marked this conversation as resolved.
Show resolved Hide resolved
- language: android
addons:
apt:
update: true
sources:
- ubuntu-toolchain-r-test
packages:
- wget
- unzip
- tree
android:
components:
- tools
- platform-tools
- android-21
env:
- ANDROID=true
before_install:
# Download/Install Gradle
- wget https://services.gradle.org/distributions/gradle-4.10.2-bin.zip
- mkdir -p gradle
- unzip -q -d ./gradle gradle-4.10.2-bin.zip
- export GRADLE=gradle/gradle-4.10.2/bin/gradle
- bash $GRADLE --version
install:
# Accept SDK Licenses + Install NDK
- yes | sdkmanager --update > /dev/null 2>&1
- sdkmanager ndk-bundle > /dev/null 2>&1
before_script:
- pushd ./support
script:
- bash ../$GRADLE clean assemble
after_success:
- popd;
- tree ./libs

before_script:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then export CXX=${COMPILER}; fi
Expand Down
2 changes: 1 addition & 1 deletion support/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="fmt" />
<manifest package="net.fmtlib" />
27 changes: 17 additions & 10 deletions support/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@

// General gradle arguments for root project
buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
//
// https://developer.android.com/studio/releases/gradle-plugin
//
// Notice that 3.1.3 here is the version of [Android Gradle Plugin]
// Accroding to URL above you will need Gradle 4.4 or higher
//
classpath 'com.android.tools.build:gradle:3.1.3'
}
}

repositories {
google()
jcenter()
}

// Output: Shared library (.so) for Android
apply plugin: 'com.android.library'

Expand All @@ -24,20 +34,17 @@ android {
splits {
abi {
enable true
// Be general, as much as possible ...
// universalApk true

// Specify platforms for Application
reset()
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
include "arm64-v8a", "armeabi-v7a", "x86_64"
}
}

defaultConfig {
minSdkVersion 21 // Android 5.0+
targetSdkVersion 25 // Follow Compile SDK
versionCode 16 // Follow release count
versionName "4.1.0" // Follow Official version
versionCode 20 // Follow release count
versionName "5.2.1" // Follow Official version
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

externalNativeBuild {
Expand All @@ -46,7 +53,7 @@ android {
arguments "-DBUILD_SHARED_LIBS=true" // Build shared object
arguments "-DFMT_TEST=false" // Skip test
arguments "-DFMT_DOC=false" // Skip document
cppFlags "-std=c++14"
cppFlags "-std=c++17"
}
}
println("Gradle CMake Plugin: ")
Expand Down