Skip to content

Commit

Permalink
Rename ksp.useK2 to ksp.useKSP2
Browse files Browse the repository at this point in the history
  • Loading branch information
ting-yuan committed Oct 31, 2023
1 parent fb283ff commit 85c5005
Show file tree
Hide file tree
Showing 31 changed files with 101 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class KspGradleSubplugin @Inject internal constructor(private val registry: Tool
val isIncremental = project.findProperty("ksp.incremental")?.toString()?.toBoolean() ?: true
val isIntermoduleIncremental =
(project.findProperty("ksp.incremental.intermodule")?.toString()?.toBoolean() ?: true) && isIncremental
val useKSP2 = project.findProperty("ksp.useK2")?.toString()?.toBoolean() ?: false
val useKSP2 = project.findProperty("ksp.useKSP2")?.toString()?.toBoolean() ?: false

// Create and configure KSP tasks.
val kspTaskProvider = when (kotlinCompilation.platformType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class AGP741IT(useK2: Boolean) {
class AGP741IT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", useK2)
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", useKSP2)

@Test
fun testDependencyResolutionCheck() {
Expand All @@ -43,7 +43,7 @@ class AGP741IT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class AndroidIT(useK2: Boolean) {
class AndroidIT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("playground-android", "playground", useK2)
val project: TemporaryTestProject = TemporaryTestProject("playground-android", "playground", useKSP2)

@Test
fun testPlaygroundAndroid() {
Expand All @@ -37,7 +37,7 @@ class AndroidIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class AndroidIncrementalIT(useK2: Boolean) {
class AndroidIncrementalIT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", useK2)
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", useKSP2)

private fun testWithExtraFlags(vararg extras: String) {
val gradleRunner = GradleRunner.create().withProjectDir(project.root)
Expand Down Expand Up @@ -76,7 +76,7 @@ class AndroidIncrementalIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class BuildCacheIT(useK2: Boolean) {
class BuildCacheIT(useKSP2: Boolean) {
@Rule
@JvmField
val project1: TemporaryTestProject = TemporaryTestProject("buildcache", "playground", useK2)
val project1: TemporaryTestProject = TemporaryTestProject("buildcache", "playground", useKSP2)

@Rule
@JvmField
val project2: TemporaryTestProject = TemporaryTestProject("buildcache", "playground", useK2)
val project2: TemporaryTestProject = TemporaryTestProject("buildcache", "playground", useKSP2)

@Test
fun testBuildCache() {
Expand All @@ -44,7 +44,7 @@ class BuildCacheIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class GeneratedRefsIncIT(val useK2: Boolean) {
class GeneratedRefsIncIT(val useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("refs-gen", "test-processor", useK2)
val project: TemporaryTestProject = TemporaryTestProject("refs-gen", "test-processor", useKSP2)

@Test
fun testGeneratedRefsInc() {
Assume.assumeFalse(useK2)
Assume.assumeFalse(useKSP2)
val gradleRunner = GradleRunner.create().withProjectDir(project.root)

val expected = listOf(
Expand Down Expand Up @@ -74,7 +74,7 @@ class GeneratedRefsIncIT(val useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class GeneratedSrcsIncIT(useK2: Boolean) {
class GeneratedSrcsIncIT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("srcs-gen", "test-processor", useK2)
val project: TemporaryTestProject = TemporaryTestProject("srcs-gen", "test-processor", useKSP2)

@Test
fun testGeneratedSrcsInc() {
Expand All @@ -37,7 +37,7 @@ class GeneratedSrcsIncIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class GetSealedSubclassesIncIT(val useK2: Boolean) {
class GetSealedSubclassesIncIT(val useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("sealed-subclasses", "test-processor", useK2)
val project: TemporaryTestProject = TemporaryTestProject("sealed-subclasses", "test-processor", useKSP2)

@Test
fun testGetSealedSubclassesInc() {
Assume.assumeFalse(useK2)
Assume.assumeFalse(useKSP2)
val gradleRunner = GradleRunner.create().withProjectDir(project.root)

val expected2 = listOf(
Expand Down Expand Up @@ -61,7 +61,7 @@ class GetSealedSubclassesIncIT(val useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import org.junit.runner.RunWith
import org.junit.runners.Parameterized

@RunWith(Parameterized::class)
class HmppIT(val useK2: Boolean) {
class HmppIT(val useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("hmpp", useK2 = useK2)
val project: TemporaryTestProject = TemporaryTestProject("hmpp", useKSP2 = useKSP2)

val taskToFilesTraditional = mapOf(
":workload:kspCommonMainKotlinMetadata" to "w: [ksp] EchoProcessor: CommonMain",
Expand Down Expand Up @@ -72,7 +72,7 @@ class HmppIT(val useK2: Boolean) {
@Ignore
@Test
fun testHmpp() {
Assume.assumeFalse(useK2)
Assume.assumeFalse(useKSP2)
Assume.assumeFalse(System.getProperty("os.name").startsWith("Windows", ignoreCase = true))
val gradleRunner = GradleRunner.create().withProjectDir(project.root)

Expand All @@ -91,7 +91,7 @@ class HmppIT(val useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class IncrementalCPIT(val useK2: Boolean) {
class IncrementalCPIT(val useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("incremental-classpath", useK2 = useK2)
val project: TemporaryTestProject = TemporaryTestProject("incremental-classpath", useKSP2 = useKSP2)

val src2Dirty = listOf(
"l1/src/main/kotlin/p1/L1.kt" to setOf(
Expand Down Expand Up @@ -43,7 +43,7 @@ class IncrementalCPIT(val useK2: Boolean) {

@Test
fun testCPChanges() {
Assume.assumeFalse(useK2)
Assume.assumeFalse(useKSP2)
val gradleRunner = GradleRunner.create().withProjectDir(project.root)

gradleRunner.withArguments("clean", "assemble").build().let { result ->
Expand Down Expand Up @@ -135,7 +135,7 @@ class IncrementalCPIT(val useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class IncrementalIT(val useK2: Boolean) {
class IncrementalIT(val useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("incremental", useK2 = useK2)
val project: TemporaryTestProject = TemporaryTestProject("incremental", useKSP2 = useKSP2)

val src2Dirty = listOf(
"workload/src/main/java/p1/J1.java" to setOf(
Expand Down Expand Up @@ -95,7 +95,7 @@ class IncrementalIT(val useK2: Boolean) {

@Test
fun testIsolating() {
Assume.assumeFalse(useK2)
Assume.assumeFalse(useKSP2)
val gradleRunner = GradleRunner.create().withProjectDir(project.root)

gradleRunner.withArguments("clean", "assemble").build().let { result ->
Expand Down Expand Up @@ -141,7 +141,7 @@ class IncrementalIT(val useK2: Boolean) {

@Test
fun testMultipleChanges() {
Assume.assumeFalse(useK2)
Assume.assumeFalse(useKSP2)
val gradleRunner = GradleRunner.create().withProjectDir(project.root)

gradleRunner.withArguments("clean", "assemble").build().let { result ->
Expand Down Expand Up @@ -268,7 +268,7 @@ class IncrementalIT(val useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class IncrementalMultiChainIT(useK2: Boolean) {
class IncrementalMultiChainIT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("incremental-multi-chain", useK2 = useK2)
val project: TemporaryTestProject = TemporaryTestProject("incremental-multi-chain", useKSP2 = useKSP2)

@Test
fun testMultiChain() {
Expand Down Expand Up @@ -55,7 +55,7 @@ class IncrementalMultiChainIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class IncrementalRemovalIT(useK2: Boolean) {
class IncrementalRemovalIT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("incremental-removal", useK2 = useK2)
val project: TemporaryTestProject = TemporaryTestProject("incremental-removal", useKSP2 = useKSP2)

@Test
fun testRemoveOutputs() {
Expand All @@ -38,7 +38,7 @@ class IncrementalRemovalIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import java.io.File
import java.util.jar.JarFile

@RunWith(Parameterized::class)
class InitPlusProviderIT(useK2: Boolean) {
class InitPlusProviderIT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("init-plus-provider", useK2 = useK2)
val project: TemporaryTestProject = TemporaryTestProject("init-plus-provider", useKSP2 = useKSP2)

@Test
fun testInitPlusProvider() {
Expand All @@ -36,7 +36,7 @@ class InitPlusProviderIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import org.junit.runner.RunWith
import org.junit.runners.Parameterized

@RunWith(Parameterized::class)
class JavaNestedClassIT(useK2: Boolean) {
class JavaNestedClassIT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("javaNestedClass", useK2 = useK2)
val project: TemporaryTestProject = TemporaryTestProject("javaNestedClass", useKSP2 = useKSP2)

@Test
fun testJavaNestedClass() {
Expand All @@ -25,7 +25,7 @@ class JavaNestedClassIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import org.junit.runners.Parameterized
import java.io.File

@RunWith(Parameterized::class)
class JavaOnlyIT(useK2: Boolean) {
class JavaOnlyIT(useKSP2: Boolean) {
@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("java-only", "test-processor", useK2 = useK2)
val project: TemporaryTestProject = TemporaryTestProject("java-only", "test-processor", useKSP2 = useKSP2)

@Test
fun testJavaOnly() {
Expand All @@ -37,7 +37,7 @@ class JavaOnlyIT(useK2: Boolean) {

companion object {
@JvmStatic
@Parameterized.Parameters(name = "K2={0}")
@Parameterized.Parameters(name = "KSP2={0}")
fun params() = listOf(arrayOf(true), arrayOf(false))
}
}
Loading

0 comments on commit 85c5005

Please sign in to comment.