mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-10-25 20:22:22 +00:00
113 lines
3.1 KiB
Kotlin
113 lines
3.1 KiB
Kotlin
plugins {
|
|
`java-library`
|
|
`maven-publish`
|
|
}
|
|
|
|
version = rootProject.version
|
|
|
|
java {
|
|
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
|
withSourcesJar()
|
|
}
|
|
|
|
// RFG variant attributes: the root Angelica project uses RetroFuturaGradle which expects
|
|
// these attributes on dependencies. Without them, Gradle can't resolve the subproject variant.
|
|
val rfgObfAttr = Attribute.of("com.gtnewhorizons.retrofuturagradle.obfuscation", String::class.java)
|
|
val rfgTransformedAttr = Attribute.of("rfgDeobfuscatorTransformed", Boolean::class.javaObjectType)
|
|
|
|
configurations {
|
|
listOf("apiElements", "runtimeElements").forEach { name ->
|
|
named(name) {
|
|
attributes {
|
|
attribute(rfgObfAttr, "mcp")
|
|
attribute(rfgTransformedAttr, true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
val lwjglNatives: String by extra
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
maven {
|
|
name = "GTNH Maven"
|
|
url = uri("https://nexus.gtnewhorizons.com/repository/public/")
|
|
}
|
|
maven {
|
|
name = "Minecraft Libraries"
|
|
url = uri("https://libraries.minecraft.net")
|
|
}
|
|
maven {
|
|
name = "Forge"
|
|
url = uri("https://maven.minecraftforge.net/")
|
|
}
|
|
maven {
|
|
name = "taumc"
|
|
url = uri("https://maven.taumc.org/releases")
|
|
}
|
|
maven {
|
|
name = "Sonatype Snapshots"
|
|
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
|
|
}
|
|
maven {
|
|
name = "Maven Central Snapshots"
|
|
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
|
|
}
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":glsm"))
|
|
|
|
compileOnly(libs.lwjgl3ify) { artifact { classifier = "dev" }; isTransitive = false }
|
|
compileOnly(libs.retrofuturabootstrap) { isTransitive = false }
|
|
compileOnly(libs.celeritas.common) { isTransitive = false }
|
|
|
|
// LWJGL3
|
|
implementation(libs.lwjgl3)
|
|
implementation(libs.lwjgl3.opengl)
|
|
compileOnly(libs.lwjgl3.sdl)
|
|
runtimeOnly(libs.lwjgl3) { artifact { classifier = lwjglNatives } }
|
|
runtimeOnly(libs.lwjgl3.opengl) { artifact { classifier = lwjglNatives } }
|
|
|
|
compileOnly(libs.log4j.api)
|
|
compileOnly(libs.annotations)
|
|
}
|
|
|
|
tasks.named<JavaCompile>("compileJava") {
|
|
val classesDir = destinationDirectory
|
|
doLast { injectLwjgl3Aware(classesDir.get().asFile) }
|
|
}
|
|
|
|
tasks.named<Jar>("jar") {
|
|
manifest {
|
|
attributes(
|
|
"Lwjgl3ify-Aware" to "true"
|
|
)
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
create<MavenPublication>("mavenJava") {
|
|
groupId = "com.gtnewhorizons.angelica"
|
|
artifactId = "lwjgl3-backend"
|
|
version = rootProject.version.toString()
|
|
from(components["java"])
|
|
}
|
|
}
|
|
repositories {
|
|
if (System.getenv("MAVEN_USER") != null) {
|
|
maven {
|
|
name = "GTNHMaven"
|
|
url = uri(rootProject.findProperty("mavenPublishUrl")?.toString() ?: "https://nexus.gtnewhorizons.com/repository/releases/")
|
|
credentials {
|
|
username = System.getenv("MAVEN_USER")
|
|
password = System.getenv("MAVEN_PASSWORD")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|