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 Jul 31, 2019
1 parent eaa4f67 commit 3fc1504
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 25 deletions.
6 changes: 0 additions & 6 deletions .travis/android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ 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
./gradlew assembleRelease
popd

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
Expand Up @@ -13,13 +13,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,20 +36,23 @@ 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'
}
}
}

dependencies {
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 3fc1504

Please sign in to comment.