Skip to content

Commit

Permalink
gradle: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
uchuhimo committed Nov 9, 2019
1 parent 66634e8 commit 4a145f0
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java_version: [8, 9, 10, 11, 12]
java_version: [8, 9, 10, 11, 12, 13]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
77 changes: 37 additions & 40 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.jfrog.bintray.gradle.BintrayExtension
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.LinkMapping
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL
import java.util.Properties
Expand All @@ -12,19 +10,22 @@ val bintrayKeyProperty by extra { getPrivateProperty("bintrayKey") }
val ossUserToken by extra { getPrivateProperty("ossUserToken") }
val ossUserPassword by extra { getPrivateProperty("ossUserPassword") }
val gpgPassphrase by extra { getPrivateProperty("gpgPassphrase") }
val useAliyun by extra { shouldUseAliyun() }

val wrapper by tasks.existing(Wrapper::class)
wrapper {
gradleVersion = "5.6.2"
gradleVersion = "6.0"
distributionType = Wrapper.DistributionType.ALL
}

buildscript {
repositories {
if (useAliyun) {
if (shouldUseAliyun()) {
aliyunJCenter()
aliyunMaven()
} else {
jcenter()
}
jcenter()
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
}
dependencies {
Expand All @@ -33,7 +34,6 @@ buildscript {
}

plugins {
`build-scan`
java
jacoco
`maven-publish`
Expand Down Expand Up @@ -66,9 +66,29 @@ allprojects {

repositories {
if (useAliyun) {
aliyunJCenter()
aliyunMaven()
} else {
jcenter()
}
}

val dependencyUpdates by tasks.existing(DependencyUpdatesTask::class)
dependencyUpdates {
revision = "release"
outputFormatter = "plain"
resolutionStrategy {
componentSelection {
all {
val rejected = listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea", "eap", "pr")
.map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-+]*") }
.any { it.matches(candidate.version) }
if (rejected) {
reject("Release candidate")
}
}
}
}
jcenter()
}
}

Expand Down Expand Up @@ -229,17 +249,17 @@ subprojects {
}

val dokka by tasks.existing(DokkaTask::class) {
outputFormat = "javadoc"
outputFormat = "html"
outputDirectory = tasks.javadoc.get().destinationDir!!.path
jdkVersion = 8
linkMapping(delegateClosureOf<LinkMapping> {
dir = project.rootDir.toPath().resolve("src/main/kotlin").toFile().path.replace('\\', '/')
url = "https://github.com/uchuhimo/konf/blob/v${project.version}/src/main/kotlin"
suffix = "#L"
})
externalDocumentationLink(delegateClosureOf<DokkaConfiguration.ExternalDocumentationLink.Builder> {
url = URL("http://fasterxml.github.io/jackson-databind/javadoc/${Versions.jacksonMinor}/")
})
configuration {
jdkVersion = 8
reportUndocumented = false
sourceLink {
path = "./"
url = "https://github.com/uchuhimo/konf/blob/v${project.version}/"
lineSuffix = "#L"
}
}
}

val sourcesJar by tasks.registering(Jar::class) {
Expand Down Expand Up @@ -343,27 +363,4 @@ subprojects {
bintrayUpload { dependsOn(check, install) }
}
}

val dependencyUpdates by tasks.existing(DependencyUpdatesTask::class)
dependencyUpdates {
revision = "release"
outputFormatter = "plain"
resolutionStrategy {
componentSelection {
all {
val rejected = listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea", "eap", "pr")
.map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-+]*") }
.any { it.matches(candidate.version) }
if (rejected) {
reject("Release candidate")
}
}
}
}
}
}

buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
24 changes: 12 additions & 12 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ object Versions {
const val jackson = "$jacksonMinor.0"
const val bintrayPlugin = "1.8.4"
const val taskTree = "1.4"
const val jmh = "1.21"
const val jmhPlugin = "0.4.8"
const val jmh = "1.22"
const val jmhPlugin = "0.5.0"
const val spotless = "3.25.0"
const val dependencyManagement = "1.0.8.RELEASE"
const val dependencyUpdate = "0.25.0"
// don't upgrade to 0.9.18 (issue: https://github.com/Kotlin/dokka/issues/464)
// wait for 0.9.20 if using JDK11 (issue: https://github.com/Kotlin/dokka/issues/428)
const val dokka = "0.9.17"
const val dependencyUpdate = "0.27.0"
// wait for bugfix if using JDK11 (issue: https://github.com/Kotlin/dokka/issues/428)
const val dokka = "0.10.0"
const val reflections = "0.9.11"
const val commonsText = "1.8"
const val hocon = "1.3.4"
const val hocon = "1.4.0"
const val yaml = "1.25"
const val toml4j = "0.7.2"
const val graal = "19.2.0.1"
// don't upgrade to 2.1.1
const val dom4j = "2.1.0"
const val dom4j = "2.1.1"
const val jaxen = "1.2.0"
const val coroutines = "1.3.2"
const val jgit = "5.5.0.201909110433-r"
const val jgit = "5.5.1.201910021850-r"
const val hamkrest = "1.7.0.0"
const val hamcrest = "1.3"
const val spark = "2.9.1"
const val slf4j = "1.7.28"
const val slf4j = "1.7.29"
const val jacoco = "0.8.5"

const val googleJavaFormat = "1.7"
const val ktlint = "0.34.2"
const val jacoco = "0.8.4"
}


fun String?.withColon() = this?.let { ":$this" } ?: ""

fun kotlin(module: String, version: String? = null) =
Expand Down
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fun Project.getPrivateProperty(key: String): String {
}
}

val Project.useAliyun: Boolean get() = if (file("private.properties").exists()) {
fun Project.shouldUseAliyun(): Boolean = if (file("private.properties").exists()) {
val properties = Properties()
properties.load(file("private.properties").inputStream())
properties.getProperty("useAliyun")?.toBoolean() ?: false
Expand All @@ -24,6 +24,8 @@ val Project.useAliyun: Boolean get() = if (file("private.properties").exists())

fun RepositoryHandler.aliyunMaven() = maven(url = "https://maven.aliyun.com/repository/central")

fun RepositoryHandler.aliyunJCenter() = maven(url = "https://maven.aliyun.com/repository/jcenter")

fun RepositoryHandler.aliyunGradlePluginPortal() = maven(url = "https://maven.aliyun.com/repository/gradle-plugin")

fun Element.appendNode(key: String, action: Element.() -> Unit): Element {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions konf-all/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencyManagement {
dependency("org.yaml:snakeyaml:${Versions.yaml}")
dependency("com.moandjiezana.toml:toml4j:${Versions.toml4j}")
dependency("org.dom4j:dom4j:${Versions.dom4j}")
dependency("jaxen:jaxen:${Versions.jaxen}")
dependency("org.eclipse.jgit:org.eclipse.jgit:${Versions.jgit}")
}
}
Expand Down
2 changes: 2 additions & 0 deletions konf-xml/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
dependencyManagement {
dependencies {
dependency("org.dom4j:dom4j:${Versions.dom4j}")
dependency("jaxen:jaxen:${Versions.jaxen}")
}
}

dependencies {
implementation(project(":konf-core"))
implementation("org.dom4j:dom4j")
implementation("jaxen:jaxen")

val test by project(":konf-core").dependencyProject.sourceSets
testImplementation(test.output)
Expand Down
13 changes: 12 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ include(
"konf-xml",
"konf-yaml",
"konf-all"
)
)

plugins {
id("com.gradle.enterprise") version "3.0"
}

gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}

0 comments on commit 4a145f0

Please sign in to comment.