Kapt, Refactoring: Introduce 'KaptOptions'
1. Use 'KaptOptions' for all kapt options, including paths and flags. 2. Use a single 'KAPT_OPTIONS' compiler configuration key for setting all options (using a mutable KaptOptions.Builder). 3. Pass 'KaptOptions' instead of separate flags. 4. Remove 'KaptPaths'. 5. Remove deprecated 'aptOnly' CLI option.
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
package org.jetbrains.kotlin.kapt.base.test
|
||||
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.kapt3.base.KaptPaths
|
||||
import org.jetbrains.kotlin.base.kapt3.KaptOptions
|
||||
import org.jetbrains.kotlin.base.kapt3.collectJavaSourceFiles
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
@@ -36,16 +37,12 @@ class KaptPathsTest : TestCase() {
|
||||
|
||||
val javaRoots = listOf(simpleJava, symlinkToOtherJava, symlinkToNotJava, symlinkToJavaRootDir, javaRootDir)
|
||||
|
||||
val paths = KaptPaths(
|
||||
projectBaseDir = null,
|
||||
compileClasspath = emptyList(),
|
||||
annotationProcessingClasspath = emptyList(),
|
||||
javaSourceRoots = javaRoots,
|
||||
sourcesOutputDir = outputDir,
|
||||
classFilesOutputDir = outputDir,
|
||||
stubsOutputDir = outputDir,
|
||||
incrementalDataOutputDir = null
|
||||
)
|
||||
val paths = KaptOptions.Builder().apply {
|
||||
javaSourceRoots.addAll(javaRoots)
|
||||
sourcesOutputDir = outputDir
|
||||
classesOutputDir = outputDir
|
||||
stubsOutputDir = outputDir
|
||||
}.build()
|
||||
|
||||
val javaSourceFiles = paths.collectJavaSourceFiles()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user