Skip to content

Commit 8b7eb68

Browse files
committed
simplify
1 parent d0ce47c commit 8b7eb68

File tree

1 file changed

+28
-44
lines changed

1 file changed

+28
-44
lines changed

build.gradle.kts

+28-44
Original file line numberDiff line numberDiff line change
@@ -107,51 +107,35 @@ if (gradle.startParameter.taskNames.contains("listTestsInPartition")) {
107107
}
108108
}
109109

110-
if (gradle.startParameter.taskNames.contains("generateFossaConfiguration")) {
111-
tasks {
112-
val generateFossaConfiguration by registering {
113-
group = "Help"
114-
description = "Write .fossa.yml config file"
115-
116-
doLast {
117-
File(".fossa.yml").printWriter().use { writer ->
118-
writer.println("version: 3")
119-
writer.println()
120-
writer.println("targets:")
121-
writer.println(" only:")
122-
writer.println(" # only scanning the modules which are published")
123-
writer.println(" # (as opposed to internal testing modules")
124-
rootProject.subprojects
125-
.sortedBy { it.findProperty("archivesName") as String? }
126-
.filter { !it.name.startsWith("bom") }
127-
.filter { it.plugins.hasPlugin("maven-publish") }
128-
.forEach {
129-
writer.println(" - type: gradle")
130-
writer.println(" path: ./")
131-
writer.println(" target: '${it.path}'")
132-
}
133-
writer.println()
134-
writer.println("experimental:")
135-
writer.println(" gradle:")
136-
writer.println(" configurations-only:")
137-
writer.println(" # consumer will only be exposed to these dependencies")
138-
writer.println(" - runtimeClasspath")
139-
}
140-
}
141-
142-
// disable all tasks to stop build
143-
subprojects {
144-
tasks.configureEach {
145-
enabled = false
146-
}
110+
tasks {
111+
val generateFossaConfiguration by registering {
112+
group = "Help"
113+
description = "Generate .fossa.yml configuration file"
114+
115+
doLast {
116+
File(".fossa.yml").printWriter().use { writer ->
117+
writer.println("version: 3")
118+
writer.println()
119+
writer.println("targets:")
120+
writer.println(" only:")
121+
writer.println(" # only scanning the modules which are published")
122+
writer.println(" # (as opposed to internal testing modules")
123+
rootProject.subprojects
124+
.sortedBy { it.findProperty("archivesName") as String? }
125+
.filter { !it.name.startsWith("bom") }
126+
.filter { it.plugins.hasPlugin("maven-publish") }
127+
.forEach {
128+
writer.println(" - type: gradle")
129+
writer.println(" path: ./")
130+
writer.println(" target: '${it.path}'")
131+
}
132+
writer.println()
133+
writer.println("experimental:")
134+
writer.println(" gradle:")
135+
writer.println(" configurations-only:")
136+
writer.println(" # consumer will only be exposed to these dependencies")
137+
writer.println(" - runtimeClasspath")
147138
}
148139
}
149140
}
150-
151-
// disable all tasks to stop build
152-
project.tasks.configureEach {
153-
if (this.name != "generateFossaConfiguration") {
154-
enabled = false
155-
}
156-
}
157141
}

0 commit comments

Comments
 (0)