Skip to content

Commit 3dd1adc

Browse files
author
Oleksandr Dzhychko
authored
Merge pull request #763 from modelix/dependabot/gradle/kotlin-2.0.0
build(deps): bump kotlin from 1.9.24 to 2.0.0
2 parents 2aa2a49 + a2728ce commit 3dd1adc

File tree

15 files changed

+83
-70
lines changed

15 files changed

+83
-70
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ kotlin_gen
1111
/node_modules
1212
**/.ideaconfig
1313
**/.mpsconfig
14+
.kotlin

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ 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
2325
import java.io.File
26+
import java.nio.file.Files
27+
import java.nio.file.StandardCopyOption
2428
import java.util.zip.ZipInputStream
2529

2630
val Project.mpsMajorVersion: String get() {
@@ -105,6 +109,32 @@ fun Project.copyMps(): File {
105109
}
106110
}
107111

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+
108138
// The build number of a local IDE is expected to contain a product code, otherwise an exception is thrown.
109139
val buildTxt = mpsHomeDir.get().asFile.resolve("build.txt")
110140
val buildNumber = buildTxt.readText()

build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ subprojects {
7777
val kotlinApiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_6
7878
subproject.tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
7979
if (!name.lowercase().contains("test")) {
80-
this.kotlinOptions {
81-
jvmTarget = "11"
82-
freeCompilerArgs += listOf("-Xjvm-default=all-compatibility", "-Xexpect-actual-classes")
83-
apiVersion = kotlinApiVersion.version
80+
this.compilerOptions {
81+
jvmTarget.set(JvmTarget.JVM_11)
82+
freeCompilerArgs.addAll(listOf("-Xjvm-default=all-compatibility", "-Xexpect-actual-classes"))
83+
apiVersion.set(kotlinApiVersion)
8484
}
8585
}
8686
}
8787
subproject.tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
8888
if (!name.lowercase().contains("test")) {
89-
this.kotlinOptions {
90-
jvmTarget = "11"
91-
freeCompilerArgs += listOf("-Xjvm-default=all-compatibility")
92-
apiVersion = kotlinApiVersion.version
89+
this.compilerOptions {
90+
jvmTarget.set(JvmTarget.JVM_11)
91+
freeCompilerArgs.addAll(listOf("-Xjvm-default=all-compatibility"))
92+
apiVersion.set(kotlinApiVersion)
9393
}
9494
}
9595
}

bulk-model-sync-lib/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
}
44

55
kotlin {
6+
jvmToolchain(11)
67
js(IR) {
78
browser {
89
testTask {
@@ -13,7 +14,6 @@ kotlin {
1314
}
1415
}
1516
jvm {
16-
jvmToolchain(11)
1717
testRuns["test"].executionTask.configure {
1818
useJUnitPlatform()
1919
}

bulk-model-sync-lib/mps-test/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dependencies {
3838

3939
intellij {
4040
localPath = copyMps().absolutePath
41+
instrumentCode = false
4142
}
4243

4344
tasks {

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ kotlinx-kover = { id = "org.jetbrains.kotlinx.kover", version = "0.8.2" }
2525
docker-compose = { id = "com.avast.gradle.docker-compose" , version = "0.17.7" }
2626

2727
[versions]
28-
kotlin = "1.9.24"
28+
kotlin = "2.0.0"
2929
kotlinCoroutines="1.8.1"
3030
ktor="2.3.12"
3131
kotlinHtml="0.8.0"

kotlin-js-store/yarn.lock

Lines changed: 19 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,6 @@ binary-extensions@^2.0.0:
137137
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
138138
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
139139

140-
brace-expansion@^1.1.7:
141-
version "1.1.11"
142-
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
143-
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
144-
dependencies:
145-
balanced-match "^1.0.0"
146-
concat-map "0.0.1"
147-
148140
brace-expansion@^2.0.1:
149141
version "2.0.1"
150142
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
@@ -225,11 +217,6 @@ combined-stream@^1.0.8:
225217
dependencies:
226218
delayed-stream "~1.0.0"
227219

228-
229-
version "0.0.1"
230-
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
231-
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
232-
233220
cssom@^0.5.0:
234221
version "0.5.0"
235222
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.5.0.tgz#d254fa92cd8b6fbd83811b9fbaed34663cc17c36"
@@ -408,17 +395,16 @@ glob-parent@~5.1.2:
408395
dependencies:
409396
is-glob "^4.0.1"
410397

411-
glob@7.2.0:
412-
version "7.2.0"
413-
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
414-
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
398+
glob@8.1.0:
399+
version "8.1.0"
400+
resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e"
401+
integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==
415402
dependencies:
416403
fs.realpath "^1.0.0"
417404
inflight "^1.0.4"
418405
inherits "2"
419-
minimatch "^3.0.4"
406+
minimatch "^5.0.1"
420407
once "^1.3.0"
421-
path-is-absolute "^1.0.0"
422408

423409
has-flag@^4.0.0:
424410
version "4.0.0"
@@ -614,17 +600,17 @@ [email protected]:
614600
dependencies:
615601
brace-expansion "^2.0.1"
616602

617-
minimatch@^3.0.4:
618-
version "3.1.2"
619-
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
620-
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
603+
minimatch@^5.0.1:
604+
version "5.1.6"
605+
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96"
606+
integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==
621607
dependencies:
622-
brace-expansion "^1.1.7"
608+
brace-expansion "^2.0.1"
623609

624-
mocha@10.2.0:
625-
version "10.2.0"
626-
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8"
627-
integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==
610+
mocha@10.3.0:
611+
version "10.3.0"
612+
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.3.0.tgz#0e185c49e6dccf582035c05fa91084a4ff6e3fe9"
613+
integrity sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==
628614
dependencies:
629615
ansi-colors "4.1.1"
630616
browser-stdout "1.3.1"
@@ -633,13 +619,12 @@ [email protected]:
633619
diff "5.0.0"
634620
escape-string-regexp "4.0.0"
635621
find-up "5.0.0"
636-
glob "7.2.0"
622+
glob "8.1.0"
637623
he "1.2.0"
638624
js-yaml "4.1.0"
639625
log-symbols "4.1.0"
640626
minimatch "5.0.1"
641627
ms "2.1.3"
642-
nanoid "3.3.3"
643628
serialize-javascript "6.0.0"
644629
strip-json-comments "3.1.1"
645630
supports-color "8.1.1"
@@ -658,11 +643,6 @@ [email protected]:
658643
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
659644
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
660645

661-
662-
version "3.3.3"
663-
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25"
664-
integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==
665-
666646
667647
version "2.6.7"
668648
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
@@ -725,11 +705,6 @@ path-exists@^4.0.0:
725705
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
726706
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
727707

728-
path-is-absolute@^1.0.0:
729-
version "1.0.1"
730-
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
731-
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
732-
733708
picomatch@^2.0.4, picomatch@^2.2.1:
734709
version "2.3.1"
735710
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
@@ -902,10 +877,10 @@ type-check@~0.3.2:
902877
dependencies:
903878
prelude-ls "~1.1.2"
904879

905-
typescript@5.0.4:
906-
version "5.0.4"
907-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
908-
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
880+
typescript@5.4.3:
881+
version "5.4.3"
882+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.3.tgz#5c6fedd4c87bee01cd7a528a30145521f8e0feff"
883+
integrity sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==
909884

910885
universalify@^0.2.0:
911886
version "0.2.0"

light-model-client/src/commonMain/kotlin/org/modelix/client/light/LightModelClient.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,9 @@ private class AutoTransactions(val delegate: ITransactionManager) : ITransaction
766766
}
767767
}
768768

769-
expect class PlatformSpecificLightModelClientBuilder() : LightModelClientBuilder
769+
expect class PlatformSpecificLightModelClientBuilder() : LightModelClientBuilder {
770+
override fun getDefaultEngineFactory(): HttpClientEngineFactory<*>
771+
}
770772

771773
abstract class LightModelClientBuilder {
772774
private var host: String = "localhost"

light-model-client/src/jsMain/kotlin/org/modelix/client/light/PlatformSpecificLightModelClientBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import io.ktor.client.engine.HttpClientEngineFactory
1717
import io.ktor.client.engine.js.Js
1818

1919
actual class PlatformSpecificLightModelClientBuilder actual constructor() : LightModelClientBuilder() {
20-
override fun getDefaultEngineFactory(): HttpClientEngineFactory<*> = Js
20+
actual override fun getDefaultEngineFactory(): HttpClientEngineFactory<*> = Js
2121
}

light-model-client/src/jvmMain/kotlin/org/modelix/client/light/PlatformSpecificLightModelClientBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import io.ktor.client.engine.HttpClientEngineFactory
1717
import io.ktor.client.engine.cio.CIO
1818

1919
actual class PlatformSpecificLightModelClientBuilder : LightModelClientBuilder() {
20-
override fun getDefaultEngineFactory(): HttpClientEngineFactory<*> = CIO
20+
actual override fun getDefaultEngineFactory(): HttpClientEngineFactory<*> = CIO
2121
}

0 commit comments

Comments
 (0)