Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Fix Kotlin module import.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchallen committed Oct 3, 2021
1 parent a58e450 commit 9129bbb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.github.cs125-illinois"
version = "2021.10.2"
version = "2021.10.3"

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.5.31")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package edu.illinois.cs.cs125.gradlegrader.plugin

import org.gradle.api.GradleException
import java.lang.RuntimeException
import kotlin.system.exitProcess

/**
* Manages the exit of the task/process according to configuration.
Expand Down Expand Up @@ -32,7 +33,7 @@ class ExitManager(private val policy: GradePolicyExtension) {
if (!policy.keepDaemon || forceExit) {
System.out.flush()
System.err.flush()
System.exit(0)
exitProcess(0)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ package edu.illinois.cs.cs125.gradlegrader.plugin

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.module.kotlin.KotlinFeature
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.fasterxml.jackson.module.kotlin.readValue
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import com.google.gson.Gson
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
Expand Down Expand Up @@ -209,18 +208,7 @@ class GradleGraderPlugin : Plugin<Project> {
}
gradeTask.dependsOn(reconfTask)
if (config.checkpointing.yamlFile != null) {
val configLoader = ObjectMapper(YAMLFactory()).also {
it.registerModule(
KotlinModule.Builder()
.withReflectionCacheSize(512)
.configure(KotlinFeature.NullToEmptyCollection, false)
.configure(KotlinFeature.NullToEmptyMap, false)
.configure(KotlinFeature.NullIsSameAsDefault, false)
.configure(KotlinFeature.SingletonSupport, false)
.configure(KotlinFeature.StrictNullChecks, false)
.build()
)
}
val configLoader = ObjectMapper(YAMLFactory()).also { it.registerKotlinModule() }
val checkpointConfig = configLoader.readValue<CheckpointConfig>(config.checkpointing.yamlFile!!)
currentCheckpoint = checkpointConfig.checkpoint
gradeTask.currentCheckpoint = currentCheckpoint
Expand Down

0 comments on commit 9129bbb

Please sign in to comment.