Skip to content

Commit f593791

Browse files
committed
Add kdoc.projects=*
1 parent bbb65b3 commit f593791

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

  • librarian-gradle-plugin/src/main/kotlin/com/gradleup/librarian/gradle

librarian-gradle-plugin/src/main/kotlin/com/gradleup/librarian/gradle/module.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,17 @@ internal fun Properties.olderVersions(): List<Coordinates> {
5050
internal fun Properties.projects(project: Project): List<String> {
5151
val allProjects = getProperty("kdoc.allProjects")?.toBoolean() ?: false
5252
return if (allProjects) {
53-
check(getProperty("kdoc.projects") == null) {
54-
"It is an error to set both kdoc.projects and kdoc.allProjects"
55-
}
56-
project.allprojects.map { it.isolated.path }
53+
error("Librarian: kdoc.allProjects is not supported anymore. Use kdoc.projects=* instead")
5754
} else {
58-
getProperty("kdoc.projects")?.split(",")
59-
?.filter {
60-
it.isNotEmpty()
61-
} ?: error("Librarian: either kdoc.projects or kdoc.allProjects is required")
55+
val projects = getProperty("kdoc.projects")
56+
if (projects == null || projects.isBlank()) {
57+
error("Librarian: kdoc.projects is required. You may set kdoc.projects=* to publish for all projects")
58+
}
59+
if (projects == "*") {
60+
project.allprojects.map { it.isolated.path }
61+
} else {
62+
projects.split(",").map { it.trim() }
63+
}
6264
}
6365
}
6466

0 commit comments

Comments
 (0)