From eaeafc7926d29f09abfba0290d5de5db045a031c Mon Sep 17 00:00:00 2001 From: Jiaxiang Chen Date: Mon, 18 Dec 2023 19:32:37 -0800 Subject: [PATCH] UPDATE_KOTLIN_VERSION: 2.0.0-dev-9013 --- build.gradle.kts | 4 ++-- .../ksp/gradle/SourceSetConfigurationsTest.kt | 17 +---------------- gradle.properties | 6 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- .../google/devtools/ksp/test/MultiplatformIT.kt | 2 ++ .../devtools/ksp/impl/KotlinSymbolProcessing.kt | 4 ++-- kotlin-analysis-api/testData/parent.kt | 2 ++ kotlin-analysis-api/testData/signatureMapper.kt | 1 + 8 files changed, 14 insertions(+), 24 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 43ba936dc5..8a31d07556 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -95,8 +95,8 @@ subprojects { } tasks.withType().configureEach { - sourceCompatibility = JavaVersion.VERSION_1_8.toString() - targetCompatibility = JavaVersion.VERSION_1_8.toString() + sourceCompatibility = JavaVersion.VERSION_11.toString() + targetCompatibility = JavaVersion.VERSION_11.toString() javaCompiler.set( javaToolchains.compilerFor { languageVersion.set(JavaLanguageVersion.of(17)) diff --git a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt index e3e74f591d..d0e45a47b3 100644 --- a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt +++ b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/SourceSetConfigurationsTest.kt @@ -180,7 +180,7 @@ class SourceSetConfigurationsTest { val baseVariant = (this as com.android.build.gradle.internal.api.BaseVariantImpl) val variantData = baseVariant::class.java.getMethod("getVariantData").invoke(baseVariant) as com.android.build.gradle.internal.variant.BaseVariantData - variantData.extraGeneratedSourceFolders.forEach { + variantData.extraGeneratedSourceFoldersOnlyInModel.forEach { println("SRC:" + it.relativeTo(buildDir).path) } variantData.allPreJavacGeneratedBytecode.forEach { @@ -238,21 +238,6 @@ class SourceSetConfigurationsTest { it.path.contains("ksp") } ).containsExactly( - SourceFolder( - "debug", "SRC:generated/ksp/debug/java" - ), - SourceFolder( - "release", "SRC:generated/ksp/release/java" - ), - SourceFolder( - "debugAndroidTest", "SRC:generated/ksp/debugAndroidTest/java" - ), - SourceFolder( - "debugUnitTest", "SRC:generated/ksp/debugUnitTest/java" - ), - SourceFolder( - "releaseUnitTest", "SRC:generated/ksp/releaseUnitTest/java" - ), SourceFolder( "debug", "SRC:generated/ksp/debug/kotlin" ), diff --git a/gradle.properties b/gradle.properties index 8c2481a015..a99ac41f33 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,15 @@ # Copied from kotlinc org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx2200m -Dfile.encoding=UTF-8 -kotlinBaseVersion=2.0.0-dev-7674 -agpBaseVersion=7.0.0 +kotlinBaseVersion=2.0.0-dev-9013 +agpBaseVersion=7.2.0 intellijVersion=213.7172.25 junitVersion=4.13.1 junit5Version=5.8.2 junitPlatformVersion=1.8.2 googleTruthVersion=1.1 -aaKotlinBaseVersion=2.0.0-dev-7674 +aaKotlinBaseVersion=2.0.0-dev-9013 aaIntellijVersion=213.7172.25 aaGuavaVersion=29.0-jre aaAsmVersion=9.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a254e..8049c684f0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/MultiplatformIT.kt b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/MultiplatformIT.kt index 6158b6807a..1ac9697745 100644 --- a/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/MultiplatformIT.kt +++ b/integration-tests/src/test/kotlin/com/google/devtools/ksp/test/MultiplatformIT.kt @@ -3,6 +3,7 @@ package com.google.devtools.ksp.test import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome import org.junit.Assert +import org.junit.Assume import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @@ -18,6 +19,7 @@ class MultiplatformIT(useKSP2: Boolean) { @Test fun testJVM() { + Assume.assumeFalse(System.getProperty("os.name").startsWith("mac", ignoreCase = true)) val gradleRunner = GradleRunner.create().withProjectDir(project.root) val resultCleanBuild = diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt index bf26044b0a..e24f67a1db 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt @@ -84,6 +84,7 @@ import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoot import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoots import org.jetbrains.kotlin.cli.common.config.kotlinSourceRoots import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCliJavaFileManagerImpl +import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreApplicationEnvironmentMode import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment import org.jetbrains.kotlin.cli.jvm.compiler.computeDefaultRootModules import org.jetbrains.kotlin.cli.jvm.compiler.createSourceFilesFromSourceRoots @@ -160,8 +161,7 @@ class KotlinSymbolProcessing( StandaloneProjectFactory.createProjectEnvironment( projectDisposable, applicationDisposable, - false, - classLoader = MockProject::class.java.classLoader + KotlinCoreApplicationEnvironmentMode.Production ) val application: Application = kotlinCoreProjectEnvironment.environment.application diff --git a/kotlin-analysis-api/testData/parent.kt b/kotlin-analysis-api/testData/parent.kt index 6bedc552a4..b6aec87d70 100644 --- a/kotlin-analysis-api/testData/parent.kt +++ b/kotlin-analysis-api/testData/parent.kt @@ -52,6 +52,8 @@ // parent of Enum: Enum<(RGB..RGB?)> // parent of Enum<(RGB..RGB?)>: RGB // parent of RGB: File: B.java +// parent of RGB: synthetic constructor for RGB +// parent of synthetic constructor for RGB: RGB // parent of R: RGB // parent of G: RGB // parent of B: RGB diff --git a/kotlin-analysis-api/testData/signatureMapper.kt b/kotlin-analysis-api/testData/signatureMapper.kt index 5b69ff8e24..c5a976646d 100644 --- a/kotlin-analysis-api/testData/signatureMapper.kt +++ b/kotlin-analysis-api/testData/signatureMapper.kt @@ -29,6 +29,7 @@ // intParam: I // : (I)V // LJavaEnum; +// : ()V // VAL1: LJavaEnum; // VAL2: LJavaEnum; // DEFAULT: LJavaEnum;