Rewrite Gradle configuration to simplify further (#581)
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
bf9892c047
commit
df0c886152
4 changed files with 97 additions and 81 deletions
|
@ -2,8 +2,6 @@
|
||||||
* Copyright © 2014-2019 The Android Password Store Authors. All Rights Reserved.
|
* Copyright © 2014-2019 The Android Password Store Authors. All Rights Reserved.
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'kotlin-android'
|
id 'kotlin-android'
|
||||||
id 'kotlin-kapt'
|
id 'kotlin-kapt'
|
||||||
|
@ -68,43 +66,34 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.appcompat:appcompat:' + versions.appcompat
|
implementation deps.androidx.annotation
|
||||||
implementation 'androidx.cardview:cardview:' + versions.cardview
|
implementation deps.androidx.appcompat
|
||||||
implementation 'androidx.core:core-ktx:' + versions.coreKtx
|
implementation deps.androidx.biometric
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:' + versions.constraintLayout
|
implementation deps.androidx.cardview
|
||||||
implementation 'androidx.documentfile:documentfile:' + versions.documentfile
|
implementation deps.androidx.core_ktx
|
||||||
implementation 'androidx.preference:preference:' + versions.preference
|
implementation deps.androidx.constraint_layout
|
||||||
implementation ('androidx.recyclerview:recyclerview:' + versions.recyclerview) {
|
implementation deps.androidx.documentfile
|
||||||
|
implementation deps.androidx.preference
|
||||||
|
implementation (deps.androidx.recycler_view) {
|
||||||
force = true
|
force = true
|
||||||
}
|
}
|
||||||
implementation 'com.google.android.material:material:' + versions.material
|
implementation deps.androidx.material
|
||||||
implementation 'androidx.annotation:annotation:' + versions.annotation
|
implementation deps.third_party.commons_io
|
||||||
implementation 'androidx.biometric:biometric:' + versions.biometric
|
implementation deps.third_party.commons_codec
|
||||||
implementation 'com.github.android-password-store:openpgp-ktx:' + versions.openpgp
|
|
||||||
implementation('org.eclipse.jgit:org.eclipse.jgit:' + versions.jgit) {
|
implementation(deps.third_party.jgit) {
|
||||||
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
|
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
|
||||||
}
|
}
|
||||||
implementation 'com.jcraft:jsch:' + versions.jsch
|
implementation deps.third_party.jsch
|
||||||
implementation 'commons-io:commons-io:' + versions.commons_io
|
implementation deps.third_party.openpgp_ktx
|
||||||
implementation 'commons-codec:commons-codec:' + versions.commons_codec
|
implementation deps.third_party.ssh_auth
|
||||||
implementation 'org.sufficientlysecure:sshauthentication-api:' + versions.sshauth
|
|
||||||
|
|
||||||
// Testing-only dependencies
|
// Testing-only dependencies
|
||||||
androidTestImplementation 'junit:junit:4.13-rc-1'
|
androidTestImplementation deps.testing.junit
|
||||||
androidTestImplementation 'org.mockito:mockito-core:3.1.0'
|
androidTestImplementation deps.testing.mockito_core
|
||||||
androidTestImplementation 'androidx.test:runner:1.3.0-alpha02'
|
androidTestImplementation deps.testing.androidx.runner
|
||||||
androidTestImplementation 'androidx.test:rules:1.3.0-alpha02'
|
androidTestImplementation deps.testing.androidx.rules
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2-alpha02'
|
androidTestImplementation deps.testing.androidx.junit
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'
|
androidTestImplementation deps.testing.androidx.espresso_core
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0-alpha02'
|
androidTestImplementation deps.testing.androidx.espresso_intents
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
|
||||||
options.compilerArgs << '-Xlint:unchecked'
|
|
||||||
options.deprecation = true
|
|
||||||
}
|
|
||||||
tasks.withType(KotlinCompile) {
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = '1.8'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
19
build.gradle
19
build.gradle
|
@ -3,7 +3,7 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
*/
|
*/
|
||||||
buildscript {
|
buildscript {
|
||||||
apply from: rootProject.file('versions.gradle')
|
apply from: rootProject.file('dependencies.gradle')
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
@ -11,9 +11,9 @@ buildscript {
|
||||||
maven { url 'https://plugins.gradle.org/m2/' }
|
maven { url 'https://plugins.gradle.org/m2/' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:' + versions.gradlePlugin
|
classpath deps.gradle_plugin.android
|
||||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:' + versions.kotlin
|
classpath deps.gradle_plugin.kotlin
|
||||||
classpath 'com.diffplug.spotless:spotless-plugin-gradle:' + versions.spotless
|
classpath deps.gradle_plugin.spotless
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ allprojects {
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
apply from: rootProject.file('versions.gradle')
|
apply from: rootProject.file('dependencies.gradle')
|
||||||
apply from: rootProject.file('spotless.gradle')
|
apply from: rootProject.file('spotless.gradle')
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
@ -56,6 +56,15 @@ subprojects {
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << '-Xlint:unchecked'
|
||||||
|
options.deprecation = true
|
||||||
|
}
|
||||||
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: rootProject.file('spotless.root.gradle')
|
apply from: rootProject.file('spotless.root.gradle')
|
||||||
|
|
59
dependencies.gradle
Normal file
59
dependencies.gradle
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
/*
|
||||||
|
* Copyright © 2014-2019 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
*/
|
||||||
|
ext.versions = [
|
||||||
|
minSdk: 21,
|
||||||
|
targetSdk: 29,
|
||||||
|
compileSdk: 29,
|
||||||
|
versionCode: 10303,
|
||||||
|
versionName: '1.3.3',
|
||||||
|
buildTools: '29.0.2'
|
||||||
|
]
|
||||||
|
|
||||||
|
ext.deps = [
|
||||||
|
gradle_plugin: [
|
||||||
|
android: 'com.android.tools.build:gradle:3.5.2',
|
||||||
|
kotlin: 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.60',
|
||||||
|
spotless: 'com.diffplug.spotless:spotless-plugin-gradle:3.26.0'
|
||||||
|
],
|
||||||
|
|
||||||
|
kotlin: [
|
||||||
|
stdlib8: 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
|
||||||
|
],
|
||||||
|
|
||||||
|
androidx: [
|
||||||
|
annotation: 'androidx.annotation:annotation:1.1.0',
|
||||||
|
appcompat: 'androidx.appcompat:appcompat:1.1.0',
|
||||||
|
biometric: 'androidx.biometric:biometric:1.0.0',
|
||||||
|
cardview: 'androidx.cardview:cardview:1.0.0',
|
||||||
|
constraint_layout: 'androidx.constraintlayout:constraintlayout:2.0.0-beta3',
|
||||||
|
core_ktx: 'androidx.core:core-ktx:1.2.0-beta02',
|
||||||
|
documentfile: 'androidx.documentfile:documentfile:1.0.1',
|
||||||
|
material: 'com.google.android.material:material:1.2.0-alpha01',
|
||||||
|
preference: 'androidx.preference:preference:1.1.0',
|
||||||
|
recycler_view: 'androidx.recyclerview:recyclerview:1.0.0'
|
||||||
|
],
|
||||||
|
|
||||||
|
third_party: [
|
||||||
|
commons_io: 'commons-io:commons-io:2.5',
|
||||||
|
commons_codec: 'commons-codec:commons-codec:1.13',
|
||||||
|
jsch: 'com.jcraft:jsch:0.1.55',
|
||||||
|
jgit: 'org.eclipse.jgit:org.eclipse.jgit:3.7.1.201504261725-r',
|
||||||
|
openpgp_ktx: 'com.github.android-password-store:openpgp-ktx:0.1.0',
|
||||||
|
ssh_auth: 'org.sufficientlysecure:sshauthentication-api:1.0'
|
||||||
|
],
|
||||||
|
|
||||||
|
testing: [
|
||||||
|
junit: 'junit:junit:4.13-rc-1',
|
||||||
|
koin_test: 'org.koin:koin-test:2.0.1',
|
||||||
|
mockito_core: 'org.mockito:mockito-core:3.1.0',
|
||||||
|
androidx: [
|
||||||
|
runner: 'androidx.test:runner:1.3.0-alpha02',
|
||||||
|
rules: 'androidx.test:rules:1.3.0-alpha02',
|
||||||
|
junit: 'androidx.test.ext:junit:1.1.2-alpha02',
|
||||||
|
espresso_core: 'androidx.test.espresso:espresso-core:3.3.0-alpha02',
|
||||||
|
espresso_intents: 'androidx.test.espresso:espresso-intents:3.3.0-alpha02'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
|
@ -1,41 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright © 2014-2019 The Android Password Store Authors. All Rights Reserved.
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-only
|
|
||||||
*/
|
|
||||||
ext {
|
|
||||||
versions = [
|
|
||||||
// Project
|
|
||||||
minSdk: 21,
|
|
||||||
targetSdk: 29,
|
|
||||||
compileSdk: 29,
|
|
||||||
versionCode: 10303,
|
|
||||||
versionName: '1.3.3',
|
|
||||||
buildTools: '29.0.2',
|
|
||||||
|
|
||||||
// Plugins
|
|
||||||
gradlePlugin: '3.5.2',
|
|
||||||
kotlin: '1.3.60',
|
|
||||||
spotless: '3.26.0',
|
|
||||||
|
|
||||||
// AndroidX
|
|
||||||
annotation: '1.1.0',
|
|
||||||
appcompat: '1.1.0',
|
|
||||||
biometric: '1.0.0',
|
|
||||||
cardview: '1.0.0',
|
|
||||||
constraintLayout: '2.0.0-beta3',
|
|
||||||
coreKtx: '1.2.0-beta02',
|
|
||||||
documentfile: '1.0.1',
|
|
||||||
fragmentKtx: '1.2.0-rc02',
|
|
||||||
material: '1.2.0-alpha01',
|
|
||||||
preference: '1.1.0',
|
|
||||||
recyclerview: '1.0.0',
|
|
||||||
|
|
||||||
// Third party
|
|
||||||
commons_io: '2.5',
|
|
||||||
commons_codec: '1.13',
|
|
||||||
jgit: '3.7.1.201504261725-r',
|
|
||||||
jsch: '0.1.55',
|
|
||||||
openpgp: '0.1.0',
|
|
||||||
sshauth: '1.0'
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
Reference in a new issue