Skip to content

Commit

Permalink
Band-aid up Forge 1.12.2 build
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeprimm committed Apr 29, 2024
1 parent e21198d commit b434f09
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 21 deletions.
74 changes: 57 additions & 17 deletions forge-1.12.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,32 @@ apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'eclipse'

sourceSets {
main.java.srcDirs = ['src/main/java', '../DynmapCore/src/main/java', '../DynmapCoreAPI/src/main/java']
main.resources.srcDirs = ['src/main/resources', '../DynmapCore/src/main/resources', '../DynmapCoreAPI/src/main/resources']
}

eclipse {
project {
name = "Dynmap(Forge-Legacy-1.12.2)"
}
}

dependencies {
implementation project(path: ":DynmapCore", configuration: "shadow")
implementation 'javax.servlet:javax.servlet-api:3.1'
implementation'org.eclipse.jetty:jetty-server:9.4.26.v20200117'
implementation 'org.eclipse.jetty:jetty-servlet:9.4.26.v20200117'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation 'org.yaml:snakeyaml:1.23' // DON'T UPDATE - NEWER ONE TRIPS ON WINDOWS ENCODED FILES
implementation 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20180219.1'
implementation 'org.postgresql:postgresql:42.2.18'
implementation 'io.github.linktosriram.s3lite:core:0.0.2-SNAPSHOT'
implementation 'io.github.linktosriram.s3lite:api:0.0.2-SNAPSHOT'
implementation 'io.github.linktosriram.s3lite:http-client-url-connection:0.0.2-SNAPSHOT'
implementation 'io.github.linktosriram.s3lite:http-client-spi:0.0.2-SNAPSHOT'
implementation 'io.github.linktosriram.s3lite:util:0.0.2-SNAPSHOT'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.1'
implementation 'com.sun.xml.bind:jaxb-impl:3.0.0'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation 'org.yaml:snakeyaml:1.23'
implementation 'org.spongepowered:spongeapi:7.0.0'
Expand All @@ -46,31 +64,53 @@ minecraft {

project.archivesBaseName = "${project.archivesBaseName}-forge-1.12.2"

processResources
{
processResources {
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'

filesMatching([
'core.yml',
'lightings.txt',
'perspectives.txt',
'shaders.txt',
'mcmod.info',
'extracted/web/version.js',
'extracted/web/index.html',
'extracted/web/login.html'
]) {
// replace version and mcversion
expand(
version: project.version + '-' + project.ext.buildNumber,
buildnumber: project.parent.ext.globals.buildNumber,
version: project.version,
mcversion: "1.12.2"
)
)
}

// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
// Move access transformer to META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}

shadowJar {
dependencies {
include(dependency(':DynmapCore'))
}
include(dependency('com.googlecode.json-simple:json-simple:'))
include(dependency('org.yaml:snakeyaml:'))
include(dependency('com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:'))
include(dependency('javax.servlet::'))
include(dependency('org.eclipse.jetty::'))
include(dependency('org.eclipse.jetty.orbit:javax.servlet:'))
include(dependency('org.postgresql:postgresql:'))
include(dependency('io.github.linktosriram.s3lite:core:'))
include(dependency('io.github.linktosriram.s3lite:api:'))
include(dependency('io.github.linktosriram.s3lite:http-client-url-connection:'))
include(dependency('io.github.linktosriram.s3lite:http-client-spi:'))
include(dependency('io.github.linktosriram.s3lite:util:'))
include(dependency('jakarta.xml.bind::'))
include(dependency('com.sun.xml.bind::'))
exclude("META-INF/maven/**")
exclude("META-INF/services/**")
}
relocate('org.json.simple', 'org.dynmap.json.simple')
relocate('org.yaml.snakeyaml', 'org.dynmap.snakeyaml')
relocate('org.eclipse.jetty', 'org.dynmap.jetty')
relocate('org.owasp.html', 'org.dynmap.org.owasp.html')
relocate('javax.servlet', 'org.dynmap.javax.servlet' )
relocate('org.postgresql', 'org.dynmap.org.postgresql')
relocate('io.github.linktosriram.s3lite', 'org.dynmap.s3lite')
archiveName = "Dynmap-${parent.version}-forge-1.12.2.jar"
destinationDir = file '../target'
manifest {
Expand Down
4 changes: 0 additions & 4 deletions oldbuilds/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
rootProject.name = 'dynmap-common'
include ':DynmapCore'
include ':DynmapCoreAPI'
include ':forge-1.12.2'

project(':DynmapCore').projectDir = "$rootDir/../DynmapCore" as File
project(':DynmapCoreAPI').projectDir = "$rootDir/../DynmapCoreAPI" as File
project(':forge-1.12.2').projectDir = "$rootDir/../forge-1.12.2" as File

0 comments on commit b434f09

Please sign in to comment.