diff options
author | mvglasow <michael -at- vonglasow.com> | 2021-02-16 21:48:11 +0200 |
---|---|---|
committer | jkoan <jkoan@users.noreply.github.com> | 2021-02-19 19:26:55 +0100 |
commit | 093b653150864deec2f29095e56bc50ec9880692 (patch) | |
tree | 6e2e5e8fe59a408b54861a4904d981e518970f35 | |
parent | 5087d1d6bb2158be036cd6915b971ac934005b66 (diff) | |
download | navit-093b653150864deec2f29095e56bc50ec9880692.tar.gz |
Refactor:build:merge into one single build.gradle
Signed-off-by: mvglasow <michael -at- vonglasow.com>
-rw-r--r-- | build.gradle | 109 | ||||
-rw-r--r-- | navit/android/build.gradle | 107 | ||||
-rw-r--r-- | settings.gradle | 1 |
3 files changed, 108 insertions, 109 deletions
diff --git a/build.gradle b/build.gradle index b9db6a857..35e6be898 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,6 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.android.application' +apply from: "$project.rootDir/gradle/scripts/git-scm-version.gradle" +apply plugin: 'checkstyle' buildscript { repositories { @@ -28,6 +30,111 @@ allprojects { } } +/* task clean(type: Delete) { delete rootProject.buildDir } +*/ +android { + compileSdkVersion 29 + buildToolsVersion "29.0.2" + signingConfigs { + release { + // We can leave these in environment variables + storeFile file(System.getenv("KEYSTORE") ?: "/store") + keyAlias System.getenv("KEY_ALIAS") + storePassword System.getenv("STORE_PASS") + keyPassword System.getenv("STORE_PASS") + } + } + defaultConfig { + applicationId "org.navitproject.navit" + minSdkVersion 10 + targetSdkVersion 29 + versionCode gitVersionCode + versionName gitVersionName + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + ndk { + abiFilters 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a' + } + externalNativeBuild { + cmake { + arguments '-DDISABLE_CXX=y', '-DUSE_PLUGINS=n', '-DBUILD_MAPTOOL=n', '-DXSL_PROCESSING=n', '-DSAMPLE_MAP=n' + } + } + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + if(file(System.getenv("KEYSTORE") ?: "/store").exists()){ + signingConfig signingConfigs.release + } + } + } + lintOptions { + disable 'UnusedResources' + abortOnError true + } + sourceSets { + main { + manifest.srcFile "navit/android/AndroidManifest.xml" + java.srcDirs = ["navit/android/src"] + resources.srcDirs = ["navit/android/src"] + renderscript.srcDirs = ["navit/android/src"] + res.srcDirs = ["navit/android/res"] + assets.srcDirs = ["navit/android/assets"] + } + } + externalNativeBuild { + cmake { + path 'CMakeLists.txt' + } + } + + task checkstyleMain(type: Checkstyle){ + source 'navit/android/src' + include '**/*.java' + configFile = rootProject.file('checkstyle.xml') + ignoreFailures = false + showViolations = true + // empty classpath + classpath = files() + reports { + include ('**/*.java') + xml.enabled = true + html.enabled = true + xml { + destination file("checkstyle/checkstyleMain.xml") + } + html { + destination file("checkstyle/checkstyleMain.html") + } + } + + checkstyle { + toolVersion = '8.26' + } + } + applicationVariants.all { variant -> + // create tasks to generate Javadocs + task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + destinationDir = file("navit/android/build/outputs/docs/javadoc/") + title = rootProject.name + options.memberLevel = JavadocMemberLevel.PACKAGE + verbose = true + failOnError false + } + } + +} +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'navit/android/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:28.0.0' +} diff --git a/navit/android/build.gradle b/navit/android/build.gradle deleted file mode 100644 index 0d5ef7a70..000000000 --- a/navit/android/build.gradle +++ /dev/null @@ -1,107 +0,0 @@ -apply plugin: 'com.android.application' -apply from: "$project.rootDir/gradle/scripts/git-scm-version.gradle" -apply plugin: 'checkstyle' - -android { - compileSdkVersion 29 - buildToolsVersion "29.0.2" - signingConfigs { - release { - // We can leave these in environment variables - storeFile file(System.getenv("KEYSTORE") ?: "/store") - keyAlias System.getenv("KEY_ALIAS") - storePassword System.getenv("STORE_PASS") - keyPassword System.getenv("STORE_PASS") - } - } - defaultConfig { - applicationId "org.navitproject.navit" - minSdkVersion 10 - targetSdkVersion 29 - versionCode gitVersionCode - versionName gitVersionName - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - ndk { - abiFilters 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a' - } - externalNativeBuild { - cmake { - arguments '-DDISABLE_CXX=y', '-DUSE_PLUGINS=n', '-DBUILD_MAPTOOL=n', '-DXSL_PROCESSING=n', '-DSAMPLE_MAP=n' - } - } - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - if(file(System.getenv("KEYSTORE") ?: "/store").exists()){ - signingConfig signingConfigs.release - } - } - } - 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') - xml.enabled = true - html.enabled = true - xml { - destination file("checkstyle/checkstyleMain.xml") - } - html { - destination file("checkstyle/checkstyleMain.html") - } - } - - checkstyle { - toolVersion = '8.26' - } - } - applicationVariants.all { variant -> - // create tasks to generate Javadocs - task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - destinationDir = file("build/outputs/docs/javadoc/") - title = rootProject.name - options.memberLevel = JavadocMemberLevel.PACKAGE - 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:28.0.0' -} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 5cac9edd2..000000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include 'navit:android' |