Merge branch 'master' into KT-18765

This commit is contained in:
Andrey Mischenko
2017-10-04 17:43:11 +08:00
committed by GitHub
1030 changed files with 14609 additions and 3982 deletions
@@ -80,7 +80,7 @@ jar.dependsOn agp25Classes
jar {
from compileGroovy.destinationDir
from sourceSets.agp25.output.classesDir
from sourceSets.agp25.output.classesDirs
manifestAttributes(manifest, project)
}
@@ -36,5 +36,7 @@ internal class GradleIncrementalCompilerEnvironment(
compilerArgs: CommonCompilerArguments,
val kaptAnnotationsFileUpdater: AnnotationFileUpdater? = null,
val artifactDifferenceRegistryProvider: ArtifactDifferenceRegistryProvider? = null,
val artifactFile: File? = null
val artifactFile: File? = null,
val buildHistoryFile: File? = null,
val friendBuildHistoryFile: File? = null
) : GradleCompilerEnvironment(compilerClasspath, messageCollector, outputItemsCollector, compilerArgs)
@@ -255,7 +255,9 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
reportSeverity = reportSeverity(verbose),
requestedCompilationResults = arrayOf(CompilationResultCategory.IC_COMPILE_ITERATION.code),
compilerMode = CompilerMode.INCREMENTAL_COMPILER,
targetPlatform = targetPlatform
targetPlatform = targetPlatform,
resultDifferenceFile = environment.buildHistoryFile,
friendDifferenceFile = environment.friendBuildHistoryFile
)
val servicesFacade = GradleIncrementalCompilerServicesFacadeImpl(project, environment)
val argsArray = ArgumentUtils.convertArgumentsToStringList(environment.compilerArgs).toTypedArray()
@@ -243,6 +243,7 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
internal open val sourceRootsContainer = FilteringSourceRootsContainer()
private var kaptAnnotationsFileUpdater: AnnotationFileUpdater? = null
val buildHistoryFile: File = File(taskBuildDirectory, "build-history.bin")
val kaptOptions = KaptOptions()
@@ -316,10 +317,13 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
!incremental -> GradleCompilerEnvironment(computedCompilerClasspath, messageCollector, outputItemCollector, args)
else -> {
logger.info(USING_INCREMENTAL_COMPILATION_MESSAGE)
val friendTask = friendTaskName?.let { project.tasks.findByName(it) as? KotlinCompile }
GradleIncrementalCompilerEnvironment(computedCompilerClasspath, changedFiles, reporter, taskBuildDirectory,
messageCollector, outputItemCollector, args, kaptAnnotationsFileUpdater,
artifactDifferenceRegistryProvider,
artifactFile)
artifactFile = artifactFile,
buildHistoryFile = buildHistoryFile,
friendBuildHistoryFile = friendTask?.buildHistoryFile)
}
}
@@ -453,7 +457,7 @@ open class Kotlin2JsCompile() : AbstractKotlinCompile<K2JSCompilerArguments>(),
args.friendModules = friendDependency
args.sourceMapSourceRoots = source.orEmpty()
args.sourceMapBaseDirs = source.orEmpty()
.asSequence()
.filterIsInstance<SourceDirectorySet>()
.flatMap { it.srcDirs.asSequence() }