File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
buildSrc/src/main/kotlin/io/tnboot/gradle/build
telenor-boot-dependencies Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,14 @@ class PublishPlugin : Plugin<Project> {
40
40
configurations.add(block)
41
41
}
42
42
43
- val isEnabled get() = enabled && (evenWithChildren || project.childProjects.isEmpty())
43
+ val isPublished get() = enabled && (evenWithChildren || project.childProjects.isEmpty())
44
44
}
45
45
46
46
override fun apply (target : Project ) {
47
47
target.extensions.add(Extension ::class .java, " publish" , Extension (target))
48
48
target.afterEvaluate {
49
49
target.extensions.getByType(Extension ::class .java).let { extension ->
50
- if (! extension.isEnabled ) return @afterEvaluate
50
+ if (! extension.isPublished ) return @afterEvaluate
51
51
log.debug(" Enabling Maven Publications for project {}" , target.name)
52
52
target.mavenPublish {
53
53
extension.configurations.forEach {
Original file line number Diff line number Diff line change @@ -32,3 +32,10 @@ fun Project.mavenPublish(block: MavenPublication.() -> Unit) {
32
32
}
33
33
}
34
34
}
35
+
36
+ val Project .publishedProjects get() = rootProject.allprojects.filter {
37
+ it != project && it.plugins.hasPlugin(PublishPlugin ::class .java) &&
38
+ it.extensions.getByType(PublishPlugin .Extension ::class .java).isPublished
39
+ }
40
+
41
+ val Project .notation get() = " $group :$name :$version "
Original file line number Diff line number Diff line change 1
1
import io.tnboot.gradle.build.DependencyGroups
2
- import io.tnboot.gradle.build.PublishPlugin
3
2
import io.tnboot.gradle.build.mavenPublish
3
+ import io.tnboot.gradle.build.notation
4
+ import io.tnboot.gradle.build.publishedProjects
4
5
5
6
plugins {
6
7
`java- platform`
@@ -16,13 +17,7 @@ val bom = DependencyGroups(
16
17
dependencies {
17
18
constraints {
18
19
bom.dependencies.forEach { add(" api" , it) }
19
-
20
- rootProject.allprojects.filter {
21
- it != project && it.plugins.hasPlugin(PublishPlugin ::class .java) &&
22
- it.extensions.getByType(PublishPlugin .Extension ::class .java).isEnabled
23
- }.forEach {
24
- add(" api" , it)
25
- }
20
+ publishedProjects.forEach { add(" api" , it.notation) }
26
21
}
27
22
}
28
23
You can’t perform that action at this time.
0 commit comments