Add publish-library convention plugin

This commit is contained in:
Edwin Jakobs
2025-09-15 20:49:05 +02:00
parent a0b7df5585
commit f8cc9b713e
5 changed files with 68 additions and 5 deletions

View File

@@ -11,6 +11,18 @@ dependencyResolutionManagement {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
// We use a regex to get the openrndr/orx versions from the primary catalog as there is no public Gradle API to parse catalogs.
val orRegEx = Regex("^openrndr[ ]*=[ ]*(?:\\{[ ]*require[ ]*=[ ]*)?\"(.*)\"[ ]*(?:\\})?", RegexOption.MULTILINE)
val orxRegEx = Regex("^orx[ ]*=[ ]*(?:\\{[ ]*require[ ]*=[ ]*)?\"(.*)\"[ ]*(?:\\})?", RegexOption.MULTILINE)
val openrndrVersion = orRegEx.find(File(rootDir,"../gradle/libs.versions.toml").readText())?.groupValues?.get(1) ?: error("can't find openrndr version")
val orxVersion = orxRegEx.find(File(rootDir,"../gradle/libs.versions.toml").readText())?.groupValues?.get(1) ?: error("can't find orx version")
create("orx") {
from("org.openrndr.extra:orx-module-catalog:$orxVersion")
}
create("openrndr") {
from("org.openrndr:openrndr-module-catalog:$openrndrVersion")
}
}
}