Refactoring: reorder IncrementalJvmCompilerRunner constructor parameters

This commit is contained in:
Alexey Tsvetkov
2016-10-13 13:44:59 +03:00
parent 3fabe6e4a7
commit 68a7d88673
2 changed files with 14 additions and 13 deletions
@@ -184,14 +184,15 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
val messageCollector = GradleMessageCollector(logger) val messageCollector = GradleMessageCollector(logger)
val compiler = IncrementalJvmCompilerRunner( val compiler = IncrementalJvmCompilerRunner(
taskBuildDirectory, taskBuildDirectory,
kaptAnnotationsFileUpdater,
artifactDifferenceRegistryProvider,
sourceAnnotationsRegistry,
getJavaSourceRoots(), getJavaSourceRoots(),
kapt2GeneratedSourcesDir,
artifactFile,
cacheVersions, cacheVersions,
reporter) reporter,
kaptAnnotationsFileUpdater,
sourceAnnotationsRegistry,
kapt2GeneratedSourcesDir,
artifactDifferenceRegistryProvider,
artifactFile
)
args.classpathAsList = classpath.toList() args.classpathAsList = classpath.toList()
args.destinationAsFile = destinationDir args.destinationAsFile = destinationDir
compiler.compile(allKotlinSources, changedFiles, args, messageCollector) compiler.compile(allKotlinSources, changedFiles, args, messageCollector)
@@ -42,14 +42,14 @@ import java.util.*
internal class IncrementalJvmCompilerRunner( internal class IncrementalJvmCompilerRunner(
workingDir: File, workingDir: File,
private var kaptAnnotationsFileUpdater: AnnotationFileUpdater?,
private val artifactDifferenceRegistryProvider: ArtifactDifferenceRegistryProvider?,
private val sourceAnnotationsRegistry: SourceAnnotationsRegistry?,
private val javaSourceRoots: Set<File>, private val javaSourceRoots: Set<File>,
private val kapt2GeneratedSourcesDir: File,
private val artifactFile: File?,
private val cacheVersions: List<CacheVersion>, private val cacheVersions: List<CacheVersion>,
private val reporter: IncReporter private val reporter: IncReporter,
private var kaptAnnotationsFileUpdater: AnnotationFileUpdater? = null,
private val sourceAnnotationsRegistry: SourceAnnotationsRegistry? = null,
private val kapt2GeneratedSourcesDir: File? = null,
private val artifactDifferenceRegistryProvider: ArtifactDifferenceRegistryProvider? = null,
private val artifactFile: File? = null
) { ) {
var anyClassesCompiled: Boolean = false var anyClassesCompiled: Boolean = false
private set private set
@@ -273,7 +273,7 @@ internal class IncrementalJvmCompilerRunner(
caches.lookupCache.update(lookupTracker, sourcesToCompile, removedKotlinSources) caches.lookupCache.update(lookupTracker, sourcesToCompile, removedKotlinSources)
val generatedJavaFiles = kapt2GeneratedSourcesDir.walk().filter { it.isJavaFile() }.toList() val generatedJavaFiles = (kapt2GeneratedSourcesDir?.walk() ?: emptySequence<File>()).filter(File::isJavaFile).toList()
val generatedJavaFilesDiff = caches.incrementalCache.compareAndUpdateFileSnapshots(generatedJavaFiles) val generatedJavaFilesDiff = caches.incrementalCache.compareAndUpdateFileSnapshots(generatedJavaFiles)
if (compilationMode is CompilationMode.Rebuild) { if (compilationMode is CompilationMode.Rebuild) {