Skip to content

Commit

Permalink
chore: Upgrade versions #20
Browse files Browse the repository at this point in the history
- Gradle Wrapper
- Kotlin version
- Kotlin Quality plugin
- Dependencies
  • Loading branch information
leomillon committed Aug 18, 2020
1 parent eb46f5c commit 9427664
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 75 deletions.
16 changes: 8 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask

plugins {
base
kotlin("jvm") version "1.3.70" apply false
kotlin("jvm") version "1.4.0" apply false
id("com.ekino.oss.plugin.kotlin-quality") version "2.0.0" apply false
id("net.researchgate.release") version "2.8.1"
id("se.bjurr.gitchangelog.git-changelog-gradle-plugin") version "1.64"
id("org.jetbrains.dokka") version "1.4.0-rc"
}

allprojects {
Expand All @@ -17,15 +19,13 @@ allprojects {
}

registerProperties(
"kotlin.version" to "1.3.70",
"lombok.version" to "1.18.12",
"jackson.version" to "2.10.1",
"commons-io.version" to "2.6",
"kotlin.version" to "1.4.0",
"commons-io.version" to "2.7",
"jsonassert.version" to "1.5.0",
"assertj.version" to "3.15.0",
"assertj.version" to "3.16.1",
"hamcrest.version" to "2.2",
"junit-jupiter.version" to "5.6.0",
"assertk-jvm.version" to "0.21"
"junit-jupiter.version" to "5.6.2",
"assertk-jvm.version" to "0.22"
)
}

Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ version = 1.5.0-SNAPSHOT

kotlin.code.style=official

# See https://github.com/gradle/gradle/issues/11308
systemProp.org.gradle.internal.publish.checksums.insecure=true
org.gradle.jvmargs=-Xmx1g
31 changes: 16 additions & 15 deletions jcv-assertj/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
`java-library`
signing
jacoco
id("org.jmailen.kotlinter") version "2.3.0"
id("org.jetbrains.dokka") version "0.10.1"
id("com.ekino.oss.plugin.kotlin-quality")
id("org.jetbrains.dokka")
}

configurations {
Expand All @@ -16,13 +14,12 @@ configurations {
}
}

val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
java {
withSourcesJar()
}

val javadocJar by tasks.registering(Jar::class) {
dependsOn("dokka")
dependsOn("dokkaHtml")
archiveClassifier.set("javadoc")
from(buildDir.resolve("dokka"))
}
Expand All @@ -39,15 +36,17 @@ tasks {
jvmArgs("-Duser.language=en")
}

withType<DokkaTask> {
configuration {
reportUndocumented = false
dokkaHtml {
dokkaSourceSets {
configureEach {
reportUndocumented = false
jdkVersion = 8
}
}
}

artifacts {
archives(jar)
archives(sourcesJar)
archives(javadocJar)
}
}
Expand All @@ -57,9 +56,7 @@ val publicationName = "mavenJava"
publishing {
publications {
named<MavenPublication>(publicationName) {
artifact(sourcesJar.get())
artifact(javadocJar.get())

from(components["java"])
}
}
Expand All @@ -77,7 +74,11 @@ dependencies {
implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
implementation(group = "org.assertj", name = "assertj-core", version = "${prop("assertj.version")}")

testImplementation(group = "org.junit.jupiter", name = "junit-jupiter", version = "${prop("junit-jupiter.version")}")
testImplementation(
group = "org.junit.jupiter",
name = "junit-jupiter",
version = "${prop("junit-jupiter.version")}"
)

testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
testImplementation(group = "org.assertj", name = "assertj-core", version = "${prop("assertj.version")}")
Expand Down
37 changes: 21 additions & 16 deletions jcv-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
`java-library`
signing
jacoco
id("org.jmailen.kotlinter") version "2.3.0"
id("org.jetbrains.dokka") version "0.10.1"
id("com.ekino.oss.plugin.kotlin-quality")
id("org.jetbrains.dokka")
}

configurations {
Expand All @@ -16,13 +14,12 @@ configurations {
}
}

val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
java {
withSourcesJar()
}

val javadocJar by tasks.registering(Jar::class) {
dependsOn("dokka")
dependsOn("dokkaHtml")
archiveClassifier.set("javadoc")
from(buildDir.resolve("dokka"))
}
Expand All @@ -39,15 +36,17 @@ tasks {
jvmArgs("-Duser.language=en")
}

withType<DokkaTask> {
configuration {
reportUndocumented = false
dokkaHtml {
dokkaSourceSets {
configureEach {
reportUndocumented = false
jdkVersion = 8
}
}
}

artifacts {
archives(jar)
archives(sourcesJar)
archives(javadocJar)
}
}
Expand All @@ -57,9 +56,7 @@ val publicationName = "mavenJava"
publishing {
publications {
named<MavenPublication>(publicationName) {
artifact(sourcesJar.get())
artifact(javadocJar.get())

from(components["java"])
}
}
Expand All @@ -74,10 +71,18 @@ dependencies {
implementation(kotlin("reflect", version = "${prop("kotlin.version")}"))
implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")

testImplementation(group = "org.junit.jupiter", name = "junit-jupiter", version = "${prop("junit-jupiter.version")}")
testImplementation(
group = "org.junit.jupiter",
name = "junit-jupiter",
version = "${prop("junit-jupiter.version")}"
)

testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
testImplementation(group = "com.willowtreeapps.assertk", name = "assertk-jvm", version = "${prop("assertk-jvm.version")}") {
testImplementation(
group = "com.willowtreeapps.assertk",
name = "assertk-jvm",
version = "${prop("assertk-jvm.version")}"
) {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class JsonComparator(mode: JSONCompareMode, validators: List<JsonValidator<out A

validators
.firstOrNull { it.contextMatcher.matches(prefix, expectedValue, actualValue) }
?.let { asCustomization(it) }
?.let(::asCustomization)
?.let {
try {
if (!it.matches(prefix, actualValue, expectedValue, result)) {
Expand Down Expand Up @@ -111,7 +111,8 @@ class JsonComparator(mode: JSONCompareMode, validators: List<JsonValidator<out A
getExpectedElementCollectionMap(parsedExpectedElements, key, actualElements, actualValueMatchedIndexes)

val totalMatched =
matchingByValue.values.asSequence().filterNotNull().count() + matchingByValidator.values.asSequence().flatten().distinct().count()
matchingByValue.values.asSequence().filterNotNull().count() + matchingByValidator.values.asSequence()
.flatten().distinct().count()

if (totalMatched == actualElements.size) {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,24 @@ class JsonComparatorTest {
compare(
loadJson("test_validator_id_in_value_matcher_actual_invalid.json"),
loadJson("test_validator_id_in_value_matcher_expected.json"),
comparator(validator {
templatedValidator<String>("someSpecificValue", comparator { actual, _ ->
val specificValue = "THE_VALUE"
if (specificValue == actual) {
return@comparator true
}
throw ValueMatcherException(
"Value should be '$specificValue'",
specificValue,
Objects.toString(actual)
comparator(
validator {
templatedValidator<String>(
"someSpecificValue",
comparator { actual, _ ->
val specificValue = "THE_VALUE"
if (specificValue == actual) {
return@comparator true
}
throw ValueMatcherException(
"Value should be '$specificValue'",
specificValue,
Objects.toString(actual)
)
}
)
})
})
}
)
) {
assertAll {
assertThat(it.passed()).isFalse()
Expand Down Expand Up @@ -260,7 +265,7 @@ class JsonComparatorTest {
Expected: {#not_empty#}
got:
""".trimIndent()
""".trimIndent()
)
.row(
// language=json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import org.junit.jupiter.api.Test
class ValidatorTemplateManagerTest {

companion object {
private const val TEXT_VALIDATOR_VALUE = "{#my_validator:some \\; param 1;and another one \\\\; ...;and the last one#}"
private const val TEXT_VALIDATOR_VALUE =
"{#my_validator:some \\; param 1;and another one \\\\; ...;and the last one#}"
private val defaultTemplateManager = ValidatorTemplateManager(TEXT_VALIDATOR_VALUE)
}

Expand All @@ -36,9 +37,9 @@ class ValidatorTemplateManagerTest {
fun `parameters extraction`() {

assertThat(defaultTemplateManager.extractParameters()).containsExactly(
"some ; param 1",
"and another one \\; ...",
"and the last one"
"some ; param 1",
"and another one \\; ...",
"and the last one"
)
}

Expand Down
31 changes: 16 additions & 15 deletions jcv-hamcrest/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
`java-library`
signing
jacoco
id("org.jmailen.kotlinter") version "2.3.0"
id("org.jetbrains.dokka") version "0.10.1"
id("com.ekino.oss.plugin.kotlin-quality")
id("org.jetbrains.dokka")
}

configurations {
Expand All @@ -16,13 +14,12 @@ configurations {
}
}

val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
java {
withSourcesJar()
}

val javadocJar by tasks.registering(Jar::class) {
dependsOn("dokka")
dependsOn("dokkaHtml")
archiveClassifier.set("javadoc")
from(buildDir.resolve("dokka"))
}
Expand All @@ -39,15 +36,17 @@ tasks {
jvmArgs("-Duser.language=en")
}

withType<DokkaTask> {
configuration {
reportUndocumented = false
dokkaHtml {
dokkaSourceSets {
configureEach {
reportUndocumented = false
jdkVersion = 8
}
}
}

artifacts {
archives(jar)
archives(sourcesJar)
archives(javadocJar)
}
}
Expand All @@ -57,9 +56,7 @@ val publicationName = "mavenJava"
publishing {
publications {
named<MavenPublication>(publicationName) {
artifact(sourcesJar.get())
artifact(javadocJar.get())

from(components["java"])
}
}
Expand All @@ -75,7 +72,11 @@ dependencies {
implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
implementation(group = "org.hamcrest", name = "hamcrest", version = "${prop("hamcrest.version")}")

testImplementation(group = "org.junit.jupiter", name = "junit-jupiter", version = "${prop("junit-jupiter.version")}")
testImplementation(
group = "org.junit.jupiter",
name = "junit-jupiter",
version = "${prop("junit-jupiter.version")}"
)

testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
testImplementation(group = "org.hamcrest", name = "hamcrest", version = "${prop("hamcrest.version")}")
Expand Down

0 comments on commit 9427664

Please sign in to comment.