Ignore empty directories on input properties hash calculation.
Annotate all '@InputFiles' and '@InputDirectory' input properties with '@IgnoreEmptyDirectories' annotation, so empty directories will be excluded from input hash calculation. ^KT-27687 Fixed
This commit is contained in:
-1
@@ -84,7 +84,6 @@ abstract class KaptGenerateStubsTask : KotlinCompile(KotlinJvmOptionsImpl()) {
|
||||
fun getIfKaptClasspathIsPresent() = !kaptClasspath.isEmpty
|
||||
|
||||
@get:Classpath
|
||||
@get:InputFiles
|
||||
@Suppress("unused")
|
||||
internal abstract val kotlinTaskPluginClasspath: ConfigurableFileCollection
|
||||
|
||||
|
||||
+2
-5
@@ -75,17 +75,14 @@ abstract class KaptTask @Inject constructor(
|
||||
internal abstract val stubsDir: DirectoryProperty
|
||||
|
||||
@get:Classpath
|
||||
@get:InputFiles
|
||||
abstract val kaptClasspath: ConfigurableFileCollection
|
||||
|
||||
//part of kaptClasspath consisting from external artifacts only
|
||||
//basically kaptClasspath = kaptExternalClasspath + artifacts built locally
|
||||
@get:Classpath
|
||||
@get:InputFiles
|
||||
abstract val kaptExternalClasspath: ConfigurableFileCollection
|
||||
|
||||
@get:Classpath
|
||||
@get:InputFiles
|
||||
abstract val compilerClasspath: ConfigurableFileCollection
|
||||
|
||||
@get:Internal
|
||||
@@ -93,6 +90,7 @@ abstract class KaptTask @Inject constructor(
|
||||
|
||||
|
||||
@get:PathSensitive(PathSensitivity.NONE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:Optional
|
||||
@get:InputFiles
|
||||
abstract val classpathStructure: ConfigurableFileCollection
|
||||
@@ -140,7 +138,6 @@ abstract class KaptTask @Inject constructor(
|
||||
level = DeprecationLevel.ERROR
|
||||
)
|
||||
@get:CompileClasspath
|
||||
@get:InputFiles
|
||||
internal val internalAbiClasspath: FileCollection by project.provider {
|
||||
if (includeCompileClasspath) project.files() else classpath
|
||||
}
|
||||
@@ -152,7 +149,6 @@ abstract class KaptTask @Inject constructor(
|
||||
level = DeprecationLevel.ERROR
|
||||
)
|
||||
@get:Classpath
|
||||
@get:InputFiles
|
||||
internal val internalNonAbiClasspath: FileCollection by project.provider {
|
||||
if (includeCompileClasspath) classpath else project.files()
|
||||
}
|
||||
@@ -168,6 +164,7 @@ abstract class KaptTask @Inject constructor(
|
||||
abstract val sourceSetName: Property<String>
|
||||
|
||||
@get:InputFiles
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
abstract val source: ConfigurableFileCollection
|
||||
|
||||
|
||||
-1
@@ -50,7 +50,6 @@ abstract class KaptWithKotlincTask @Inject constructor(
|
||||
internal val pluginOptions = CompilerPluginOptions()
|
||||
|
||||
@get:Classpath
|
||||
@get:InputFiles
|
||||
abstract val pluginClasspath: ConfigurableFileCollection
|
||||
|
||||
@get:Internal
|
||||
|
||||
-1
@@ -49,7 +49,6 @@ abstract class KaptWithoutKotlincTask @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
@get:InputFiles
|
||||
@get:Classpath
|
||||
@Suppress("unused")
|
||||
abstract val kaptJars: ConfigurableFileCollection
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ open class TransformKotlinGranularMetadata
|
||||
}
|
||||
|
||||
@Suppress("unused") // Gradle input
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
internal val allSourceSetsMetadataConfiguration: FileCollection by lazy {
|
||||
|
||||
+1
@@ -171,6 +171,7 @@ abstract class XCFrameworkTask : DefaultTask() {
|
||||
val frameworks: List<Framework>
|
||||
get() = allFrameworks.filter { it.buildType == buildType }
|
||||
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:SkipWhenEmpty
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ internal open class TransformKotlinGranularMetadataForFragment
|
||||
}
|
||||
|
||||
@Suppress("unused") // Gradle input
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
internal val allSourceSetsMetadataConfiguration: FileCollection by lazy {
|
||||
|
||||
+1
@@ -77,6 +77,7 @@ abstract class KotlinJsIrLink @Inject constructor(
|
||||
private val buildDir = project.buildDir
|
||||
|
||||
@get:SkipWhenEmpty
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputDirectory
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
internal abstract val entryModule: DirectoryProperty
|
||||
|
||||
+2
@@ -382,10 +382,12 @@ internal class KotlinCompilationNpmResolver(
|
||||
val internalDependencies: Collection<String>,
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
val internalCompositeDependencies: Collection<File>,
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
val externalGradleDependencies: Collection<File>,
|
||||
|
||||
|
||||
+3
-6
@@ -6,12 +6,7 @@
|
||||
package org.jetbrains.kotlin.gradle.targets.js.npm.tasks
|
||||
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFiles
|
||||
import org.gradle.api.tasks.OutputFile
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.PathSensitivity
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.api.tasks.*
|
||||
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
|
||||
import java.io.File
|
||||
|
||||
@@ -35,12 +30,14 @@ open class KotlinNpmInstallTask : DefaultTask() {
|
||||
|
||||
@Suppress("unused")
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
val packageJsonFiles: Collection<File> by lazy {
|
||||
resolutionManager.packageJsonFiles
|
||||
}
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
val preparedFiles: Collection<File> by lazy {
|
||||
nodeJs.packageManager.preparedFiles(nodeJs)
|
||||
|
||||
+1
@@ -30,6 +30,7 @@ open class RootPackageJsonTask : DefaultTask() {
|
||||
}
|
||||
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
val packageJsonFiles: Collection<File> by lazy {
|
||||
resolutionManager.packageJsonFiles
|
||||
|
||||
+3
-6
@@ -8,12 +8,7 @@ package org.jetbrains.kotlin.gradle.targets.js.testing
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.gradle.api.file.RegularFileProperty
|
||||
import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFile
|
||||
import org.gradle.api.tasks.InputFiles
|
||||
import org.gradle.api.tasks.Internal
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.PathSensitivity
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.process.internal.DefaultProcessForkOptions
|
||||
import org.gradle.util.ConfigureUtil
|
||||
import org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessagesTestExecutionSpec
|
||||
@@ -76,12 +71,14 @@ constructor(
|
||||
|
||||
@Suppress("unused")
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
val runtimeClasspath: FileCollection by lazy {
|
||||
compilation.runtimeDependencyFiles
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
internal val compilationOutputs: FileCollection by lazy {
|
||||
|
||||
+2
@@ -92,6 +92,7 @@ constructor(
|
||||
|
||||
@Suppress("unused")
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
val runtimeClasspath: FileCollection by lazy {
|
||||
compilation.compileDependencyFiles
|
||||
@@ -151,6 +152,7 @@ constructor(
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:Optional
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputDirectory
|
||||
open val configDirectory: File?
|
||||
get() = projectDir.resolve("webpack.config.d").takeIf { it.isDirectory }
|
||||
|
||||
+5
-1
@@ -335,7 +335,11 @@ open class CocoapodsExtension(private val project: Project) {
|
||||
}
|
||||
}
|
||||
|
||||
data class Path(@get:InputDirectory val dir: File) : PodLocation() {
|
||||
data class Path(
|
||||
@get:InputDirectory
|
||||
@get:IgnoreEmptyDirectories
|
||||
val dir: File
|
||||
) : PodLocation() {
|
||||
override fun getLocalPath(project: Project, podName: String): String {
|
||||
return dir.absolutePath
|
||||
}
|
||||
|
||||
-1
@@ -52,7 +52,6 @@ internal open class CInteropCommonizerTask : AbstractCInteropCommonizerTask() {
|
||||
get() = getCommonizationParameters().map { outputDirectory(it) }.toSet()
|
||||
|
||||
@Suppress("unused") // Used for UP-TO-DATE check
|
||||
@get:InputFiles
|
||||
@get:Classpath
|
||||
val commonizedNativeDistributionDependencies: Set<File>
|
||||
get() = getCommonizationParameters().flatMap { parameters -> parameters.targets }
|
||||
|
||||
+1
@@ -15,6 +15,7 @@ internal open class CopyCommonizeCInteropForIdeTask : AbstractCInteropCommonizer
|
||||
private val commonizeCInteropTask: TaskProvider<CInteropCommonizerTask>
|
||||
get() = project.commonizeCInteropTask ?: throw IllegalStateException("Missing commonizeCInteropTask")
|
||||
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
val cInteropCommonizerTaskOutputDirectories: Provider<Set<File>> =
|
||||
|
||||
+2
@@ -33,6 +33,7 @@ internal open class NativeDistributionCommonizerTask : DefaultTask() {
|
||||
get() = project.getAllCommonizerTargets()
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputDirectory
|
||||
@Suppress("unused") // Only for up-to-date checker. The directory with the original common libs.
|
||||
val originalCommonLibrariesDirectory = konanHome
|
||||
@@ -40,6 +41,7 @@ internal open class NativeDistributionCommonizerTask : DefaultTask() {
|
||||
.resolve(KONAN_DISTRIBUTION_COMMON_LIBS_DIR)
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputDirectory
|
||||
@Suppress("unused") // Only for up-to-date checker. The directory with the original platform libs.
|
||||
val originalPlatformLibrariesDirectory = konanHome
|
||||
|
||||
+1
@@ -490,6 +490,7 @@ open class PodBuildTask : DefaultTask() {
|
||||
internal lateinit var pod: Provider<CocoapodsDependency>
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
internal val srcDir: FileTree
|
||||
get() = project.fileTree(
|
||||
|
||||
+2
@@ -108,12 +108,14 @@ open class FatFrameworkTask : DefaultTask() {
|
||||
get() = fatFramework.dSYM
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
@get:SkipWhenEmpty
|
||||
protected val inputFrameworkFiles: Iterable<FileTree>
|
||||
get() = frameworks.map { project.fileTree(it.outputFile) }
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
protected val inputDsymFiles: Iterable<FileTree>
|
||||
get() = frameworks.mapNotNull { framework ->
|
||||
|
||||
+4
@@ -147,6 +147,7 @@ abstract class AbstractKotlinNativeCompile<T : KotlinCommonToolOptions, K : Kotl
|
||||
}
|
||||
|
||||
// Inputs and outputs
|
||||
@IgnoreEmptyDirectories
|
||||
@InputFiles
|
||||
@SkipWhenEmpty
|
||||
@PathSensitive(PathSensitivity.RELATIVE)
|
||||
@@ -511,6 +512,7 @@ constructor(
|
||||
@Internal // Taken into account by getSources().
|
||||
val intermediateLibrary: Provider<File> = project.provider { compilation.compileKotlinTask.outputFile.get() }
|
||||
|
||||
@IgnoreEmptyDirectories
|
||||
@InputFiles
|
||||
@SkipWhenEmpty
|
||||
override fun getSource(): FileTree =
|
||||
@@ -953,6 +955,7 @@ open class CInteropProcess @Inject constructor(@get:Internal val settings: Defau
|
||||
val linkerOpts: List<String>
|
||||
@Input get() = settings.linkerOpts
|
||||
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val headers: FileCollection
|
||||
@@ -964,6 +967,7 @@ open class CInteropProcess @Inject constructor(@get:Internal val settings: Defau
|
||||
val headerFilterDirs: Set<File>
|
||||
@Input get() = settings.includeDirs.headerFilterDirs.files
|
||||
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val libraries: FileCollection
|
||||
|
||||
+1
@@ -33,6 +33,7 @@ abstract class KotlinNativeTest : KotlinTest() {
|
||||
val executableProperty: Property<FileCollection> = project.objects.property(FileCollection::class.java)
|
||||
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles // use FileCollection & @InputFiles rather than @InputFile to allow for task dependencies built-into this FileCollection
|
||||
@get:SkipWhenEmpty
|
||||
@Suppress("UNUSED") // Gradle input
|
||||
|
||||
+2
@@ -31,6 +31,7 @@ internal open class InspectClassesForMultiModuleIC : DefaultTask() {
|
||||
(project.kotlinExtension as KotlinSingleJavaTargetExtension).target.defaultArtifactClassesListFile.get()
|
||||
}
|
||||
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:InputFiles
|
||||
internal val sourceSetOutputClassesDir by lazy {
|
||||
@@ -52,6 +53,7 @@ internal open class InspectClassesForMultiModuleIC : DefaultTask() {
|
||||
|
||||
@Suppress("MemberVisibilityCanBePrivate")
|
||||
@get:PathSensitive(PathSensitivity.ABSOLUTE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
internal val classFiles: FileCollection
|
||||
get() {
|
||||
|
||||
+1
@@ -112,6 +112,7 @@ abstract class KotlinCompileCommon @Inject constructor(
|
||||
}
|
||||
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:InputFiles
|
||||
internal val refinesMetadataPaths: ConfigurableFileCollection = objects.fileCollection()
|
||||
|
||||
|
||||
+4
-3
@@ -94,7 +94,6 @@ abstract class AbstractKotlinCompileTool<T : CommonToolArguments>
|
||||
project.objects.fileCollection()
|
||||
|
||||
@get:Classpath
|
||||
@get:InputFiles
|
||||
internal val computedCompilerClasspath: FileCollection = project.objects.fileCollection().from({
|
||||
when {
|
||||
useFallbackCompilerSearch -> findKotlinCompilerClasspath(project)
|
||||
@@ -245,7 +244,6 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> : AbstractKotl
|
||||
protected val multiModuleICSettings: MultiModuleICSettings
|
||||
get() = MultiModuleICSettings(buildHistoryFile.get().asFile, useModuleDetection.get())
|
||||
|
||||
@get:InputFiles
|
||||
@get:Classpath
|
||||
open val pluginClasspath: ConfigurableFileCollection = objects.fileCollection()
|
||||
|
||||
@@ -274,6 +272,7 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments> : AbstractKotl
|
||||
internal val sourceSetName: Property<String> = objects.property(String::class.java)
|
||||
|
||||
@get:InputFiles
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
internal val commonSourceSet: ConfigurableFileCollection = objects.fileCollection()
|
||||
|
||||
@@ -808,6 +807,7 @@ abstract class Kotlin2JsCompile @Inject constructor(
|
||||
override fun getSourceRoots() = SourceRoots.KotlinOnly.create(getSource(), sourceFilesExtensions.get())
|
||||
|
||||
@get:InputFiles
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:Optional
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
internal val friendDependencies: FileCollection = objectFactory
|
||||
@@ -822,6 +822,7 @@ abstract class Kotlin2JsCompile @Inject constructor(
|
||||
|
||||
@Suppress("unused")
|
||||
@get:InputFiles
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:Optional
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
internal val sourceMapBaseDirs: FileCollection?
|
||||
@@ -936,7 +937,6 @@ abstract class Kotlin2JsCompile @Inject constructor(
|
||||
}
|
||||
|
||||
data class KotlinCompilerPluginData(
|
||||
@get:InputFiles
|
||||
@get:Classpath
|
||||
val classpath: FileCollection,
|
||||
|
||||
@@ -954,6 +954,7 @@ data class KotlinCompilerPluginData(
|
||||
val inputs: Map<String, String>,
|
||||
|
||||
@get:InputFiles
|
||||
@get:IgnoreEmptyDirectories
|
||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
||||
val inputFiles: Set<File>,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user