@@ -52,42 +52,39 @@ subprojects {
52
52
targetCompatibility = JavaVersion .VERSION_11
53
53
}
54
54
55
- dependencies {
56
- " testRuntimeOnly " ( " org.junit.jupiter:junit-jupiter-engine:5.3.0 " )
57
- " testImplementation " ( " org.junit.jupiter:junit-jupiter-api:5.3.0 " )
58
- " testImplementation " ( " org.assertj " , " assertj-core " , " 3.11.1 " )
59
- " testImplementation " ( " org.junit-pioneer " , " junit-pioneer " , " 0.3.0 " )
55
+ apply (plugin = " java-gradle-plugin " )
56
+
57
+ // config for gradle plugin portal doesn't support snapshot, so we add config only if release version
58
+ if ( ! version.toString().endsWith( " -SNAPSHOT " )) {
59
+ apply (plugin = " com.gradle.plugin-publish " )
60
60
}
61
- }
62
61
63
- // config for gradle plugin portal
64
- // doesn't support snapshot, so we add config only if release version
65
- if (! version.toString().endsWith(" -SNAPSHOT" )) {
66
- subprojects.forEach { project ->
67
- with (project) {
68
- // com.gradle.plugin-publish depends on java-gradle-plugin, but it screws a bit this project
69
- apply (plugin = " java-gradle-plugin" )
70
- apply (plugin = " com.gradle.plugin-publish" )
71
- project.afterEvaluate {
72
- // java-gradle-plugin requires this block, but we already added the definitions in META-INF for unit testing...
73
- configure<GradlePluginDevelopmentExtension > {
74
- plugins {
75
- create(" ${project.name.capitalize()} Plugin" ) {
76
- id = " com.bakdata.${project.name} "
77
- implementationClass = " com.bakdata.gradle.${project.name.capitalize()} Plugin"
78
- description = project.description
79
- displayName = " Bakdata $name plugin"
80
- }
81
- }
82
- }
83
- // actual block of plugin portal config, need to be done on each subproject as the plugin does not support multi-module projects yet...
84
- configure< com.gradle.publish.PluginBundleExtension > {
85
- website = " https://github.com/bakdata/gradle-plugins"
86
- vcsUrl = " https://github.com/bakdata/gradle-plugins"
87
- tags = listOf (" bakdata" , name)
62
+ // description is only ready after evaluation
63
+ afterEvaluate {
64
+ configure<GradlePluginDevelopmentExtension > {
65
+ plugins {
66
+ create(" ${project.name.capitalize()} Plugin" ) {
67
+ id = " com.bakdata.${project.name} "
68
+ implementationClass = " com.bakdata.gradle.${project.name.capitalize()} Plugin"
69
+ description = project.description
70
+ displayName = " Bakdata $name plugin"
88
71
}
89
72
}
90
73
}
74
+
75
+ extensions.findByType(com.gradle.publish.PluginBundleExtension ::class )?.apply {
76
+ // actual block of plugin portal config, need to be done on each subproject as the plugin does not support multi-module projects yet...
77
+ website = " https://github.com/bakdata/gradle-plugins"
78
+ vcsUrl = " https://github.com/bakdata/gradle-plugins"
79
+ tags = listOf (" bakdata" , name)
80
+ }
81
+ }
82
+
83
+ dependencies {
84
+ " testRuntimeOnly" (" org.junit.jupiter:junit-jupiter-engine:5.3.0" )
85
+ " testImplementation" (" org.junit.jupiter:junit-jupiter-api:5.3.0" )
86
+ " testImplementation" (" org.assertj" , " assertj-core" , " 3.11.1" )
87
+ " testImplementation" (" org.junit-pioneer" , " junit-pioneer" , " 0.3.0" )
91
88
}
92
89
}
93
90
0 commit comments