Skip to content

Commit 9ea4e7f

Browse files
authored
Fix validation errors after updating TeamCity base image (#5587)
``` org.gradle.jvm.toolchain.internal.install.exceptions.ToolchainProvisioningException: Cannot find a Java installation on your machine (Linux 5.15.0-1084-aws amd64) matching: {languageVersion=17, vendor=any vendor, implementation=vendor-specific}. Some toolchain resolvers had internal failures: foojay (Requesting vendor list failed: { "result":[], "message":"There was an internal error and the pkg cache is currently be restored, please try again later" }). ``` - Use `jvmTarget` instead of `jvmToolchain` to build the project without JDK 17 installed (only with JDK 21) - Update `org.gradle.toolchains.foojay-resolver-convention` to a stable version ## Release Notes N/A
1 parent 40b0b0f commit 9ea4e7f

21 files changed

Lines changed: 139 additions & 45 deletions

File tree

ci/templates/maven-test-project/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@
9999
<artifactId>kotlin-stdlib</artifactId>
100100
<version>${kotlin.version}</version>
101101
</dependency>
102+
<dependency>
103+
<groupId>org.jetbrains.compose.runtime</groupId>
104+
<artifactId>runtime-saveable-desktop</artifactId>
105+
<version>${compose.version}</version>
106+
</dependency>
102107
<dependency>
103108
<groupId>org.jetbrains.compose.ui</groupId>
104109
<artifactId>ui-desktop</artifactId>

ci/templates/multiplatform-template/android/build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
14
plugins {
25
id("com.android.application")
36
kotlin("android")
@@ -20,8 +23,11 @@ android {
2023
sourceCompatibility = JavaVersion.VERSION_17
2124
targetCompatibility = JavaVersion.VERSION_17
2225
}
23-
kotlin {
24-
jvmToolchain(17)
26+
}
27+
28+
tasks.withType<KotlinCompile>() {
29+
compilerOptions {
30+
jvmTarget.set(JvmTarget.JVM_17)
2531
}
2632
}
2733

ci/templates/multiplatform-template/common/build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
14
plugins {
25
id("com.android.library")
36
kotlin("multiplatform")
@@ -28,6 +31,12 @@ kotlin {
2831
}
2932
}
3033

34+
tasks.withType<KotlinCompile>() {
35+
compilerOptions {
36+
jvmTarget.set(JvmTarget.JVM_17)
37+
}
38+
}
39+
3140
android {
3241
compileSdk = 35
3342
namespace = "com.myapplication.common"
@@ -39,9 +48,6 @@ android {
3948
sourceCompatibility = JavaVersion.VERSION_17
4049
targetCompatibility = JavaVersion.VERSION_17
4150
}
42-
kotlin {
43-
jvmToolchain(17)
44-
}
4551
sourceSets {
4652
named("main") {
4753
manifest.srcFile("src/androidMain/AndroidManifest.xml")

ci/templates/multiplatform-template/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencyResolutionManagement {
2525
}
2626

2727
plugins {
28-
id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0")
28+
id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0")
2929
}
3030

3131
include(":common", ":android", ":desktop")

examples/chat/androidApp/build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
14
plugins {
25
kotlin("multiplatform")
36
kotlin("plugin.compose")
@@ -16,6 +19,12 @@ kotlin {
1619
}
1720
}
1821

22+
tasks.withType<KotlinCompile>() {
23+
compilerOptions {
24+
jvmTarget.set(JvmTarget.JVM_17)
25+
}
26+
}
27+
1928
android {
2029
compileSdk = 35
2130
namespace = "org.jetbrains.chat"
@@ -30,7 +39,4 @@ android {
3039
sourceCompatibility = JavaVersion.VERSION_17
3140
targetCompatibility = JavaVersion.VERSION_17
3241
}
33-
kotlin {
34-
jvmToolchain(17)
35-
}
3642
}

examples/chat/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencyResolutionManagement {
2929
}
3030

3131
plugins {
32-
id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0")
32+
id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0")
3333
}
3434

3535
rootProject.name = "chat-mpp"

examples/chat/shared/build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@file:Suppress("OPT_IN_IS_NOT_ENABLED")
22

3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
5+
36
plugins {
47
kotlin("multiplatform")
58
kotlin("plugin.compose")
@@ -85,6 +88,12 @@ kotlin {
8588
}
8689
}
8790

91+
tasks.withType<KotlinCompile>() {
92+
compilerOptions {
93+
jvmTarget.set(JvmTarget.JVM_17)
94+
}
95+
}
96+
8897
android {
8998
compileSdk = 35
9099
namespace = "org.jetbrains.chat"
@@ -97,7 +106,4 @@ android {
97106
sourceCompatibility = JavaVersion.VERSION_17
98107
targetCompatibility = JavaVersion.VERSION_17
99108
}
100-
kotlin {
101-
jvmToolchain(17)
102-
}
103109
}

examples/codeviewer/androidApp/build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
14
plugins {
25
kotlin("multiplatform")
36
kotlin("plugin.compose")
@@ -16,6 +19,12 @@ kotlin {
1619
}
1720
}
1821

22+
tasks.withType<KotlinCompile>() {
23+
compilerOptions {
24+
jvmTarget.set(JvmTarget.JVM_17)
25+
}
26+
}
27+
1928
android {
2029
compileSdk = 35
2130
namespace = "org.jetbrains.codeviewer"
@@ -30,7 +39,4 @@ android {
3039
sourceCompatibility = JavaVersion.VERSION_17
3140
targetCompatibility = JavaVersion.VERSION_17
3241
}
33-
kotlin {
34-
jvmToolchain(17)
35-
}
3642
}

examples/codeviewer/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pluginManagement {
2323
}
2424

2525
plugins {
26-
id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0")
26+
id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0")
2727
}
2828

2929
rootProject.name = "codeviewer"

examples/codeviewer/shared/build.gradle.kts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@file:Suppress("OPT_IN_IS_NOT_ENABLED")
22

3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
5+
36
plugins {
47
kotlin("multiplatform")
58
kotlin("plugin.compose")
@@ -65,6 +68,12 @@ kotlin {
6568
}
6669
}
6770

71+
tasks.withType<KotlinCompile>() {
72+
compilerOptions {
73+
jvmTarget.set(JvmTarget.JVM_17)
74+
}
75+
}
76+
6877
android {
6978
compileSdk = 35
7079
namespace = "org.jetbrains.codeviewer.common"
@@ -76,7 +85,4 @@ android {
7685
sourceCompatibility = JavaVersion.VERSION_17
7786
targetCompatibility = JavaVersion.VERSION_17
7887
}
79-
kotlin {
80-
jvmToolchain(17)
81-
}
8288
}

0 commit comments

Comments
 (0)