sdk/build.gradle

161 lines
4.1 KiB
Groovy
Raw Normal View History

2018-08-17 17:10:29 +02:00
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
2018-08-20 21:10:40 +02:00
id 'jacoco'
2018-12-16 18:10:29 +01:00
id 'com.jfrog.bintray' version '1.8.4'
id 'com.github.dcendents.android-maven' version '2.1'
}
ext {
2019-10-28 21:01:28 +01:00
PUBLISH_VERSION = '0.12.0'
2018-12-16 18:10:29 +01:00
SITE_URL = 'https://github.com/wulkanowy/api'
GIT_URL = 'https://github.com/wulkanowy/api.git'
2018-08-17 17:10:29 +02:00
}
group 'io.github.wulkanowy'
2018-12-16 18:10:29 +01:00
version PUBLISH_VERSION
2018-08-17 17:10:29 +02:00
2019-01-25 21:21:57 +01:00
sourceCompatibility = 1.6
2018-08-17 17:10:29 +02:00
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
2019-01-27 20:03:16 +01:00
jcenter()
}
configurations {
ktlint
2018-08-17 17:10:29 +02:00
}
2018-08-30 12:13:52 +02:00
ext {
jspoon = "1.3.2"
okhttp3 = "3.12.6"
retrofit = "2.6.2"
threetenbp = "1.4.0"
2019-09-09 16:03:27 +02:00
slf4j = "1.7.28"
2018-08-30 12:13:52 +02:00
}
2018-08-17 17:10:29 +02:00
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
2018-08-30 12:13:52 +02:00
implementation "pl.droidsonroids:jspoon:$jspoon"
implementation "pl.droidsonroids.retrofit2:converter-jspoon:$jspoon"
2018-08-31 21:41:53 +02:00
implementation "com.squareup.retrofit2:converter-gson:$retrofit"
2018-08-17 17:10:29 +02:00
2018-08-30 12:13:52 +02:00
implementation "com.squareup.retrofit2:retrofit:$retrofit"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit"
implementation "com.squareup.retrofit2:converter-scalars:$retrofit"
2018-08-30 12:13:52 +02:00
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3"
implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttp3"
2018-08-17 17:10:29 +02:00
2019-10-31 15:04:36 +01:00
implementation "com.github.jonyas:RxJava2Reauth:master"
2019-09-06 19:21:18 +02:00
implementation "org.slf4j:slf4j-api:$slf4j"
testImplementation "org.slf4j:slf4j-simple:$slf4j"
compileOnly "org.threeten:threetenbp:$threetenbp:no-tzdb"
testImplementation "org.threeten:threetenbp:$threetenbp"
2018-09-30 11:55:30 +02:00
2018-08-30 12:13:52 +02:00
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp3"
2018-08-31 21:41:53 +02:00
testImplementation "junit:junit:4.12"
ktlint "com.pinterest:ktlint:0.35.0"
2019-01-27 20:03:16 +01:00
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
2019-01-27 20:03:16 +01:00
args "src/**/*.kt"
// to generate report in checkstyle format prepend following args:
// "--reporter=plain", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
// see https://github.com/pinterest/ktlint#usage for more
2019-01-27 20:03:16 +01:00
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
2019-01-27 20:03:16 +01:00
args "-F", "src/**/*.kt"
2018-08-17 17:10:29 +02:00
}
compileKotlin {
2019-01-25 21:21:57 +01:00
kotlinOptions.jvmTarget = "1.6"
2018-08-17 17:10:29 +02:00
}
compileTestKotlin {
2019-01-25 21:21:57 +01:00
kotlinOptions.jvmTarget = "1.6"
2018-08-17 17:10:29 +02:00
}
2018-08-20 21:15:53 +02:00
jacocoTestReport {
reports {
xml.enabled true
}
}
2018-08-25 19:10:16 +02:00
2018-12-16 18:10:29 +01:00
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
pkg {
repo = 'wulkanowy'
name = 'api'
userOrg = 'wulkanowy'
licenses = ['Apache-2.0']
vcsUrl = GIT_URL
labels = ['aar', 'wulkanowy', 'api']
publicDownloadNumbers = true
publish = true
version {
name = PUBLISH_VERSION
vcsTag = PUBLISH_VERSION
released = new Date()
}
}
}
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
2019-05-29 18:00:00 +02:00
name 'Scraping API for VULCAN UONET+'
2018-12-16 18:10:29 +01:00
url SITE_URL
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'mklkj'
name 'Mikołaj Pich'
email 'm.pich@outlook.com'
}
}
scm {
connection GIT_URL
developerConnection GIT_URL
url SITE_URL
}
}
}
}
}
2018-08-25 19:10:16 +02:00
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}