@@ -19,15 +19,45 @@ version = "2.0.2"
1919
2020subprojects {
2121 plugins.apply {
22- apply (JavaGradlePluginPlugin ::class )
23- apply (" com.gradle.plugin-publish" )
2422 apply (" net.kyori.indra" )
25- apply (" net.kyori.indra.crossdoc" )
2623 apply (" net.kyori.indra.licenser.spotless" )
27- apply (" net.kyori.indra.publishing.gradle-plugin" )
2824 apply (" net.kyori.indra.git" )
2925 }
3026
27+ if (project.name != " spongegradle-testlib" ) {
28+ plugins.apply {
29+ apply (JavaGradlePluginPlugin ::class )
30+ apply (" com.gradle.plugin-publish" )
31+ apply (" net.kyori.indra.publishing.gradle-plugin" )
32+ apply (" net.kyori.indra.crossdoc" )
33+ }
34+
35+ tasks.named(" publishPlugins" ) {
36+ onlyIf { net.kyori.indra.util.Versioning .isRelease(project) }
37+ }
38+
39+ extensions.configure(TestingExtension ::class ) {
40+ suites.withType(JvmTestSuite ::class ).configureEach {
41+ useJUnitJupiter(" 5.9.0" )
42+ }
43+
44+ val functionalTest = suites.register(" functionalTest" , JvmTestSuite ::class ) {
45+ dependencies {
46+ implementation(project)
47+ implementation(project(" :spongegradle-testlib" ))
48+ implementation(" com.google.code.gson:gson:2.9.1" )
49+ }
50+ testType.set(TestSuiteType .FUNCTIONAL_TEST )
51+ }
52+
53+ tasks.named(" check" ) {
54+ dependsOn(functionalTest)
55+ }
56+
57+ extensions.getByType(GradlePluginDevelopmentExtension ::class ).testSourceSets(functionalTest.get().sources)
58+ }
59+ }
60+
3161 repositories {
3262 maven(" https://repo.spongepowered.org/repository/maven-public/" ) {
3363 name = " sponge"
@@ -51,10 +81,6 @@ subprojects {
5181 )
5282 }
5383
54- tasks.named(" publishPlugins" ) {
55- onlyIf { net.kyori.indra.util.Versioning .isRelease(project) }
56- }
57-
5884 extensions.configure(IndraExtension ::class ) {
5985 github(" SpongePowered" , " SpongeGradle" ) {
6086 ci(true )
@@ -120,7 +146,7 @@ subprojects {
120146 property(" url" , projectUrl)
121147 }
122148
123- extensions.configure (SigningExtension ::class ) {
149+ extensions.findByType (SigningExtension ::class )?. apply {
124150 val spongeSigningKey = project.findProperty(" spongeSigningKey" ) as String?
125151 val spongeSigningPassword = project.findProperty(" spongeSigningPassword" ) as String?
126152 if (spongeSigningKey != null && spongeSigningPassword != null ) {
@@ -140,7 +166,7 @@ subprojects {
140166 website(" https://spongepowered.org/" )
141167 }
142168
143- extensions.configure (CrossdocExtension ::class ) {
169+ extensions.findByType (CrossdocExtension ::class )?. apply {
144170 baseUrl(providers.gradleProperty(" javadocLinkRoot" ))
145171 nameBasedDocumentationUrlProvider {
146172 projectNamePrefix.set(" spongegradle-" )
0 commit comments