Skip to content

Commit 1cbdeeb

Browse files
feat!: bump to Gradle 9.5.1 and Jackson 3
1 parent b44f242 commit 1cbdeeb

9 files changed

Lines changed: 124 additions & 116 deletions

File tree

build.gradle

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22

33
plugins {
4-
id "com.github.mxenabled.coppuccino" version "7.+"
4+
id "com.github.mxenabled.coppuccino" version "7.0.2-SNAPSHOT"
55
id "groovy"
66
id "java-gradle-plugin"
77
id "maven-publish"
8-
id "org.jetbrains.kotlin.jvm" version "2.1.0"
8+
id "org.jetbrains.kotlin.jvm" version "2.3.0"
99
}
1010

11-
group "com.mx.vogue"
12-
version "4.0.1" // x-release-please-version
11+
group = "com.mx.vogue"
12+
version = "4.0.1" // x-release-please-version
1313

1414
java {
1515
toolchain {
@@ -41,11 +41,12 @@ repositories {
4141

4242
dependencies {
4343
implementation "com.google.code.gson:gson:[2.0,3.0)"
44-
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:[2.21.0,2.22.0)"
45-
implementation "com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.53.0"
44+
implementation "tools.jackson.dataformat:jackson-dataformat-yaml:[3.1.4,4.0.0)"
45+
implementation "com.github.ben-manes.versions:com.github.ben-manes.versions.gradle.plugin:0.54.0"
4646

4747
testImplementation "org.mockito:mockito-core:[5.0,6.0)"
48-
testImplementation "org.spockframework:spock-core:2.4-M6-groovy-3.0"
48+
testImplementation "org.spockframework:spock-core:2.4-groovy-4.0"
49+
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
4950
}
5051

5152
test { useJUnitPlatform() }
@@ -64,6 +65,6 @@ gradlePlugin {
6465
}
6566

6667
wrapper {
67-
gradleVersion = "8.14.3"
68+
gradleVersion = "9.5.1"
6869
distributionType = Wrapper.DistributionType.ALL
6970
}

gradle.lockfile

Lines changed: 77 additions & 67 deletions
Large diffs are not rendered by default.

gradle/wrapper/gradle-wrapper.jar

4.59 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-all.zip
44
networkTimeout=10000
5+
retries=0
6+
retryBackOffMs=500
57
validateDistributionUrl=true
68
zipStoreBase=GRADLE_USER_HOME
79
zipStorePath=wrapper/dists

gradlew

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 10 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pluginManagement {
33
gradlePluginPortal()
44
mavenCentral()
55
mavenLocal()
6-
maven { url "https://jitpack.io" }
6+
maven { url = "https://jitpack.io" }
77
}
88
}
99

src/main/kotlin/com/mx/vogue/core/ConfigUtils.kt

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
package com.mx.vogue.core
1717

1818
import com.fasterxml.jackson.annotation.JsonInclude
19-
import com.fasterxml.jackson.databind.ObjectMapper
20-
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
2119
import com.mx.vogue.core.models.Configuration
2220
import com.mx.vogue.core.models.PackageRule
2321
import com.mx.vogue.core.models.Rules
2422
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
23+
import tools.jackson.databind.DeserializationFeature
24+
import tools.jackson.dataformat.yaml.YAMLMapper
2525
import java.io.File
2626
import java.io.FileNotFoundException
2727

@@ -32,7 +32,9 @@ fun loadConfiguration(path: String): Configuration? {
3232
return null
3333
}
3434

35-
val mapper = ObjectMapper(YAMLFactory())
35+
val mapper: YAMLMapper = YAMLMapper.builder()
36+
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
37+
.build()
3638

3739
val contents = file.readText(Charsets.UTF_8)
3840
if (contents.isEmpty()) {
@@ -45,8 +47,12 @@ fun loadConfiguration(path: String): Configuration? {
4547
fun writeConfiguration(path: String, config: Configuration) {
4648
val file = File(path)
4749

48-
val mapper = ObjectMapper(YAMLFactory())
49-
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
50+
val mapper = YAMLMapper.builder()
51+
.changeDefaultPropertyInclusion { incl ->
52+
incl.withValueInclusion(JsonInclude.Include.NON_EMPTY)
53+
}
54+
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
55+
.build()
5056
file.writeBytes(mapper.writeValueAsBytes(config))
5157
}
5258

@@ -55,8 +61,12 @@ fun loadDefaultConfiguration(): Configuration {
5561
val stream = object {}.javaClass.classLoader.getResourceAsStream("default.vogue.yml")
5662
?: throw FileNotFoundException("Default configuration file could not be loaded")
5763

58-
val mapper = ObjectMapper(YAMLFactory())
59-
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
64+
val mapper = YAMLMapper.builder()
65+
.changeDefaultPropertyInclusion { incl ->
66+
incl.withValueInclusion(JsonInclude.Include.NON_EMPTY)
67+
}
68+
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
69+
.build()
6070
return mapper.readValue(stream.readBytes(), Configuration::class.java)
6171
}
6272

src/test/groovy/com/mx/vogue/core/ReportRendererTest.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ class ReportRendererTest extends Specification {
1111
given:
1212
def report = new Reporter(new Configuration().tap {
1313
defaultRules = new Rules(
14-
new Rule(1000, false),
15-
new Rule(0, false),
16-
new Rule(0, false),
17-
new Rule(0, false)
18-
)
14+
new Rule(1000, false),
15+
new Rule(0, false),
16+
new Rule(0, false),
17+
new Rule(0, false)
18+
)
1919
}).generate("src/test/resources/report.json")
2020

2121
when:

0 commit comments

Comments
 (0)