aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2023-01-11 22:03:47 +0100
committerGitHub <noreply@github.com>2023-01-11 22:03:47 +0100
commit49c9345807ed4d13d035e27a0665e2f7c63b0c9e (patch)
tree203bb0c8645fff55439da6ec953100d3f63de8a0 /build.gradle.kts
parent378c22c7cd98fba1f1bf1c2dd53f560deca29619 (diff)
downloadNotEnoughUpdates-49c9345807ed4d13d035e27a0665e2f7c63b0c9e.tar.gz
NotEnoughUpdates-49c9345807ed4d13d035e27a0665e2f7c63b0c9e.tar.bz2
NotEnoughUpdates-49c9345807ed4d13d035e27a0665e2f7c63b0c9e.zip
Optional Oneconfig support (#401)
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts32
1 files changed, 30 insertions, 2 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 04207cf2..e9e769a8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -75,6 +75,7 @@ repositories {
maven("https://repo.spongepowered.org/maven/")
maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1")
maven("https://jitpack.io")
+ maven("https://repo.polyfrost.cc/releases")
}
lombok {
@@ -86,8 +87,12 @@ val shadowImplementation by configurations.creating {
configurations.implementation.get().extendsFrom(this)
}
+val shadowOnly by configurations.creating {
+
+}
+
val shadowApi by configurations.creating {
- configurations.implementation.get().extendsFrom(this)
+ configurations.api.get().extendsFrom(this)
}
val devEnv by configurations.creating {
@@ -101,6 +106,14 @@ val kotlinDependencies by configurations.creating {
configurations.implementation.get().extendsFrom(this)
}
+val oneconfigQuarantineSourceSet = sourceSets.create("oneconfig") {
+ java {
+ srcDir(layout.projectDirectory.dir("src/main/oneconfig"))
+ }
+ kotlin {
+ }
+}
+
dependencies {
implementation("org.projectlombok:lombok:1.18.22")
minecraft("com.mojang:minecraft:1.8.9")
@@ -108,6 +121,16 @@ dependencies {
forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9")
+ if (project.findProperty("neu.buildflags.oneconfig") == "true") {
+ shadowOnly("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-alpha+") // Should be included in jar
+ runtimeOnly("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-alpha+") // Should be included in jar
+ }
+
+ "oneconfigImplementation"(sourceSets.main.get().output)
+ "oneconfigImplementation"(sourceSets.main.get().compileClasspath)
+ "oneconfigCompileOnly"(project(":oneconfigquarantine", configuration = "namedElements"))
+ "runtimeOnly"(oneconfigQuarantineSourceSet.output)
+
// Please keep this version in sync with KotlinLoadingTweaker
implementation(enforcedPlatform("org.jetbrains.kotlin:kotlin-bom:1.7.21"))
kotlinDependencies(kotlin("stdlib"))
@@ -141,6 +164,10 @@ tasks.named<Test>("test") {
useJUnitPlatform()
}
+tasks.named("jar", Jar::class) {
+ from(oneconfigQuarantineSourceSet.output)
+}
+
tasks.withType(Jar::class) {
archiveBaseName.set("NotEnoughUpdates")
manifest.attributes.run {
@@ -174,8 +201,8 @@ val kotlinDependencyCollectionJar by tasks.creating(Zip::class) {
tasks.shadowJar {
archiveClassifier.set("dep-dev")
+ configurations = listOf(shadowImplementation, shadowApi, shadowOnly)
archiveBaseName.set("NotEnoughUpdates")
- configurations = listOf(shadowImplementation, shadowApi)
exclude("**/module-info.class", "LICENSE.txt")
dependencies {
exclude {
@@ -183,6 +210,7 @@ tasks.shadowJar {
listOf("logback-classic", "commons-logging", "commons-codec", "logback-core")
}
}
+ from(oneconfigQuarantineSourceSet.output)
from(kotlinDependencyCollectionJar)
dependsOn(kotlinDependencyCollectionJar)
fun relocate(name: String) = relocate(name, "io.github.moulberry.notenoughupdates.deps.$name")