com.github.mictaege.arete_gradle.AretePlugin.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of arete-gradle Show documentation
Show all versions of arete-gradle Show documentation
Gradle reporting plugin for the Arete JUnit5 testing framework.
The newest version!
package com.github.mictaege.arete_gradle
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.testing.Test
import java.util.*
class AretePlugin: Plugin{
companion object {
const val BUILD_DIR_PROPERTY = "com.github.mictaege.arete_gradle.buildDir"
const val TASK_NAME_PROPERTY = "com.github.mictaege.arete_gradle.taskName"
}
override fun apply(project: Project) {
val props = Properties()
props.load(javaClass.classLoader.getResourceAsStream("arete-gradle.properties"))
val version = props.getProperty("version")
project.dependencies.add("testRuntimeOnly", "com.github.mictaege:arete-gradle:${version}")
project.tasks.withType(Test::class.java) { testTask ->
testTask.doFirst {
testTask.systemProperties[BUILD_DIR_PROPERTY] = project.buildDir.absolutePath
testTask.systemProperties[TASK_NAME_PROPERTY] = testTask.name
}
}
}
}