Skip to content

Commit 70dad15

Browse files
Goooleregorikftp
andauthored
Bump target IDEA version to 2024.2 (#104)
* Use Java 21 and bump min IDEA requirement * Update tests * Migrate to IDEA 2024.2 (242), exclude 3rd party library coroutines * Update configuration --------- Co-authored-by: Yahor Urbanovich <yahor_urbanovich@epam.com>
1 parent 9b8472b commit 70dad15

9 files changed

Lines changed: 39 additions & 31 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/setup-java@v4
2929
with:
3030
distribution: temurin
31-
java-version: 17
31+
java-version: 21
3232

3333
- name: Prepare release name
3434
run: |

.github/workflows/validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions/setup-java@v4
4040
with:
4141
distribution: temurin
42-
java-version: 17
42+
java-version: 21
4343

4444
- uses: gradle/actions/setup-gradle@v4
4545
with:

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ allprojects {
3434
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#setting-up-intellij-platform
3535
dependencies {
3636
extensions.configure<IntelliJPlatformDependenciesExtension> {
37-
intellijIdeaCommunity("2024.1")
37+
intellijIdeaCommunity("2024.2")
3838
bundledPlugin("org.jetbrains.kotlin")
3939
}
4040
}

cli/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ application {
1414
version = versionName
1515
}
1616

17+
java {
18+
sourceCompatibility = JavaVersion.VERSION_21
19+
targetCompatibility = JavaVersion.VERSION_21
20+
}
21+
1722
sourceSets {
1823
test {
1924
resources {

components/parser/ktfile/build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ sourceSets {
1414
}
1515
}
1616

17+
configurations {
18+
implementation {
19+
exclude(group = "org.jetbrains.kotlinx")
20+
}
21+
}
22+
1723
dependencies {
1824
implementation(projects.components.extensions)
1925
implementation(projects.components.irCompose)
2026
implementation(projects.components.psi.imagevector)
2127

22-
implementation(compose.material3)
2328
implementation(compose.ui)
29+
implementation(libs.material.icons.core)
2430

2531
testImplementation(libs.bundles.test)
2632
testRuntimeOnly(libs.junit.launcher)

components/parser/ktfile/src/test/kotlin/io/github/composegears/valkyrie/parser/ktfile/KtFileToImageVectorParserTest.kt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import androidx.compose.ui.graphics.vector.path
1616
import androidx.compose.ui.unit.dp
1717
import assertk.assertThat
1818
import assertk.assertions.isEqualTo
19-
import com.intellij.openapi.application.invokeAndWaitIfNeeded
2019
import com.intellij.openapi.project.Project
2120
import com.intellij.testFramework.ProjectExtension
21+
import com.intellij.testFramework.runInEdtAndGet
2222
import io.github.composegears.valkyrie.parser.ktfile.common.ParseType
2323
import io.github.composegears.valkyrie.parser.ktfile.common.createKtFile
2424
import io.github.composegears.valkyrie.parser.ktfile.common.toKtFile
@@ -27,7 +27,6 @@ import org.junit.jupiter.api.extension.RegisterExtension
2727
import org.junit.jupiter.params.ParameterizedTest
2828
import org.junit.jupiter.params.provider.EnumSource
2929

30-
@Suppress("UnstableApiUsage")
3130
class KtFileToImageVectorParserTest {
3231

3332
companion object {
@@ -40,7 +39,7 @@ class KtFileToImageVectorParserTest {
4039

4140
@ParameterizedTest
4241
@EnumSource(value = ParseType::class)
43-
fun `empty image vector`(parseType: ParseType) = invokeAndWaitIfNeeded {
42+
fun `empty image vector`(parseType: ParseType) = runInEdtAndGet {
4443
val ktFile = parseType.toKtFile(
4544
project = project,
4645
pathToLazy = "lazy/EmptyImageVector.kt",
@@ -62,7 +61,7 @@ class KtFileToImageVectorParserTest {
6261

6362
@ParameterizedTest
6463
@EnumSource(value = ParseType::class)
65-
fun `empty paths`(parseType: ParseType) = invokeAndWaitIfNeeded {
64+
fun `empty paths`(parseType: ParseType) = runInEdtAndGet {
6665
val ktFile = parseType.toKtFile(
6766
project = project,
6867
pathToLazy = "lazy/EmptyPaths.kt",
@@ -87,7 +86,7 @@ class KtFileToImageVectorParserTest {
8786

8887
@ParameterizedTest
8988
@EnumSource(value = ParseType::class)
90-
fun `parse all path params`(parseType: ParseType) = invokeAndWaitIfNeeded {
89+
fun `parse all path params`(parseType: ParseType) = runInEdtAndGet {
9190
val ktFile = parseType.toKtFile(
9291
project = project,
9392
pathToLazy = "lazy/AllPathParams.kt",
@@ -142,7 +141,7 @@ class KtFileToImageVectorParserTest {
142141
}
143142

144143
@Test
145-
fun `parse material icon`() = invokeAndWaitIfNeeded {
144+
fun `parse material icon`() = runInEdtAndGet {
146145
val ktFile = project.createKtFile(from = "backing/MaterialIcon.kt")
147146
val imageVector = KtFileToImageVectorParser.parse(ktFile)
148147

@@ -162,7 +161,7 @@ class KtFileToImageVectorParserTest {
162161

163162
@ParameterizedTest
164163
@EnumSource(value = ParseType::class)
165-
fun `parse icon with group`(parseType: ParseType) = invokeAndWaitIfNeeded {
164+
fun `parse icon with group`(parseType: ParseType) = runInEdtAndGet {
166165
val ktFile = parseType.toKtFile(
167166
project = project,
168167
pathToLazy = "lazy/IconWithGroup.kt",
@@ -206,7 +205,7 @@ class KtFileToImageVectorParserTest {
206205

207206
@ParameterizedTest
208207
@EnumSource(value = ParseType::class)
209-
fun `parse icon with linear and radial gradient`(parseType: ParseType) = invokeAndWaitIfNeeded {
208+
fun `parse icon with linear and radial gradient`(parseType: ParseType) = runInEdtAndGet {
210209
val ktFile = parseType.toKtFile(
211210
project = project,
212211
pathToLazy = "lazy/IconWithGradient.kt",
@@ -277,7 +276,7 @@ class KtFileToImageVectorParserTest {
277276

278277
@ParameterizedTest
279278
@EnumSource(value = ParseType::class)
280-
fun `parse single path property`(parseType: ParseType) = invokeAndWaitIfNeeded {
279+
fun `parse single path property`(parseType: ParseType) = runInEdtAndGet {
281280
val ktFile = parseType.toKtFile(
282281
project = project,
283282
pathToLazy = "lazy/SinglePath.kt",
@@ -315,7 +314,7 @@ class KtFileToImageVectorParserTest {
315314

316315
@ParameterizedTest
317316
@EnumSource(value = ParseType::class)
318-
fun `parse all group params`(parseType: ParseType) = invokeAndWaitIfNeeded {
317+
fun `parse all group params`(parseType: ParseType) = runInEdtAndGet {
319318
val ktFile = parseType.toKtFile(
320319
project = project,
321320
pathToLazy = "imagevector/kt/lazy/AllGroupParams.kt",
@@ -385,7 +384,7 @@ class KtFileToImageVectorParserTest {
385384

386385
@ParameterizedTest
387386
@EnumSource(value = ParseType::class)
388-
fun `parse gradient with clip path`(parseType: ParseType) = invokeAndWaitIfNeeded {
387+
fun `parse gradient with clip path`(parseType: ParseType) = runInEdtAndGet {
389388
val ktFile = parseType.toKtFile(
390389
project = project,
391390
pathToLazy = "imagevector/kt//lazy/ClipPathGradient.kt",
@@ -528,7 +527,7 @@ class KtFileToImageVectorParserTest {
528527

529528
@ParameterizedTest
530529
@EnumSource(value = ParseType::class)
531-
fun `parse compose color`(parseType: ParseType) = invokeAndWaitIfNeeded {
530+
fun `parse compose color`(parseType: ParseType) = runInEdtAndGet {
532531
val ktFile = parseType.toKtFile(
533532
project = project,
534533
pathToLazy = "imagevector/kt/lazy/ComposeColor.kt",

components/psi/iconpack/src/test/kotlin/io/github/composegears/valkyrie/psi/iconpack/IconPackPsiParserTest.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import assertk.assertThat
44
import assertk.assertions.containsExactly
55
import assertk.assertions.isEqualTo
66
import assertk.assertions.isNotNull
7-
import com.intellij.openapi.application.invokeAndWaitIfNeeded
87
import com.intellij.openapi.project.Project
98
import com.intellij.testFramework.ProjectExtension
9+
import com.intellij.testFramework.runInEdtAndGet
1010
import io.github.composegears.valkyrie.extensions.ResourceUtils.getResourcePath
1111
import org.junit.jupiter.api.Test
1212
import org.junit.jupiter.api.extension.RegisterExtension
1313

14-
@Suppress("UnstableApiUsage")
1514
class IconPackPsiParserTest {
1615

1716
companion object {
@@ -26,7 +25,7 @@ class IconPackPsiParserTest {
2625
fun `simple icon pack parser`() {
2726
val path = getResourcePath("SimpleIconPack.kt")
2827

29-
invokeAndWaitIfNeeded {
28+
runInEdtAndGet {
3029
val iconPackInfo = IconPackPsiParser.extractIconPack(path, project)
3130

3231
assertThat(iconPackInfo).isNotNull().transform { packInfo ->
@@ -41,7 +40,7 @@ class IconPackPsiParserTest {
4140
fun `nested icon pack parser`() {
4241
val path = getResourcePath("NestedIconPack.kt")
4342

44-
invokeAndWaitIfNeeded {
43+
runInEdtAndGet {
4544
val iconPackInfo = IconPackPsiParser.extractIconPack(path, project)
4645

4746
assertThat(iconPackInfo).isNotNull().transform { packInfo ->
@@ -57,7 +56,7 @@ class IconPackPsiParserTest {
5756
fun `data object icon pack parser`() {
5857
val path = getResourcePath("DataObjectIconPack.kt")
5958

60-
invokeAndWaitIfNeeded {
59+
runInEdtAndGet {
6160
val iconPackInfo = IconPackPsiParser.extractIconPack(path, project)
6261

6362
assertThat(iconPackInfo).isNotNull().transform { packInfo ->

gradle/libs.versions.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
[versions]
2+
compose = "1.7.3"
23
intellij = "2.5.0"
34
kotlin = "2.1.20"
45

56
[libraries]
67
android-build-tools = "com.android.tools:sdk-common:31.9.2"
7-
88
highlights = "dev.snipme:highlights:1.0.0"
9-
109
kotlinpoet = "com.squareup:kotlinpoet:2.1.0"
11-
1210
leviathan = "io.github.composegears:leviathan:2.0.0"
1311
leviathan-compose = "io.github.composegears:leviathan-compose:2.0.0"
14-
12+
material-icons-core = { module = "org.jetbrains.compose.material:material-icons-core", version.ref = "compose" }
1513
tiamat = "io.github.composegears:tiamat:1.5.0"
16-
1714
xpp3 = "org.ogce:xpp3:1.1.6"
1815

1916
clikt = "com.github.ajalt.clikt:clikt:5.0.3"
@@ -36,7 +33,7 @@ kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", v
3633
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
3734
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
3835
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
39-
jetbrains-compose = "org.jetbrains.compose:1.7.3"
36+
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose" }
4037
jetbrains-intellij = { id = "org.jetbrains.intellij.platform", version.ref = "intellij" }
4138
jetbrains-intellij-module = { id = "org.jetbrains.intellij.platform.module", version.ref = "intellij" }
4239
buildConfig = "com.github.gmazzo.buildconfig:5.6.4"

idea-plugin/build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ intellijPlatform {
5050
buildSearchableOptions = false
5151
projectName = "valkyrie-plugin"
5252
pluginConfiguration.ideaVersion {
53-
sinceBuild = "241"
53+
sinceBuild = "242"
5454
untilBuild = provider { null }
5555
}
5656
pluginVerification {
@@ -66,7 +66,7 @@ intellijPlatform {
6666
FailureLevel.NOT_DYNAMIC,
6767
)
6868
ides {
69-
ide(IntelliJPlatformType.IntellijIdeaCommunity, "2024.1.6")
69+
ide(IntelliJPlatformType.IntellijIdeaCommunity, "2024.2.4")
7070
ide(IntelliJPlatformType.IntellijIdeaCommunity, "2025.1")
7171
}
7272
}
@@ -82,8 +82,10 @@ intellijPlatform {
8282
}
8383

8484
java {
85-
// IDEA 2024.1 requires Java 17.
86-
toolchain.languageVersion = JavaLanguageVersion.of(17)
85+
// IDEA 2024.2 or above requires Java 21.
86+
// https://plugins.jetbrains.com/docs/intellij/api-changes-list-2024.html
87+
sourceCompatibility = JavaVersion.VERSION_21
88+
targetCompatibility = JavaVersion.VERSION_21
8789
}
8890

8991
tasks {

0 commit comments

Comments
 (0)