Skip to content

Commit

Permalink
build: remove workaround for ZIP64 in Gradle build
Browse files Browse the repository at this point in the history
  • Loading branch information
slisson committed Dec 8, 2024
1 parent f8bbee6 commit 6f9a4ea
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions build-logic/src/main/kotlin/org/modelix/CopyMps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -109,32 +109,6 @@ fun Project.copyMps(): File {
}
}

// Workaround for https://youtrack.jetbrains.com/issue/KT-69541/Kotlin-2.0-compiler-cannot-use-JAR-packaged-as-ZIP64
//
// The issue was first detected with `lib/app.jar` in 2022.2 and 2022.3.
// This JAR is needed since this versions because it contained `com.intellij.openapi.project.ProjectManager`.
// Before that, `lib/platform-api.jar` contained `com.intellij.openapi.project.ProjectManager`.
//
// The workaround is to unzip the JAR with and zip it again.
// Unzipping with Gradle supports ZIP64, but ZIP64 is not used when zipping again.
//
// TODO MODELIX-968 Remove this workaround after it is not needed anymore.
val appJarFile = mpsHomeDir.get().asFile.resolve("lib/app.jar")
if (appJarFile.exists()) {
val appJarContent = mpsHomeDir.get().asFile.resolve("lib/appJarContent")
val appJarFileNotZip64 = mpsHomeDir.get().asFile.resolve("lib/appNotZip64.jar")
println("Unzipping $appJarFile into $appJarContent")
unzipTo(appJarContent, appJarFile)
println("Zipping $appJarContent into $appJarFileNotZip64")
zipTo(appJarFileNotZip64, appJarContent)
println("Deleting $appJarContent")
delete {
this.delete(appJarContent)
}
println("Overriding $appJarFile with $appJarFileNotZip64")
Files.move(appJarFileNotZip64.toPath(), appJarFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
}

// The build number of a local IDE is expected to contain a product code, otherwise an exception is thrown.
val buildTxt = mpsHomeDir.get().asFile.resolve("build.txt")
val buildNumber = buildTxt.readText()
Expand Down

0 comments on commit 6f9a4ea

Please sign in to comment.