build: generate bom and catalog
This commit is contained in:
parent
c09f5dda62
commit
45cbc38d68
|
@ -0,0 +1,31 @@
|
|||
plugins {
|
||||
`java-platform`
|
||||
id("jf.maven-publish")
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
register("mavenJava", MavenPublication::class) {
|
||||
from(components["javaPlatform"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(GenerateModuleMetadata::class) {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
dependencies {
|
||||
constraints {
|
||||
for (proj in rootProject.allprojects) {
|
||||
if (proj == project) {
|
||||
continue
|
||||
}
|
||||
if (proj.name == "libjf-catalog") {
|
||||
continue
|
||||
}
|
||||
|
||||
api(project(proj.path))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
plugins {
|
||||
`version-catalog`
|
||||
id("jf.maven-publish")
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
register("mavenJava", MavenPublication::class) {
|
||||
from(components["versionCatalog"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(GenerateModuleMetadata::class) {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
tasks.register("configureCatalog") {
|
||||
doFirst {
|
||||
doConfigureCatalog()
|
||||
}
|
||||
}
|
||||
tasks.named("generateCatalogAsToml") {
|
||||
dependsOn("configureCatalog")
|
||||
}
|
||||
|
||||
fun doConfigureCatalog() {
|
||||
for (proj in rootProject.allprojects) {
|
||||
if (proj == project) {
|
||||
continue
|
||||
}
|
||||
|
||||
var catalogName = proj.name
|
||||
catalogName = when (catalogName) {
|
||||
"libjf-base" -> "base"
|
||||
"libjf-bom" -> "bom"
|
||||
"libjf" -> "libjf"
|
||||
else -> catalogName.substring("libjf-".length)
|
||||
}
|
||||
|
||||
catalog {
|
||||
versionCatalog {
|
||||
library(catalogName, "$group:${proj.name}:${proj.version}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,9 +7,6 @@ plugins {
|
|||
id("jf.codegen")
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
version = rootProject.version
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://maven.frohnmeyer-wds.de/artifacts")
|
||||
|
|
|
@ -31,3 +31,6 @@ include("libjf-unsafe-v0")
|
|||
|
||||
include("libjf-mainhttp-v0")
|
||||
include("libjf-web-v1")
|
||||
|
||||
include("libjf-bom")
|
||||
include("libjf-catalog")
|
||||
|
|
Loading…
Reference in New Issue