Optimize gradle build scripts

This commit is contained in:
Mikołaj Pich 2019-11-14 17:49:27 +01:00
parent 9f8c228263
commit 67165256bc
No known key found for this signature in database
GPG key ID: F62B26E36D4C4BAA
4 changed files with 50 additions and 88 deletions

View file

@ -1,6 +1,6 @@
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
id 'org.jetbrains.kotlin.jvm'
id 'jacoco'
id 'com.jfrog.bintray' version '1.8.4'
id 'com.github.dcendents.android-maven' version '2.1'
@ -15,49 +15,26 @@ ext {
group 'io.github.wulkanowy'
version PUBLISH_VERSION
sourceCompatibility = 1.6
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter()
}
configurations {
ktlint
}
ext {
jspoon = "1.3.2"
okhttp3 = "3.12.6"
retrofit = "2.6.2"
threetenbp = "1.4.0"
slf4j = "1.7.29"
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "pl.droidsonroids:jspoon:$jspoon"
implementation "pl.droidsonroids.retrofit2:converter-jspoon:$jspoon"
implementation "com.squareup.retrofit2:converter-gson:$retrofit"
implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttp3"
implementation "com.squareup.retrofit2:retrofit:$retrofit"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit"
implementation "com.squareup.retrofit2:converter-scalars:$retrofit"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3"
implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttp3"
implementation "com.squareup.retrofit2:converter-gson:$retrofit"
implementation "com.github.jonyas:RxJava2Reauth:master"
implementation "org.slf4j:slf4j-api:$slf4j"
testImplementation "org.slf4j:slf4j-simple:$slf4j"
compileOnly "org.threeten:threetenbp:$threetenbp:no-tzdb"
testImplementation "org.threeten:threetenbp:$threetenbp"
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp3"
testImplementation "junit:junit:4.12"
ktlint "com.pinterest:ktlint:0.35.0"
}
@ -79,13 +56,6 @@ task ktlintFormat(type: JavaExec, group: "formatting") {
args "-F", "src/**/*.kt"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.6"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.6"
}
jacocoTestReport {
reports {
xml.enabled true

View file

@ -1,18 +1,49 @@
allprojects {
repositories {
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
}
}
ext {
okhttp3 = "3.12.5"
retrofit = "2.6.2"
threetenbp = "1.4.0"
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.50' apply false
}
subprojects {
version = "0.12.0-SNAPSHOT"
group = "io.github.wulkanowy"
}
ext {
jspoon = "1.3.2"
okhttp3 = "3.12.6"
retrofit = "2.6.2"
threetenbp = "1.4.0"
slf4j = "1.7.29"
}
allprojects {
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions {
jvmTarget = "1.6"
javaParameters = true
}
}
repositories {
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "io.reactivex.rxjava2:rxjava:2.2.14"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3"
compileOnly "org.threeten:threetenbp:$threetenbp:no-tzdb"
testImplementation "org.threeten:threetenbp:$threetenbp"
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp3"
testImplementation "junit:junit:4.12"
}
}

View file

@ -1,20 +1,12 @@
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
id 'org.jetbrains.kotlin.jvm'
id 'jacoco'
}
sourceCompatibility = 1.8
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "io.github.wulkanowy:api:02e3190"
implementation "io.github.wulkanowy:uonet-request-signer:6d7aebf0e9"
compileOnly "org.threeten:threetenbp:$threetenbp:no-tzdb"
testImplementation "org.threeten:threetenbp:$threetenbp"
implementation 'com.google.code.gson:gson:2.8.6'
implementation "com.squareup.retrofit2:retrofit:$retrofit"
implementation "com.squareup.retrofit2:converter-gson:$retrofit"
@ -22,17 +14,6 @@ dependencies {
implementation "com.squareup.retrofit2:retrofit:$retrofit"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3"
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp3"
testImplementation "junit:junit:4.12"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
jacocoTestReport {

View file

@ -1,32 +1,12 @@
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
id 'org.jetbrains.kotlin.jvm'
id 'jacoco'
}
sourceCompatibility = 1.8
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation project(":api")
implementation project(":mobile")
implementation "io.github.wulkanowy:api:02e3190"
compileOnly "org.threeten:threetenbp:$threetenbp:no-tzdb"
testImplementation "org.threeten:threetenbp:$threetenbp"
implementation "io.reactivex.rxjava2:rxjava:2.2.14"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3"
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp3"
testImplementation "junit:junit:4.12"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
jacocoTestReport {