119 lines
4.0 KiB
Groovy
119 lines
4.0 KiB
Groovy
plugins {
|
|
id 'org.jmailen.kotlinter'
|
|
}
|
|
|
|
apply plugin: 'com.android.library'
|
|
apply plugin: "com.jaredsburrows.license"
|
|
apply plugin: 'kotlin-android'
|
|
apply from: "${rootDir}/gradle/native-build.gradle"
|
|
|
|
dependencies {
|
|
lintChecks project(":MapboxGLAndroidSDKLint")
|
|
api dependenciesList.mapboxJavaGeoJSON
|
|
api dependenciesList.mapboxAndroidGestures
|
|
|
|
implementation dependenciesList.mapboxJavaTurf
|
|
implementation dependenciesList.supportAnnotations
|
|
implementation dependenciesList.supportFragmentV4
|
|
implementation dependenciesList.okhttp3
|
|
implementation dependenciesList.gmsLocation
|
|
implementation dependenciesList.timber
|
|
implementation dependenciesList.interpolator
|
|
|
|
testImplementation dependenciesList.junit
|
|
testImplementation dependenciesList.mockito
|
|
testImplementation dependenciesList.mockk
|
|
testImplementation dependenciesList.robolectric
|
|
testImplementation dependenciesList.kotlinLib
|
|
testImplementation dependenciesList.commonsIO
|
|
testImplementation dependenciesList.assertjcore
|
|
|
|
androidTestImplementation dependenciesList.testRunner
|
|
androidTestImplementation dependenciesList.testRules
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion androidVersions.compileSdkVersion
|
|
buildToolsVersion androidSdkVersions.buildToolsVersion
|
|
|
|
defaultConfig {
|
|
minSdkVersion androidVersions.minSdkVersion
|
|
targetSdkVersion androidVersions.targetSdkVersion
|
|
buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision())
|
|
buildConfigField "String", "MAPBOX_SDK_IDENTIFIER", String.format("\"%s\"", "mapbox-maps-android")
|
|
buildConfigField "String", "MAPBOX_SDK_VERSION", String.format("\"%s\"", project.VERSION_NAME)
|
|
buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME)
|
|
buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT", String.format("\"mapbox-maps-android/%s\"", project.VERSION_NAME)
|
|
consumerProguardFiles 'proguard-rules.pro'
|
|
}
|
|
|
|
// build native libraries
|
|
List nativeTargets = ["mapbox-gl"]
|
|
if (project.hasProperty("mapbox.with_test")) {
|
|
nativeTargets.add("mbgl-test")
|
|
}
|
|
if (project.hasProperty("mapbox.with_benchmark")) {
|
|
nativeTargets.add("mbgl-benchmark")
|
|
}
|
|
nativeBuild(nativeTargets)
|
|
|
|
// avoid naming conflicts, force usage of prefix
|
|
resourcePrefix 'maplibre_'
|
|
|
|
sourceSets {
|
|
// limit amount of exposed library resources
|
|
main.res.srcDirs += 'src/main/res-public'
|
|
}
|
|
|
|
|
|
testOptions {
|
|
unitTests {
|
|
returnDefaultValues true
|
|
|
|
// Roboelectric 4.0 required config
|
|
// http://robolectric.org/migrating/#migrating-to-40
|
|
includeAndroidResources = true
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
testCoverageEnabled false
|
|
jniDebuggable true
|
|
}
|
|
}
|
|
namespace 'com.mapbox.mapboxsdk'
|
|
lint {
|
|
checkAllWarnings true
|
|
disable 'MissingTranslation', 'TypographyQuotes', 'ObsoleteLintCustomCheck', 'MissingPermission', 'WrongThreadInterprocedural'
|
|
warningsAsErrors false
|
|
}
|
|
}
|
|
|
|
licenseReport {
|
|
generateHtmlReport = false
|
|
generateJsonReport = true
|
|
copyHtmlReportToAssets = false
|
|
copyJsonReportToAssets = false
|
|
}
|
|
|
|
def static getGitRevision() {
|
|
def cmd = "git rev-parse --short HEAD"
|
|
def proc = cmd.execute()
|
|
def ref = proc.text.trim()
|
|
return ref
|
|
}
|
|
|
|
configurations {
|
|
all*.exclude group: 'commons-logging', module: 'commons-logging'
|
|
all*.exclude group: 'commons-collections', module: 'commons-collections'
|
|
}
|
|
|
|
apply from: "${rootDir}/gradle/gradle-javadoc.gradle"
|
|
apply from: "${rootDir}/gradle/gradle-checkstyle.gradle"
|
|
apply from: "${rootDir}/gradle/gradle-dependencies-graph.gradle"
|
|
apply from: "${rootDir}/gradle/gradle-update-vendor-modules.gradle"
|
|
apply from: "${rootDir}/gradle/android-nitpick.gradle"
|
|
apply from: "${rootDir}/gradle/gradle-publish.gradle"
|
|
// intentionally disabled
|
|
// apply from: "${rootDir}/gradle/jacoco-report.gradle" |