Skip to content

Commit 9f19ef5

Browse files
authored
Merge pull request #174 from modelix/MODELIX-968-Remove-Workaround-for-ZIP64-in-Gradle-build
build: remove workaround for ZIP64 in Gradle build
2 parents b63c762 + 724c3c5 commit 9f19ef5

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

build.gradle.kts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import org.gradle.kotlin.dsl.support.unzipTo
2-
import org.gradle.kotlin.dsl.support.zipTo
31
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
42
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
53
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
64
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
75
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformJvmPlugin
8-
import java.nio.file.Files
9-
import java.nio.file.StandardCopyOption
106
import java.util.zip.ZipInputStream
117

128
buildscript {
@@ -195,32 +191,6 @@ mpsHome.get().asFile.let { baseDir ->
195191
}
196192
}
197193

198-
// Workaround for https://youtrack.jetbrains.com/issue/KT-69541/Kotlin-2.0-compiler-cannot-use-JAR-packaged-as-ZIP64
199-
//
200-
// The issue was first detected with `lib/app.jar` in 2022.2 and 2022.3.
201-
// This JAR is needed since this versions because it contained `com.intellij.openapi.project.ProjectManager`.
202-
// Before that, `lib/platform-api.jar` contained `com.intellij.openapi.project.ProjectManager`.
203-
//
204-
// The workaround is to unzip the JAR with and zip it again.
205-
// Unzipping with Gradle supports ZIP64, but ZIP64 is not used when zipping again.
206-
//
207-
// TODO MODELIX-968 Remove this workaround after it is not needed anymore.
208-
val appJarFile = mpsHome.get().asFile.resolve("lib/app.jar")
209-
if (appJarFile.exists()) {
210-
val appJarContent = mpsHome.get().asFile.resolve("lib/appJarContent")
211-
val appJarFileNotZip64 = mpsHome.get().asFile.resolve("lib/appNotZip64.jar")
212-
println("Unzipping $appJarFile into $appJarContent")
213-
unzipTo(appJarContent, appJarFile)
214-
println("Zipping $appJarContent into $appJarFileNotZip64")
215-
zipTo(appJarFileNotZip64, appJarContent)
216-
println("Deleting $appJarContent")
217-
delete {
218-
this.delete(appJarContent)
219-
}
220-
println("Overriding $appJarFile with $appJarFileNotZip64")
221-
Files.move(appJarFileNotZip64.toPath(), appJarFile.toPath(), StandardCopyOption.REPLACE_EXISTING)
222-
}
223-
224194
// The build number of a local IDE is expected to contain a product code, otherwise an exception is thrown.
225195
val buildTxt = mpsHome.get().asFile.resolve("build.txt")
226196
val buildNumber = buildTxt.readText()

0 commit comments

Comments
 (0)