apply plugin: 'com.android.application' /* To rebuild the plugins this has to be set to true. Otherwise the prebuilt plugins library will be used. * This is only for the purpose of providing the Example App without the requirement of installing the Android NDK. */ def rebuildPlugins = false /* Defines the temporary path for the plugins shared library.*/ def wikitudeTmpPath = "${buildDir}/wikitude/libs" /* Creates a new configuration to extract the shared library from the Wikitude SDK for the Plugins to link against. */ configurations { libraryExtraction } android { compileSdkVersion 28 defaultConfig { applicationId = "com.nikoarap.artest" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { arguments "-DANDROID_TOOLCHAIN=clang", "-DANDROID_STL=c++_shared", /* Provides the path to the extracted libarchitect.so to CMake */ "-DWIKITUDE_NATIVE_PATH=${wikitudeTmpPath}/jni", /* Provides the path to that the built plugins library should be copied to to CMake */ "-DPLUGIN_OUTPUT_PATH=${project.rootDir}/plugins/src/main/jniLibs" cppFlags "-std=c++14 -Wno-inconsistent-missing-override" abiFilters 'armeabi-v7a', 'arm64-v8a' } } } sourceSets { main { jniLibs.srcDirs = ['src/main/cpp/lib'] } } if (rebuildPlugins) { externalNativeBuild { cmake { path "src/main/cpp/CMakeLists.txt" } } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } externalNativeBuild { cmake { path file('src/main/cpp/CMakeLists.txt') } } } dependencies { implementation fileTree(dir: 'lib', include: ['*.jar','*.so']) implementation fileTree(dir: 'jniLibs', include: ['*.so']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:support-v4:28.0.0' implementation 'com.android.support:support-media-compat:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation (name: 'wikitudesdk', ext:'aar') implementation 'com.google.ar:core:1.1.0' implementation 'com.google.android.gms:play-services-location:15.0.1' implementation 'com.google.android.gms:play-services-maps:15.0.1' implementation 'com.google.maps.android:android-maps-utils:0.5' implementation 'com.google.code.gson:gson:2.7' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation 'com.indooratlas.android:indooratlas-android-sdk:2.9.2@aar' implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'org.jetbrains:annotations-java5:15.0' } /* Task to extract the nativesdk shared library from the aar. */ task extractNativeLibraries() { doFirst { configurations.libraryExtraction.files.each { file -> copy { from zipTree(file) into wikitudeTmpPath include "jni/**/*" } } } } tasks.whenTaskAdded { task -> if (task.name.contains("external") && !task.name.contains("Clean")) { /* The externalNativeBuild depends on the extraction task to be able to link properly. */ task.dependsOn(extractNativeLibraries) } } repositories { flatDir{ dirs 'lib' } }