sdk/build.gradle

155 lines
3.9 KiB
Groovy
Raw Normal View History

2018-08-17 17:10:29 +02:00
plugins {
id 'java'
2019-01-25 21:21:57 +01:00
id 'org.jetbrains.kotlin.jvm' version '1.3.20'
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-01-25 21:25:22 +01:00
PUBLISH_VERSION = '0.6.6'
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.1"
retrofit = "2.5.0"
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
implementation "com.github.jonyas:RxJava2Reauth:72abb94"
implementation "org.threeten:threetenbp:1.3.8"
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"
Bump ktlint from 0.30.0 to 0.31.0 (#13) Bumps [ktlint](https://github.com/shyiko/ktlint) from 0.30.0 to 0.31.0. <details> <summary>Release notes</summary> *Sourced from [ktlint's releases](https://github.com/shyiko/ktlint/releases).* > ## 0.31.0 > ### Added > - `dot-spacing` rule ([#293](https://github-redirect.dependabot.com/shyiko/ktlint/issues/293)). > - `experimental/indent` rule ([#338](https://github-redirect.dependabot.com/shyiko/ktlint/issues/338)). > Use `ktlint --experimental` to enable. > > ### Fixed > - Spacing check around `<` & `>` operators. > > ### Changed > - `no-multi-spaces` rule (horizontal alignment of comments is no longer allowed) ([#269](https://github-redirect.dependabot.com/shyiko/ktlint/issues/269)). > - `colon-spacing` rule (`:` must not appear at the beginning of the line). > - `package-name` rule (disabled until [#208](https://github-redirect.dependabot.com/shyiko/ktlint/issues/208) is resolved). > - `--print-ast` to output [com.github.shyiko.ktlint.core.ast.ElementType.*](https://github.com/shyiko/ktlint/blob/master/ktlint-core/src/main/kotlin/com/github/shyiko/ktlint/core/ast/ElementType.kt) as `node.elementType`, e.g. > ``` > $ echo 'fun f() {}' | ./ktlint/target/ktlint --print-ast --color --stdin > 1: ~.psi.KtFile (FILE) > 1: ~.psi.KtPackageDirective (PACKAGE_DIRECTIVE) "" > 1: ~.psi.KtImportList (IMPORT_LIST) "" > 1: ~.psi.KtScript (SCRIPT) > 1: ~.psi.KtBlockExpression (BLOCK) > 1: ~.psi.KtNamedFunction (FUN) > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (FUN_KEYWORD) "fun" > 1: ~.c.i.p.impl.source.tree.PsiWhiteSpaceImpl (WHITE_SPACE) " " > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (IDENTIFIER) "f" > 1: ~.psi.KtParameterList (VALUE_PARAMETER_LIST) > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (LPAR) "(" > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (RPAR) ")" > 1: ~.c.i.p.impl.source.tree.PsiWhiteSpaceImpl (WHITE_SPACE) " " > 1: ~.psi.KtBlockExpression (BLOCK) > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (LBRACE) "{" > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (RBRACE) "}" > 1: ~.c.i.p.impl.source.tree.PsiWhiteSpaceImpl (WHITE_SPACE) "\n" > > format: <line_number:> <node.psi::class> (<node.elementType>) "<node.text>" > legend: ~ = org.jetbrains.kotlin, c.i.p = com.intellij.psi > ``` > > - `kotlin-compiler` version to 1.3.21 (from 1.3.20). > > ### Removed > - Dependency on JCenter ([#349](https://github-redirect.dependabot.com/shyiko/ktlint/issues/349)). </details> <details> <summary>Changelog</summary> *Sourced from [ktlint's changelog](https://github.com/shyiko/ktlint/blob/master/CHANGELOG.md).* > ## [0.31.0] - 2019-03-10 > > ### Added > - `dot-spacing` rule ([#293](https://github-redirect.dependabot.com/shyiko/ktlint/issues/293)). > - `experimental/indent` rule ([#338](https://github-redirect.dependabot.com/shyiko/ktlint/issues/338)). > Use `ktlint --experimental` to enable. > > ### Fixed > - Spacing check around `<` & `>` operators. > > ### Changed > - `no-multi-spaces` rule (horizontal alignment of comments is no longer allowed) ([#269](https://github-redirect.dependabot.com/shyiko/ktlint/issues/269)). > - `colon-spacing` rule (`:` must not appear at the beginning of the line). > - `package-name` rule (disabled until [#208](https://github-redirect.dependabot.com/shyiko/ktlint/issues/208) is resolved). > - `--print-ast` to output [com.github.shyiko.ktlint.core.ast.ElementType.*](https://github.com/shyiko/ktlint/blob/master/ktlint-core/src/main/kotlin/com/github/shyiko/ktlint/core/ast/ElementType.kt) as `node.elementType`, e.g. > ``` > $ echo 'fun f() {}' | ./ktlint/target/ktlint --print-ast --color --stdin > 1: ~.psi.KtFile (FILE) > 1: ~.psi.KtPackageDirective (PACKAGE_DIRECTIVE) "" > 1: ~.psi.KtImportList (IMPORT_LIST) "" > 1: ~.psi.KtScript (SCRIPT) > 1: ~.psi.KtBlockExpression (BLOCK) > 1: ~.psi.KtNamedFunction (FUN) > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (FUN_KEYWORD) "fun" > 1: ~.c.i.p.impl.source.tree.PsiWhiteSpaceImpl (WHITE_SPACE) " " > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (IDENTIFIER) "f" > 1: ~.psi.KtParameterList (VALUE_PARAMETER_LIST) > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (LPAR) "(" > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (RPAR) ")" > 1: ~.c.i.p.impl.source.tree.PsiWhiteSpaceImpl (WHITE_SPACE) " " > 1: ~.psi.KtBlockExpression (BLOCK) > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (LBRACE) "{" > 1: ~.c.i.p.impl.source.tree.LeafPsiElement (RBRACE) "}" > 1: ~.c.i.p.impl.source.tree.PsiWhiteSpaceImpl (WHITE_SPACE) "\n" > > format: <line_number:> <node.psi::class> (<node.elementType>) "<node.text>" > legend: ~ = org.jetbrains.kotlin, c.i.p = com.intellij.psi > ``` > > - `kotlin-compiler` version to 1.3.21 (from 1.3.20). > > ### Removed > - Dependency on JCenter ([#349](https://github-redirect.dependabot.com/shyiko/ktlint/issues/349)). </details> <details> <summary>Commits</summary> - [`fb31f9f`](https://github.com/shyiko/ktlint/commit/fb31f9f4971b359885d9d4b2acabcbf7a44116c3) Updated refs to latest (0.31.0) release - [`e8cdf60`](https://github.com/shyiko/ktlint/commit/e8cdf60a7b3ad8c84f5e78fa8781fa959899329d) Bumped ktlint to 0.31.0 (ktlint-ruleset-template) - [`abc2880`](https://github.com/shyiko/ktlint/commit/abc28806373af4a9e374023b50ca9bbc8c6af387) Added 0.31.0 release notes - [`a606d80`](https://github.com/shyiko/ktlint/commit/a606d8037706f0ef5f7305b8c412c53e4050f08f) Removed isPartOfRawMultiLineString from core.ast - [`fcc2ff7`](https://github.com/shyiko/ktlint/commit/fcc2ff7aff9cd51dea09b9aea7098bf62016e475) Forced open quotes (of multi-line raw string) to be a separate line - [`cdf93a9`](https://github.com/shyiko/ktlint/commit/cdf93a99438103e5e1aa1a5450a36d3554ee5a33) Fixed indentation of EQ COMMENT LF BLOCK - [`8def3c8`](https://github.com/shyiko/ktlint/commit/8def3c8531caa20b4fc2847a9075fcd5b05b1177) Fixed : indentation when put on a separate line - [`fe2f5ee`](https://github.com/shyiko/ktlint/commit/fe2f5eec6021fdcc15f305af1020962299ede1e2) Changed colon-spacing rule to remove newline between colon and prev element - [`8e4d16e`](https://github.com/shyiko/ktlint/commit/8e4d16eca71818473a95cdb3e3337af4e23dd67b) Fixed spacing check around <,> op - [`b91ae6c`](https://github.com/shyiko/ktlint/commit/b91ae6c4a3534e5261a89b0eedb45db028155d75) Enabled --experimental ruleset as part of Maven verify phase - Additional commits viewable in [compare view](https://github.com/shyiko/ktlint/compare/0.30.0...0.31.0) </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=com.github.shyiko:ktlint&package-manager=gradle&previous-version=0.30.0&new-version=0.31.0)](https://dependabot.com/compatibility-score.html?dependency-name=com.github.shyiko:ktlint&package-manager=gradle&previous-version=0.30.0&new-version=0.31.0) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot. </details>
2019-03-12 18:06:04 +01:00
ktlint "com.github.shyiko:ktlint:0.31.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.github.shyiko.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/shyiko/ktlint#usage for more
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
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'
name 'Bintray publish Gradle aar'
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
}