Skip to content
This repository has been archived by the owner on Jul 29, 2021. It is now read-only.

Commit

Permalink
Update Android build with 4.0.0 gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ggfan committed Jul 8, 2020
1 parent f938eb1 commit ddbec78
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,17 @@ before_install:
export ARCH=`uname -m`
wget http://dl.google.com/android/repository/android-ndk-r15c-linux-${ARCH}.zip
unzip -u -q android-ndk-r15c-linux-${ARCH}.zip
export ANDROID_NDK_HOME=`pwd`/android-ndk-r15c
# export ANDROID_NDK_HOME=`pwd`/android-ndk-r15c
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export PATH="$ANDROID_NDK_HOME:$PATH"
pushd android-ndk-r15c
ndk_version=$(grep ndkVersion API-Samples/android/project_template/build.gradle | sed "s/^.*ndkVersion//; s/'//g"|sed 's/"//g;s/[[:space:]]//g')
if [ ! -z $ndk_version ]
then
yes | sdkmanager --channel=3 --install "ndk;$ndk_version"
fi
yes | sdkmanager --update
popd
fi
Expand Down
4 changes: 3 additions & 1 deletion API-Samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ function(sampleWithSingleFile)
# Add validation layer settings.
set (SAMPLE_WITH_TOOLS create_debug_report_callback enable_validation_with_callback)
if (";${SAMPLE_WITH_TOOLS};" MATCHES ";${SAMPLE_NAME};")
set (VALIDATIONLAYER_PACKING "sourceSets.main.jniLibs.srcDirs file(ndkDir).absolutePath +\n\t\t\t\t'/sources/third_party/vulkan/src/build-android/jniLibs'")
set (VALIDATIONLAYER_PACKING "sourceSets.main.jniLibs.srcDirs ")
string(APPEND VALIDATIONLAYER_PACKING "file(android.ndkDirectory.path).absolutePath +\n")
string(APPEND VALIDATIONLAYER_PACKING "\t\t\t\t'/sources/third_party/vulkan/src/build-android/jniLibs'")
endif()

# Cook template files.
Expand Down
2 changes: 1 addition & 1 deletion API-Samples/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
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.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
9 changes: 4 additions & 5 deletions API-Samples/android/project_template/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@

apply plugin: 'com.android.application'

def ndkDir=android.ndkDirectory.path
def stlType = 'c++_static'

android {
compileSdkVersion 26
compileSdkVersion 30
buildToolsVersion '30.0.0'
ndkVersion '21.3.6528147'

defaultConfig {
applicationId '@PACKAGE_NAME@'
minSdkVersion 24 // Official vulkan support starts in version 24
minSdkVersion 24 // Official vulkan support starts from API level 24
targetSdkVersion 26
versionCode 1
versionName '0.0.1'
Expand All @@ -45,8 +46,6 @@ android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
@ASSET_DIR@
Expand Down

0 comments on commit ddbec78

Please sign in to comment.