sdk/build.gradle
2019-07-23 11:30:01 +00:00

156 lines
4 KiB
Groovy

plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.41'
id 'jacoco'
id 'com.jfrog.bintray' version '1.8.4'
id 'com.github.dcendents.android-maven' version '2.1'
}
ext {
PUBLISH_VERSION = '0.9.3'
SITE_URL = 'https://github.com/wulkanowy/api'
GIT_URL = 'https://github.com/wulkanowy/api.git'
}
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.3"
retrofit = "2.6.0"
threetenbp = "1.4.0"
}
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.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.github.jonyas:RxJava2Reauth:72abb94"
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.34.2"
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
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
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "-F", "src/**/*.kt"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.6"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.6"
}
jacocoTestReport {
reports {
xml.enabled true
}
}
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'
name 'Scraping API for VULCAN UONET+'
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
}
}
}
}
}
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
}