blob: 5c56220b08f9403b1bb70451acf428c8b61c78b1 [file] [log] [blame]
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "com.google.cardboard.hellocardboard"
// #gles3 #vulkan - You can reduce minSdkVersion down to 16 depending
// on rendering APIs supported:
//
// OpenGL ES 2.0 - Requires 16 or higher
// OpenGL ES 3.0 - Requires 18 or higher
// Vulkan - Requires 24 or higher
//
// See the release notes for details.
minSdkVersion 24
targetSdkVersion 31
versionCode 1
versionName "1.18.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
externalNativeBuild.cmake {
arguments "-DANDROID_STL=c++_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild.cmake {
path "CMakeLists.txt"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.2'
// Android Mobile Vision
// TODO(b/213613345) Migrate to ML Kit.
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.protobuf:protobuf-javalite:3.19.4'
implementation project(":sdk")
}
// The dependencies for NDK builds live inside the .aar files so they need to
// be extracted before NDK targets can link against.
task extractNdk(type: Copy) {
if (file("${project.rootDir}/sdk/build/outputs/aar/sdk-release.aar").exists()) {
copy {
from zipTree("${project.rootDir}/sdk/build/outputs/aar/sdk-release.aar")
into "libraries/"
include "jni/**/libGfxPluginCardboard.so"
}
copy {
from "${project.rootDir}/sdk/include/cardboard.h"
into "libraries/"
}
}
}
task deleteNdk(type: Delete) {
delete "libraries/jni"
delete "libraries/cardboard.h"
}
build.dependsOn(extractNdk)
clean.dependsOn(deleteNdk)