diff options
Diffstat (limited to 'navit/android/build.gradle')
-rw-r--r-- | navit/android/build.gradle | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/navit/android/build.gradle b/navit/android/build.gradle new file mode 100644 index 000000000..1385336bf --- /dev/null +++ b/navit/android/build.gradle @@ -0,0 +1,96 @@ +apply plugin: 'com.android.application' +apply from: "$project.rootDir/gradle/scripts/git-scm-version.gradle" +apply plugin: 'checkstyle' + +android { + compileSdkVersion 27 + buildToolsVersion "27.0.3" + defaultConfig { + applicationId "org.navitproject.navit" + minSdkVersion 9 + targetSdkVersion 27 + versionCode gitVersionCode + versionName gitVersionName + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + ndk { // need for now for 'x86_64' and , 'armeabi' and , 'arm64-v8a' + abiFilters 'x86', 'armeabi-v7a' + } + externalNativeBuild { + cmake { + arguments '-DUSE_PLUGINS=n', '-DBUILD_MAPTOOL=n', '-DXSL_PROCESSING=y', '-DXSLTS=android', '-DANDROID=y', '-DSAMPLE_MAP=n' + } + } + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + lintOptions { + disable 'UnusedResources' + abortOnError true + } + sourceSets { + main { + manifest.srcFile "AndroidManifest.xml" + java.srcDirs = ["src"] + resources.srcDirs = ["src"] + renderscript.srcDirs = ["src"] + res.srcDirs = ["res"] + assets.srcDirs = ["assets"] + } + } + externalNativeBuild { + cmake { + path '../../CMakeLists.txt' + } + } + + task checkstyleMain(type: Checkstyle){ + source 'src' + include '**/*.java' + configFile = rootProject.file('checkstyle.xml') + ignoreFailures = false + showViolations = true + // empty classpath + classpath = files() + reports { + include ('**/*.java') + exclude ('**/FileBrowserActivity.java') + xml.enabled = true + html.enabled = true + xml { + destination "checkstyle/checkstyleMain.xml" + } + html { + destination "checkstyle/checkstyleMain.html" + } + } + + checkstyle { + toolVersion = '8.10' + } + } + applicationVariants.all { variant -> + // create tasks to generate Javadocs + task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { + source = variant.javaCompile.source + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + destinationDir = file("build/outputs/docs/javadoc/") + title = rootProject.name + verbose = true + failOnError false + } + } + +} +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { + exclude group: 'com.android.support', module: 'support-annotations' + }) + testImplementation 'junit:junit:4.12' + implementation 'ch.acra:acra:4.9.2' +// implementation 'com.android.support:support-v4:27.1.1' +} |