plugins { `java-gradle-plugin` `maven-publish` } repositories { // the Gradle PIT plugin is published on the Gradle Plugin Portal only gradlePluginPortal() } val pitestGradlePluginVersion = "1.19.0" dependencies { implementation(project(":werkcrappit-pit")) compileOnly("info.solidsoft.gradle.pitest:gradle-pitest-plugin:$pitestGradlePluginVersion") testImplementation("info.solidsoft.gradle.pitest:gradle-pitest-plugin:$pitestGradlePluginVersion") } gradlePlugin { plugins { create("werkcrappit") { id = "de.javagil.werkcrappit" implementationClass = "de.javagil.werkcrappit.gradle.WerkcrappitPlugin" } } } tasks.processResources { val version = project.version.toString() inputs.property("version", version) filesMatching("**/werkcrappit-gradle-plugin.properties") { expand("version" to version) } } publishing { repositories { maven { name = "functionalTest" url = uri(rootProject.layout.buildDirectory.dir("functional-test-repo")) } } } val functionalTest = sourceSets.create("functionalTest") configurations[functionalTest.implementationConfigurationName].extendsFrom(configurations.testImplementation.get()) // the functional tests see the plugin only as published, never as classes of this build configurations[functionalTest.implementationConfigurationName].exclude(group = "info.solidsoft.gradle.pitest") configurations[functionalTest.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get()) dependencies { "functionalTestImplementation"(gradleTestKit()) "functionalTestImplementation"("com.fasterxml.jackson.core:jackson-databind:2.22.3") "functionalTestImplementation"("com.networknt:json-schema-validator:3.0.8") } val functionalTestTask = tasks.register("functionalTest") { description = "Runs the Gradle plugin from the published artifacts in real builds." group = "verification" testClassesDirs = functionalTest.output.classesDirs classpath = functionalTest.runtimeClasspath dependsOn("publishAllPublicationsToFunctionalTestRepository") dependsOn(":werkcrappit-pit:publishPitPluginPublicationToFunctionalTestRepository") systemProperty("werkcrappit.repo", rootProject.layout.buildDirectory.dir("functional-test-repo").get().asFile.absolutePath) systemProperty("werkcrappit.version", project.version.toString()) systemProperty("werkcrappit.pitestVersion", "1.30.0") systemProperty("werkcrappit.pitestGradlePluginVersion", pitestGradlePluginVersion) systemProperty("werkcrappit.codeChartaSchema", project(":werkcrappit-pit").layout.projectDirectory.file("src/test/resources/codecharta/cc-json-2.0.schema.main-364a7449a.json").asFile.absolutePath) systemProperty("werkcrappit.codeChartaOriginalSchema", project(":werkcrappit-pit").layout.projectDirectory.file("src/test/resources/codecharta/cc-json-2.0.schema.vis-2.7.0.json").asFile.absolutePath) } tasks.check { dependsOn(functionalTestTask) }