Add KotlinCompile.androidLayoutResources input
This input is used by 'android-extensions' subplugin to track changed Android layout resource files. ^KT-32805 In Progress
This commit is contained in:
committed by
teamcity
parent
f81e49f210
commit
6ee503f2b2
+3
@@ -125,6 +125,9 @@ abstract class KaptGenerateStubsTask @Inject constructor(
|
||||
@get:Internal
|
||||
override val scriptSources: FileCollection = objectFactory.fileCollection()
|
||||
|
||||
@get:Internal
|
||||
override val androidLayoutResources: FileCollection = objectFactory.fileCollection()
|
||||
|
||||
override val incrementalProps: List<FileCollection>
|
||||
get() = listOf(
|
||||
sources,
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ class AndroidSubplugin : KotlinCompilerPluginSupportPlugin {
|
||||
)
|
||||
)
|
||||
kotlinCompilation.compileKotlinTaskProvider.configure {
|
||||
it.setSource(getLayoutDirectories(project, sourceSet.res.srcDirs))
|
||||
it.androidLayoutResourceFiles.from(getLayoutDirectories(project, sourceSet.res.srcDirs))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+17
@@ -743,6 +743,7 @@ abstract class KotlinCompile @Inject constructor(
|
||||
sources,
|
||||
javaSources,
|
||||
scriptSources,
|
||||
androidLayoutResources,
|
||||
commonSourceSet,
|
||||
classpathSnapshotProperties.classpath,
|
||||
classpathSnapshotProperties.classpathSnapshot
|
||||
@@ -987,6 +988,22 @@ abstract class KotlinCompile @Inject constructor(
|
||||
.matching(::javaFilesPatternFilter)
|
||||
)
|
||||
|
||||
@get:Internal
|
||||
internal val androidLayoutResourceFiles = objectFactory.fileCollection()
|
||||
|
||||
/**
|
||||
* This input is used by android-extensions plugin
|
||||
*/
|
||||
@get:Incremental
|
||||
@get:InputFiles
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
internal open val androidLayoutResources: FileCollection = androidLayoutResourceFiles
|
||||
.asFileTree
|
||||
.matching { patternFilterable ->
|
||||
patternFilterable.include("xml".fileExtensionCasePermutations().map { "**/*.$it" })
|
||||
}
|
||||
|
||||
// override setSource to track Java and script sources as well
|
||||
override fun setSource(source: Any) {
|
||||
javaSourceFiles.from(source)
|
||||
|
||||
Reference in New Issue
Block a user