Skip to content

Commit

Permalink
Backport Gradle scripting from 1.20 to reduce extra repackaging and a…
Browse files Browse the repository at this point in the history
…llow running in dev
  • Loading branch information
embeddedt committed Jan 4, 2024
1 parent de8f045 commit 6144a5b
Show file tree
Hide file tree
Showing 379 changed files with 77 additions and 79,449 deletions.
40 changes: 31 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'dev.architectury.loom' version '0.10.0-SNAPSHOT'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'maven-publish'
}

Expand Down Expand Up @@ -47,22 +48,24 @@ repositories {
}
}

configurations {
toJar
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
forge "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

compileOnly "org.apache.ant:ant:1.8.2"
modCompileOnly "maven.modrinth:rubidium:0.2.13"
//modCompileOnly "me.jellysquid.mods:Rubidium:0.2.13"
modCompileOnly "curse.maven:epic-fight-mod-405076:4029362"

implementation fileTree(include: ['*.jar'], dir: 'libs')
toJar fileTree(include: ['antlr4-runtime-4.10.1.jar', 'glsl-transformer-1.0.0-pre21.2.jar'], dir: 'libs')
modRuntimeOnly "curse.maven:lazydfu-460819:3249059"

implementation(shadow(project(path: ":glsl-relocated", configuration: "bundledJar"))) {
transitive = false
}
implementation(shadow("org.anarres:jcpp:1.4.14")) {
transitive = false
}
shadow("org.slf4j:slf4j-api:1.7.12") // for jcpp
}

processResources {
Expand All @@ -86,8 +89,27 @@ java {
withSourcesJar()
}

jar {
from { configurations.toJar.collect { it.isDirectory() ? it : zipTree(it) } }
shadowJar {
configurations = [project.configurations.shadow]

from jar.archiveFile

relocate 'org.apache.commons.collections4', 'oculus.org.apache.commons.collections4'
relocate 'org.anarres.cpp', 'oculus.org.anarres.cpp'
relocate 'org.slf4j', 'oculus.org.slf4j'

archiveClassifier.set "shadow"

manifest {
attributes(
'Main-Class': 'net.coderbot.iris.LaunchWarn'
)
}
}

remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
}

publishing {
Expand Down
42 changes: 42 additions & 0 deletions glsl-relocated/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
plugins {
id 'java-library'
id 'com.github.johnrengelman.shadow'
}

repositories {
mavenCentral()
}

dependencies {
implementation(shadow("io.github.douira:glsl-transformer:1.0.1")) {
exclude module: "antlr4" // we only want to shadow the runtime module
}
implementation shadow("org.antlr:antlr4-runtime:4.10.1")
}

shadowJar {
configurations = [project.configurations.shadow]

from jar.archiveFile

relocate 'org.antlr', 'oculus.org.antlr'

archiveClassifier.set "shadow"
}



configurations {
bundledJar {
canBeConsumed = true
canBeResolved = false
// If you want this configuration to share the same dependencies, otherwise omit this line
extendsFrom implementation, runtimeOnly
}
}



artifacts {
bundledJar(shadowJar)
}
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ pluginManagement {
gradlePluginPortal()
}
}

include("glsl-relocated")
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Token;
import oculus.org.antlr.v4.runtime.RecognitionException;
import oculus.org.antlr.v4.runtime.Token;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down
76 changes: 0 additions & 76 deletions src/main/java/org/anarres/cpp/Argument.java

This file was deleted.

84 changes: 0 additions & 84 deletions src/main/java/org/anarres/cpp/ChrootFileSystem.java

This file was deleted.

Loading

0 comments on commit 6144a5b

Please sign in to comment.