All Downloads are FREE. Search and download functionalities are using the official Maven repository.

stioner.plugin.2024.9.3.source-code.ShowUpdatedSeeds.kt Maven / Gradle / Ivy

There is a newer version: 2024.11.0
Show newest version
@file:Suppress("InvalidPackageDeclaration")

package edu.illinois.cs.cs125.questioner.plugin

import edu.illinois.cs.cs125.questioner.lib.loadQuestionList
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction
import java.io.File

open class ShowUpdatedSeeds : DefaultTask() {
    init {
        group = "Verification"
        description = "Show questions with updated seeds."
    }

    @InputFile
    val inputFile: File = project.layout.buildDirectory.dir("questioner/questions.json").get().asFile

    @Internal
    lateinit var ignorePackages: List

    @TaskAction
    fun print() {
        inputFile.loadQuestionList()
            .filter { !ignorePackages.any { prefix -> it.published.packageName.startsWith(prefix) } }
            .filter { it.validated }
            .filter { it.testingSettings!!.seed != it.control.seed }
            .forEach {
                val fullPath = project.rootProject.projectDir.resolve(it.correctPath!!)
                project.logger.warn("${it.published.path}: update seed to ${it.testingSettings!!.seed} (file://$fullPath)")
            }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy