apply plugin: 'com.android.application' android { compileSdkVersion androidVersions.compileSdkVersion defaultConfig { applicationId "com.mapbox.mapboxsdk.testapp" minSdkVersion androidVersions.minSdkVersion targetSdkVersion androidVersions.targetSdkVersion versionCode 13 versionName "6.0.0" testInstrumentationRunner "com.mapbox.mapboxsdk.InstrumentationRunner" } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultPublishConfig project.hasProperty("mapbox.buildtype") ? project.getProperty("mapbox.buildtype") : "debug" // We sometimes want to invoke Gradle without building a native dependency, e.g. when we just want // to invoke the Java tests. When we explicitly specify an ABI of 'none', no native dependencies are // added. When another ABI is specified explicitly, we're just going to build that ABI. In all other // cases, all ABIs are built. // // When invoking from the command line or to override the device default, set `-Pmapbox.abis=...` to // only build the desired architectures. // // When building from Android Studio, gradle.properties sets `android.buildOnlyTargetAbi=true` so that // only the architecture for the device you're running on gets built. def abi = 'all' if (!project.hasProperty('android.injected.invoked.from.ide') || project.hasProperty("mapbox.abis")) { // Errors when the user invokes Gradle from the command line and didn't set mapbox.abis abi = project.getProperty("mapbox.abis") } if (abi != 'none') { externalNativeBuild { cmake { path "../../../CMakeLists.txt" version "3.10.2" } } } // Allow determining the C++ STL we're using when building Mapbox GL. def stl = 'c++_static' if (project.hasProperty("mapbox.stl")) { stl = project.getProperty("mapbox.stl") } defaultConfig { if (abi != 'none') { externalNativeBuild { cmake { arguments "-DANDROID_TOOLCHAIN=clang" arguments "-DANDROID_STL=" + stl arguments "-DANDROID_CPP_FEATURES=exceptions" arguments "-DMBGL_PLATFORM=android" arguments "-DMASON_PLATFORM=android" arguments "-DNodeJS_EXECUTABLE=" + node arguments "-Dnpm_EXECUTABLE=" + npm // Enable ccache if the user has installed it. if (ccache?.trim()) { arguments "-DANDROID_CCACHE=" + ccache } cFlags "-Qunused-arguments" cppFlags "-Qunused-arguments" targets "example-custom-layer" if (abi != 'all') { abiFilters abi.split(' ') } else { abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } } } } packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'LICENSE.txt' } lintOptions { baseline file("lint-baseline-local.xml") checkAllWarnings true warningsAsErrors true disable 'MissingTranslation', 'GoogleAppIndexingWarning', 'UnpackedNativeCode', 'IconDipSize', 'TypographyQuotes' abortOnError false } buildTypes { debug { testCoverageEnabled true minifyEnabled false shrinkResources false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug } } dexOptions { maxProcessCount 8 javaMaxHeapSize "2g" preDexLibraries true } } dependencies { implementation dependenciesList.kotlinLib implementation project(':MapboxGLAndroidSDK') implementation dependenciesList.mapboxJavaTurf implementation dependenciesList.supportAppcompatV7 implementation dependenciesList.supportRecyclerView implementation dependenciesList.supportDesign implementation dependenciesList.supportConstraintLayout implementation dependenciesList.gmsLocation implementation dependenciesList.timber debugImplementation dependenciesList.leakCanaryDebug releaseImplementation dependenciesList.leakCanaryRelease androidTestImplementation dependenciesList.supportAnnotations androidTestImplementation dependenciesList.testRunner androidTestImplementation dependenciesList.testRules androidTestImplementation dependenciesList.testEspressoCore androidTestImplementation dependenciesList.testEspressoIntents androidTestImplementation dependenciesList.testEspressoContrib androidTestImplementation dependenciesList.testUiAutomator } apply from: "${rootDir}/gradle/gradle-make.gradle" apply from: "${rootDir}/gradle/gradle-config.gradle" apply from: "${rootDir}/gradle/gradle-checkstyle.gradle" apply from: "${rootDir}/gradle/gradle-lint.gradle" apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions'