cedric
03/01/2017, 3:19 PMilya.chernikov
03/01/2017, 3:30 PMcedric
03/01/2017, 3:39 PMilya.chernikov
03/01/2017, 4:02 PMalexey.tsvetkov
03/01/2017, 4:56 PM// Trivial imports are omitted
import org.jetbrains.kotlin.incremental.makeIncrementally
// This dir will be used for as IC caches' root,
// so it should persist between builds;
// Removing this dir forces rebuild
val chachesDir = File("build/ic-caches")
// Iterable of Java and Kotlin source roots
val sourceRoots = listOf(File("src/kotlin"), File("src/java"))
val args = K2JVMCompilerArguments()
// Output dir
args.destination = "build/classes"
args.moduleName = "someModule"
// Compile-classpath
args.classpath = compileClasspath
// Some other collector should probably be used
val messageCollector = MessageCollector.NONE
makeIncrementally(cachesDir, sourceRoots, args, messageCollector)
That should handle all cases our Gradle IC handles except classpath changes and multi-module IC. The underlying implementation is the same and the same tests are used.