apply plugin: 'com.android.application' android { compileSdkVersion 26 //buildToolsVersion '27.0.3' defaultConfig { applicationId "io.highfidelity.hifiinterface" minSdkVersion 24 targetSdkVersion 26 versionCode 1 versionName "1.0" ndk { abiFilters 'arm64-v8a' } externalNativeBuild { cmake { arguments '-DHIFI_ANDROID=1', '-DANDROID_PLATFORM=android-24', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_shared', '-DQT_CMAKE_PREFIX_PATH=' + HIFI_ANDROID_PRECOMPILED + '/qt/lib/cmake', '-DNATIVE_SCRIBE=' + HIFI_ANDROID_PRECOMPILED + '/scribe', '-DHIFI_ANDROID_PRECOMPILED=' + HIFI_ANDROID_PRECOMPILED, '-DRELEASE_NUMBER=' + RELEASE_NUMBER, '-DRELEASE_TYPE=' + RELEASE_TYPE, '-DBUILD_BRANCH=' + BUILD_BRANCH, '-DDISABLE_QML=ON', '-DDISABLE_KTX_CACHE=ON' } } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } externalNativeBuild { cmake { path '../../CMakeLists.txt' } } applicationVariants.all { variant -> // Our asset contents depend on items produced in the CMake build // so our merge has to depend on the external native build variant.externalNativeBuildTasks.each { task -> variant.mergeResources.dependsOn(task) } variant.mergeAssets.doLast { def assetList = new LinkedList() def youngestLastModified = 0 // Copy the compiled resources generated by the external native build copy { from new File(projectDir, "../../interface/compiledResources") into outputDir duplicatesStrategy DuplicatesStrategy.INCLUDE eachFile { details -> youngestLastModified = Math.max(youngestLastModified, details.lastModified) assetList.add(details.path) } } // Copy the scripts directory copy { from new File(projectDir, "../../scripts") into new File(outputDir, "scripts") duplicatesStrategy DuplicatesStrategy.INCLUDE eachFile { details-> youngestLastModified = Math.max(youngestLastModified, details.lastModified) assetList.add("scripts/" + details.path) } } // Write a list of files to be unpacked to the cache folder new File(outputDir, 'cache_assets.txt').withWriter { out -> out.println(Long.toString(youngestLastModified)) assetList.each { file -> out.println(file) } } } variant.outputs.all { if (RELEASE_NUMBER != '0') { outputFileName = "app_" + RELEASE_NUMBER + "_" + RELEASE_TYPE + ".apk" } } } } dependencies { implementation 'com.google.vr:sdk-audio:1.80.0' implementation 'com.google.vr:sdk-base:1.80.0' implementation fileTree(include: ['*.jar'], dir: 'libs') }