Skip to content

Commit

Permalink
Configure bom and catalog publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed Jul 21, 2024
1 parent 84a7e15 commit b78d284
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
40 changes: 21 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import net.fabricmc.loom.build.nesting.JarNester
import net.fabricmc.loom.util.Constants
import org.apache.commons.codec.digest.DigestUtils
import org.eclipse.jgit.api.Git
import java.util.*

plugins {
java
Expand Down Expand Up @@ -58,15 +57,32 @@ println("Version: $version")
allprojects {
apply(plugin = "maven-publish")

publishing {
repositories {
val env = System.getenv()
if (env["MAVEN_URL"] != null) {
repositories.maven {
url = uri(env["MAVEN_URL"] as String)
if (env["MAVEN_USERNAME"] != null) {
credentials {
username = env["MAVEN_USERNAME"]
password = env["MAVEN_PASSWORD"]
}
}
}
}
}
}

group = "org.sinytra.forgified-fabric-api"

if (project.name in META_PROJECTS) {
return@allprojects
}

apply(plugin = "java-library")
apply(plugin = "dev.architectury.loom")

group = "org.sinytra.forgified-fabric-api"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
withSourcesJar()
Expand Down Expand Up @@ -131,7 +147,7 @@ tasks {
)
}
}

withType<JavaCompile> {
options.release = 21
}
Expand Down Expand Up @@ -180,22 +196,8 @@ allprojects {
from(components["java"])
}
}
repositories {
val env = System.getenv()
if (env["MAVEN_URL"] != null) {
repositories.maven {
url = uri(env["MAVEN_URL"] as String)
if (env["MAVEN_USERNAME"] != null) {
credentials {
username = env["MAVEN_USERNAME"]
password = env["MAVEN_PASSWORD"]
}
}
}
}
}
}

if (project != rootProject) {
configurations {
apiElements {
Expand Down
2 changes: 1 addition & 1 deletion fabric-api-catalog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def doConfigureCatalog() {

catalog {
versionCatalog {
library(catalogName, "net.fabricmc.fabric-api:${proj.name}:${proj.version}")
library(catalogName, "org.sinytra.forgified-fabric-api:${proj.name}:${proj.version}")
}
}
}
Expand Down

0 comments on commit b78d284

Please sign in to comment.