Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to 17 #2682

Merged
merged 15 commits into from
Jan 3, 2025
1 change: 1 addition & 0 deletions .github/workflows/graalvm-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ jobs:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}

Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ abstract class OpenApiSystemPropertyOverride implements CommandLineArgumentProvi
Iterable<String> asArguments() {
["-Dmicronaut.openapi.config.file=${openApiPropertiesFile.asFile.get().absolutePath}".toString()]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,3 @@ dependencies {
exclude group: "org.apache.groovy", module: "groovy-all"
}
}
java {
sourceCompatibility = JavaVersion.toVersion("21")
targetCompatibility = JavaVersion.toVersion("21")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ plugins {
id "io.micronaut.internal.starter.base-module"
id "io.micronaut.build.internal.publishing"
}
java {
sourceCompatibility = JavaVersion.toVersion("17")
targetCompatibility = JavaVersion.toVersion("17")
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
1 change: 1 addition & 0 deletions starter-aws-lambda/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ graalvmNative {

tasks.named("dockerfileNative") {
jdkVersion = "21"
baseImage = "amazonlinux:2023"
sdelamo marked this conversation as resolved.
Show resolved Hide resolved
args(
"-XX:MaximumHeapSizePercent=80",
"-Dio.netty.allocator.numDirectArenas=0",
Expand Down
2 changes: 1 addition & 1 deletion starter-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ application {
}

rocker {
javaVersion = '21'
javaVersion = '17'
postProcessing = ['io.micronaut.starter.rocker.WhitespaceProcessor']
}

Expand Down
4 changes: 2 additions & 2 deletions starter-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.micronaut.internal.starter.tasks.WriteMicronautVersionInfoTask

plugins {
id "io.micronaut.internal.starter.published-module"
id("io.micronaut.internal.starter.published-module")
id "io.micronaut.internal.starter.convention"
id "io.micronaut.starter.rocker"
id "io.micronaut.internal.starter.coordinates"
Expand Down Expand Up @@ -50,6 +50,6 @@ TaskProvider<WriteMicronautVersionInfoTask> micronautVersionInfo = tasks.registe
sourceSets.main.resources.srcDir(micronautVersionInfo)

rocker {
javaVersion = '21'
javaVersion = '17'
postProcessing = ['io.micronaut.starter.rocker.WhitespaceProcessor']
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import io.micronaut.starter.options.JdkVersion
import io.micronaut.starter.options.Language
import io.micronaut.starter.options.Options
import io.micronaut.starter.options.TestFramework
import spock.lang.Ignore
import spock.lang.Shared
import spock.lang.Subject

Expand Down Expand Up @@ -147,15 +146,14 @@ class KaptSpec extends ApplicationContextSpec implements CommandOutputFixture {
output.".mvn/jvm.config" == KotlinSupportFeature.JDK_21_KAPT_MODULES
}

@Ignore
void 'Corrected jdk21 = jdk17 is specified in build = #buildTool for kapt'(BuildTool buildTool) {
when:
def output = generate(ApplicationType.DEFAULT, new Options(Language.KOTLIN, TestFramework.DEFAULT_OPTION, buildTool, JdkVersion.JDK_21),['kapt'])
def buildFile = buildTool == BuildTool.GRADLE ? output["build.gradle"] : output["build.gradle.kts"]
Map<String, String> output = generate(ApplicationType.DEFAULT, new Options(Language.KOTLIN, TestFramework.DEFAULT_OPTION, buildTool, JdkVersion.JDK_21),['kapt'])
String buildFile = buildTool == BuildTool.GRADLE ? output["build.gradle"] : output["build.gradle.kts"]

then:
buildFile
buildFile.contains('sourceCompatibility = JavaVersion.toVersion("17")')
buildFile.contains('sourceCompatibility = JavaVersion.toVersion("21")')
!buildFile.contains('targetCompatibility = JavaVersion.toVersion("17")')
!buildFile.contains('targetCompatibility = JavaVersion.toVersion("21")')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import io.micronaut.starter.options.BuildTool
import io.micronaut.starter.options.JdkVersion
import io.micronaut.starter.options.Language
import io.micronaut.starter.options.TestFramework
import spock.lang.Ignore
import spock.lang.Issue

class SpockSpec extends ApplicationContextSpec {
Expand Down Expand Up @@ -78,8 +77,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
Language.JAVA | TestFramework.KOTEST
}

@Ignore
void 'With #language, #testFramework and #jdk and kapt we use the kotlin toolchain for JDK17'() {
void 'With #language, #testFramework and #jdk and kapt we use the kotlin toolchain for JDK17'(Language language, TestFramework testFramework, JdkVersion jdk) {
when:
String template = new BuildBuilder(beanContext, BuildTool.GRADLE)
.language(language)
Expand All @@ -89,20 +87,35 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
.render()

then:
template.contains('sourceCompatibility = JavaVersion.toVersion("17")')
template.contains('sourceCompatibility = JavaVersion.toVersion("' + jdk.majorVersion() + '")')

template.contains('''\
if (jdk.majorVersion() == 17) {
assert template.contains('''\
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}''')
!template.contains('''\
assert !template.contains('''\
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}''')
} else if (jdk.majorVersion() == 21) {
assert template.contains('''\
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}''')
assert !template.contains('''\
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21
}
}''')
}

where:
language | testFramework | jdk
Expand Down
2 changes: 1 addition & 1 deletion test-features/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ sourceSets {
}

rocker {
javaVersion = '21'
javaVersion = '17'
postProcessing = ['io.micronaut.starter.rocker.WhitespaceProcessor']
}
Loading