Browse Source

fix: Fix OrbisLib JAR not being included in builds

1.14.x
JellySquid 4 months ago
parent
commit
848bf40a32
Signed by: Angeline <angeline@gildedgames.com> GPG Key ID: E8142FD7984F528E
1 changed files with 15 additions and 43 deletions
  1. 15
    43
      build.gradle

+ 15
- 43
build.gradle View File

@@ -24,12 +24,6 @@ repositories {
}

configurations {
compileShaded
compile.extendsFrom compileShaded

runtimeShaded
runtime.extendsFrom runtimeShaded

shaded
shaded.exclude group: "org.spongepowered"
}
@@ -42,7 +36,8 @@ dependencies {
shaded "me.jellysquid.mods:phosphor:${phosphor_version}:universal"
}

compileShaded project(":orbis-lib")
compile project(":orbis-lib")
shaded project(":orbis-lib")
}

allprojects {
@@ -65,27 +60,25 @@ sourceSets {
}
}

// This is an ugly hack to make Phosphor appear before Orbis-Lib
// If we don't do this, then Forge will explode for some unknown reason and not be able to handle dependency resolution
def shadedJars = configurations.shaded.files
.findAll { it.name.contains("-universal.jar") }
.toList()
.reverse()

def genericJarManifest = {
attributes "ContainedDeps": shadedJars.collect { it.name }.join(' ')
attributes "FMLAT": "aether_at.cfg"
}

jar {
from sourceSets.api.output
from sourceSets.main.output

classifier "universal"

from shadedJars
gradle.projectsEvaluated({
def artifacts = configurations.shaded.files
.findAll { it.name.contains("-universal.jar") }
.toList()
.reverse()

from(artifacts)

manifest genericJarManifest
manifest {
attributes "ContainedDeps": artifacts.collect { it.name }.join(' ')
attributes "FMLAT": "aether_at.cfg"
}
})
}

task apiJar(type: Jar) {
@@ -94,26 +87,6 @@ task apiJar(type: Jar) {
from sourceSets.api.output
}

task serverJar(type: Jar) {
classifier = "server"

from sourceSets.api.output
from (sourceSets.main.output) {
// Exclude client assets
exclude 'assets/*/blockstates/**'
exclude 'assets/*/sounds/**'
exclude 'assets/*/textures/**'
exclude 'assets/*/models/**'

// Exclude client code
exclude 'com/gildedgames/aether/client/**'
}

from shadedJars

manifest genericJarManifest
}

minecraft {
version = "$minecraft_version-$forge_version"
mappings = "$forge_mappings"
@@ -160,7 +133,7 @@ if (System.getenv("JARSIGN_SECRETS_FILE") != null) {
def secrets = new Properties()
secrets.load(secretsFile.newReader())

[jar, apiJar, serverJar].each { jarTask ->
[jar, apiJar].each { jarTask ->
def task = task(jarTask.name + 'Sign', type: SignJar) {
keyStore = System.getenv("JARSIGN_KEYSTORE_FILE")
alias = secrets.alias
@@ -176,6 +149,5 @@ if (System.getenv("JARSIGN_SECRETS_FILE") != null) {
}

build.dependsOn apiJar
build.dependsOn serverJar

jar.dependsOn ":orbis-lib:build"

Loading…
Cancel
Save