Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id "com.github.mxenabled.coppuccino" version "7.+"
id "com.github.mxenabled.coppuccino" version "8.+"
id "groovy"
id "java-gradle-plugin"
id "maven-publish"
id "org.jetbrains.kotlin.jvm" version "2.1.0"
id "org.jetbrains.kotlin.jvm" version "2.3.0"
}

group "com.mx.vogue"
Expand Down Expand Up @@ -41,11 +41,12 @@ repositories {

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

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

test { useJUnitPlatform() }
Expand All @@ -64,6 +65,6 @@ gradlePlugin {
}

wrapper {
gradleVersion = "8.14.3"
gradleVersion = "9.5.1"
distributionType = Wrapper.DistributionType.ALL
}
144 changes: 77 additions & 67 deletions gradle.lockfile

Large diffs are not rendered by default.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-all.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 2 additions & 5 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 10 additions & 22 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 17 additions & 7 deletions src/main/kotlin/com/mx/vogue/core/ConfigUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
package com.mx.vogue.core

import com.fasterxml.jackson.annotation.JsonInclude
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.mx.vogue.core.models.Configuration
import com.mx.vogue.core.models.PackageRule
import com.mx.vogue.core.models.Rules
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
import tools.jackson.databind.DeserializationFeature
import tools.jackson.dataformat.yaml.YAMLMapper
import java.io.File
import java.io.FileNotFoundException

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

val mapper = ObjectMapper(YAMLFactory())
val mapper: YAMLMapper = YAMLMapper.builder()
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
.build()

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

val mapper = ObjectMapper(YAMLFactory())
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
val mapper = YAMLMapper.builder()
.changeDefaultPropertyInclusion { incl ->
incl.withValueInclusion(JsonInclude.Include.NON_EMPTY)
}
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
.build()
file.writeBytes(mapper.writeValueAsBytes(config))
}

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

val mapper = ObjectMapper(YAMLFactory())
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
val mapper = YAMLMapper.builder()
.changeDefaultPropertyInclusion { incl ->
incl.withValueInclusion(JsonInclude.Include.NON_EMPTY)
}
.disable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)
.build()
return mapper.readValue(stream.readBytes(), Configuration::class.java)
}

Expand Down
10 changes: 5 additions & 5 deletions src/test/groovy/com/mx/vogue/core/ReportRendererTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class ReportRendererTest extends Specification {
given:
def report = new Reporter(new Configuration().tap {
defaultRules = new Rules(
new Rule(1000, false),
new Rule(0, false),
new Rule(0, false),
new Rule(0, false)
)
new Rule(1000, false),
new Rule(0, false),
new Rule(0, false),
new Rule(0, false)
)
}).generate("src/test/resources/report.json")

when:
Expand Down
Loading