Skip to content

Commit a753247

Browse files
committed
Preserve Forge classpath order in Eclipse launches
1 parent 4a96bb3 commit a753247

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎build.gradle‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,6 @@ tasks.register('isolateEclipseProductionRuns') {
777777
it.canonicalFile
778778
}.findAll { File runtimeFile ->
779779
!mainOutputs.contains(runtimeFile)
780-
}.sort { File left, File right ->
781-
left.canonicalPath <=> right.canonicalPath
782780
}
783781
List<String> launchLines = contents.readLines()
784782
int buildshipContainerLine = launchLines.findIndexOf {
@@ -871,6 +869,19 @@ tasks.register('verifyEclipseProductionClasspath') {
871869
if (!contents.contains("forge-${project.minecraft_version}-${project.forge_version}")) {
872870
throw new GradleException("${name} is missing the Forge development runtime")
873871
}
872+
List<String> bootstrapArtifacts = [
873+
"forge-${project.minecraft_version}-${project.forge_version}",
874+
"client-extra-${project.minecraft_version}",
875+
"mappings_${project.mapping_channel}-${project.minecraft_version}"
876+
]
877+
List<Integer> bootstrapPositions = bootstrapArtifacts.collect { artifact ->
878+
contents.indexOf(artifact)
879+
}
880+
if (bootstrapPositions.any { it < 0 }
881+
|| bootstrapPositions != bootstrapPositions.sort(false)) {
882+
throw new GradleException(
883+
"${name} does not preserve the Forge bootstrap classpath order")
884+
}
874885
if (contents.contains('${MC_VERSION}')
875886
|| !contents.contains(
876887
"key=\"MC_VERSION\" value=\"${project.minecraft_version}\"")) {

0 commit comments

Comments
 (0)