Skip to content

Commit

Permalink
android: ndk build in Gradle fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JaCzekanski committed Aug 1, 2019
1 parent eaa4f67 commit 70efb6d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
8 changes: 2 additions & 6 deletions .travis/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ find $ASSETS_DIR -type f -name .gitignore -exec rm {} \;

# Build
pushd android

# Native code
NDK_PROJECT_PATH=`pwd`/app ndk-build PM5_CONFIG=release_x64 -j4 avocado NDK_DEBUG=0
ccache -s

# Java code
ls -lat .
./gradlew assembleRelease
find app/build/outputs
popd

# Tests
Expand Down
3 changes: 2 additions & 1 deletion android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ fastlane/report.xml
fastlane/README.md


app/obj
app/obj
app/.externalNativeBuild/
30 changes: 15 additions & 15 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apply plugin: 'com.android.application'

def signingPassword = System.getenv("keystore_password")
def signingEnabled = System.getenv("CI") == "true"
def signingEnabled = signingPassword != null
println "App signing: $signingEnabled"

android {
compileSdkVersion 28
Expand All @@ -13,13 +14,10 @@ android {
versionName "0.1.0"
externalNativeBuild {
ndkBuild {
arguments 'PM5_CONFIG=release_x64 NDK_DEBUG=0'
targets "libavocado.so"
arguments 'PM5_CONFIG=release_x64', '-j4'
targets "avocado"
}
}
ndk {
abiFilters "x86_64", "arm64-v8a"
}
}
signingConfigs {
if (signingEnabled) {
Expand All @@ -39,18 +37,20 @@ android {
if (signingEnabled) {
signingConfig signingConfigs.release
}
ndk {
abiFilters "arm64-v8a", "armeabi-v7a"
}
}
debug {
ndk {
abiFilters "x86_64"
}
}
}


// externalNativeBuild {
// ndkBuild {
// path 'jni/Android.mk'
// }
// }
sourceSets{
main {
jniLibs.srcDirs = ['obj/local']
externalNativeBuild {
ndkBuild {
path 'jni/Android.mk'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0-beta02'
classpath 'com.android.tools.build:gradle:3.4.2'
}
}

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
2 changes: 1 addition & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ workspace "Avocado"
startproject "avocado"
defaultplatform "x86"

ndkabi "arm64-v8a"
ndkabi "arm64-v8a armeabi-v7a"
ndkstl "c++_static"
ndkplatform "android-24"

Expand Down

0 comments on commit 70efb6d

Please sign in to comment.