Skip to content

Commit 9ee982e

Browse files
authored
Merge pull request #1233 from modelix/MODELIX-968-Remove-Workaround-for-ZIP64-in-Gradle-build
build: remove workaround for ZIP64 in Gradle build
2 parents ef33b1e + 7802a23 commit 9ee982e

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

build-logic/src/main/kotlin/org/modelix/CopyMps.kt

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ import org.gradle.api.Project
2020
import org.gradle.api.file.Directory
2121
import org.gradle.api.provider.Provider
2222
import org.gradle.kotlin.dsl.dependencies
23-
import org.gradle.kotlin.dsl.support.unzipTo
24-
import org.gradle.kotlin.dsl.support.zipTo
2523
import java.io.File
26-
import java.nio.file.Files
27-
import java.nio.file.StandardCopyOption
2824
import java.util.zip.ZipInputStream
2925

3026
val Project.mpsMajorVersion: String get() {
@@ -109,32 +105,6 @@ fun Project.copyMps(): File {
109105
}
110106
}
111107

112-
// Workaround for https://youtrack.jetbrains.com/issue/KT-69541/Kotlin-2.0-compiler-cannot-use-JAR-packaged-as-ZIP64
113-
//
114-
// The issue was first detected with `lib/app.jar` in 2022.2 and 2022.3.
115-
// This JAR is needed since this versions because it contained `com.intellij.openapi.project.ProjectManager`.
116-
// Before that, `lib/platform-api.jar` contained `com.intellij.openapi.project.ProjectManager`.
117-
//
118-
// The workaround is to unzip the JAR with and zip it again.
119-
// Unzipping with Gradle supports ZIP64, but ZIP64 is not used when zipping again.
120-
//
121-
// TODO MODELIX-968 Remove this workaround after it is not needed anymore.
122-
val appJarFile = mpsHomeDir.get().asFile.resolve("lib/app.jar")
123-
if (appJarFile.exists()) {
124-
val appJarContent = mpsHomeDir.get().asFile.resolve("lib/appJarContent")
125-
val appJarFileNotZip64 = mpsHomeDir.get().asFile.resolve("lib/appNotZip64.jar")
126-
println("Unzipping $appJarFile into $appJarContent")
127-
unzipTo(appJarContent, appJarFile)
128-
println("Zipping $appJarContent into $appJarFileNotZip64")
129-
zipTo(appJarFileNotZip64, appJarContent)
130-
println("Deleting $appJarContent")
131-
delete {
132-
this.delete(appJarContent)
133-
}
134-
println("Overriding $appJarFile with $appJarFileNotZip64")
135-
Files.move(appJarFileNotZip64.toPath(), appJarFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
136-
}
137-
138108
// The build number of a local IDE is expected to contain a product code, otherwise an exception is thrown.
139109
val buildTxt = mpsHomeDir.get().asFile.resolve("build.txt")
140110
val buildNumber = buildTxt.readText()

0 commit comments

Comments
 (0)