@@ -52,34 +52,6 @@ subprojects {
52
52
targetCompatibility = JavaVersion .VERSION_11
53
53
}
54
54
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
- }
61
-
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"
71
- }
72
- }
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
55
dependencies {
84
56
" testRuntimeOnly" (" org.junit.jupiter:junit-jupiter-engine:5.3.0" )
85
57
" testImplementation" (" org.junit.jupiter:junit-jupiter-api:5.3.0" )
@@ -88,6 +60,37 @@ subprojects {
88
60
}
89
61
}
90
62
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)
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+
91
94
release {
92
95
git {
93
96
requireBranch.set(" master" )
0 commit comments