mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-26 01:28:21 -05:00
58 lines
1.3 KiB
Groovy
58 lines
1.3 KiB
Groovy
|
plugins {
|
||
|
id 'version-catalog'
|
||
|
}
|
||
|
|
||
|
version = rootProject.version
|
||
|
|
||
|
publishing.publications {
|
||
|
register('mavenJava', MavenPublication) {
|
||
|
from components.versionCatalog
|
||
|
}
|
||
|
}
|
||
|
|
||
|
tasks.withType(GenerateModuleMetadata) {
|
||
|
// todo: RemoteSignJar fails when this is false (as set by parent build script)
|
||
|
enabled = true
|
||
|
}
|
||
|
|
||
|
// Avoid configuration ordering issues by creating the catalog entries during task execution time
|
||
|
tasks.register('configureCatalog') {
|
||
|
doFirst {
|
||
|
doConfigureCatalog()
|
||
|
}
|
||
|
}
|
||
|
tasks.named('generateCatalogAsToml') {
|
||
|
dependsOn('configureCatalog')
|
||
|
}
|
||
|
|
||
|
def doConfigureCatalog() {
|
||
|
for (proj in rootProject.allprojects) {
|
||
|
if (proj == project) { // the catalog itself
|
||
|
continue
|
||
|
}
|
||
|
|
||
|
String catalogName = proj.name
|
||
|
if (catalogName == 'fabric-api-base') {
|
||
|
catalogName = 'base'
|
||
|
} else if (catalogName == 'fabric-api-bom') {
|
||
|
catalogName = 'bom'
|
||
|
} else if (catalogName == 'deprecated') {
|
||
|
catalogName = 'deprecated-fabric-api'
|
||
|
} else if (catalogName == 'fabric-api') {
|
||
|
catalogName = 'fabric-api'
|
||
|
} else {
|
||
|
catalogName = catalogName.substring('fabric-'.length())
|
||
|
}
|
||
|
|
||
|
if (proj.parent != null && proj.parent.name == 'deprecated') {
|
||
|
catalogName = 'deprecated-' + catalogName
|
||
|
}
|
||
|
|
||
|
catalog {
|
||
|
versionCatalog {
|
||
|
library(catalogName, "net.fabricmc.fabric-api:${proj.name}:${proj.version}")
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|