Browse Source

fix: Fix OrbisLib JAR not being included in builds

tg_manager_fixed^2
Angeline 1 month 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 {
24 24
 }
25 25
 
26 26
 configurations {
27
-    compileShaded
28
-    compile.extendsFrom compileShaded
29
-
30
-    runtimeShaded
31
-    runtime.extendsFrom runtimeShaded
32
-
33 27
     shaded
34 28
     shaded.exclude group: "org.spongepowered"
35 29
 }
@@ -42,7 +36,8 @@ dependencies {
42 36
         shaded  "me.jellysquid.mods:phosphor:${phosphor_version}:universal"
43 37
     }
44 38
 
45
-    compileShaded project(":orbis-lib")
39
+    compile project(":orbis-lib")
40
+    shaded project(":orbis-lib")
46 41
 }
47 42
 
48 43
 allprojects {
@@ -65,27 +60,25 @@ sourceSets {
65 60
     }
66 61
 }
67 62
 
68
-// This is an ugly hack to make Phosphor appear before Orbis-Lib
69
-// If we don't do this, then Forge will explode for some unknown reason and not be able to handle dependency resolution
70
-def shadedJars = configurations.shaded.files
71
-        .findAll { it.name.contains("-universal.jar") }
72
-        .toList()
73
-        .reverse()
74
-
75
-def genericJarManifest = {
76
-    attributes "ContainedDeps": shadedJars.collect { it.name }.join(' ')
77
-    attributes "FMLAT": "aether_at.cfg"
78
-}
79
-
80 63
 jar {
81 64
     from sourceSets.api.output
82 65
     from sourceSets.main.output
83 66
 
84 67
     classifier "universal"
85 68
 
86
-    from shadedJars
69
+    gradle.projectsEvaluated({
70
+        def artifacts = configurations.shaded.files
71
+                .findAll { it.name.contains("-universal.jar") }
72
+                .toList()
73
+                .reverse()
74
+
75
+        from(artifacts)
87 76
 
88
-    manifest genericJarManifest
77
+        manifest {
78
+            attributes "ContainedDeps": artifacts.collect { it.name }.join(' ')
79
+            attributes "FMLAT": "aether_at.cfg"
80
+        }
81
+    })
89 82
 }
90 83
 
91 84
 task apiJar(type: Jar) {
@@ -94,26 +87,6 @@ task apiJar(type: Jar) {
94 87
     from sourceSets.api.output
95 88
 }
96 89
 
97
-task serverJar(type: Jar) {
98
-    classifier = "server"
99
-
100
-    from sourceSets.api.output
101
-    from (sourceSets.main.output) {
102
-        // Exclude client assets
103
-        exclude 'assets/*/blockstates/**'
104
-        exclude 'assets/*/sounds/**'
105
-        exclude 'assets/*/textures/**'
106
-        exclude 'assets/*/models/**'
107
-
108
-        // Exclude client code
109
-        exclude 'com/gildedgames/aether/client/**'
110
-    }
111
-
112
-    from shadedJars
113
-
114
-    manifest genericJarManifest
115
-}
116
-
117 90
 minecraft {
118 91
     version = "$minecraft_version-$forge_version"
119 92
     mappings = "$forge_mappings"
@@ -160,7 +133,7 @@ if (System.getenv("JARSIGN_SECRETS_FILE") != null) {
160 133
     def secrets = new Properties()
161 134
     secrets.load(secretsFile.newReader())
162 135
 
163
-    [jar, apiJar, serverJar].each { jarTask ->
136
+    [jar, apiJar].each { jarTask ->
164 137
         def task = task(jarTask.name + 'Sign', type: SignJar) {
165 138
             keyStore = System.getenv("JARSIGN_KEYSTORE_FILE")
166 139
             alias = secrets.alias
@@ -176,6 +149,5 @@ if (System.getenv("JARSIGN_SECRETS_FILE") != null) {
176 149
 }
177 150
 
178 151
 build.dependsOn apiJar
179
-build.dependsOn serverJar
180 152
 
181 153
 jar.dependsOn ":orbis-lib:build"

Loading…
Cancel
Save