Add PathSensitive annotation to all input file properties

So new validation which will be added in Gradle 7.1
won't cause warnings during the build.
This commit is contained in:
Stefan Wolf
2021-01-29 19:01:36 +03:00
committed by Andrey Uskov
parent 8b01df6772
commit 200ef832d2
9 changed files with 25 additions and 0 deletions
@@ -39,6 +39,7 @@ constructor(
var sourceMapStackTraces = true
@Optional
@PathSensitive(PathSensitivity.ABSOLUTE)
@InputFile
val inputFileProperty: RegularFileProperty = project.newFileProperty()
@@ -16,6 +16,8 @@ import org.gradle.api.initialization.IncludedBuild
import org.gradle.api.internal.artifacts.DefaultProjectComponentIdentifier
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.bundling.Zip
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
@@ -354,9 +356,11 @@ internal class KotlinCompilationNpmResolver(
@get:Input
val internalDependencies: Collection<String>,
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
val internalCompositeDependencies: Collection<File>,
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
val externalGradleDependencies: Collection<File>,
@@ -9,6 +9,8 @@ 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.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
import java.io.File
@@ -31,11 +33,13 @@ open class KotlinNpmInstallTask : DefaultTask() {
val args: MutableList<String> = mutableListOf()
@Suppress("unused")
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
val packageJsonFiles: Collection<File> by lazy {
resolutionManager.packageJsonFiles
}
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
val preparedFiles: Collection<File> by lazy {
nodeJs.packageManager.preparedFiles(nodeJs)
@@ -12,6 +12,8 @@ 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.process.internal.DefaultProcessForkOptions
import org.gradle.util.ConfigureUtil
import org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessagesTestExecutionSpec
@@ -65,6 +67,7 @@ constructor(
val testFrameworkSettings: String
@Input get() = testFramework!!.settingsState
@PathSensitive(PathSensitivity.ABSOLUTE)
@InputFile
val inputFileProperty: RegularFileProperty = project.newFileProperty()
@@ -72,6 +75,7 @@ constructor(
var debug: Boolean = false
@Suppress("unused")
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
val runtimeClasspath: FileCollection by lazy {
compilation.runtimeDependencyFiles
@@ -79,6 +83,7 @@ constructor(
@Suppress("unused")
@get:InputFiles
@get:PathSensitive(PathSensitivity.ABSOLUTE)
internal val compilationOutputs: FileCollection by lazy {
compilation.output.allOutputs
}
@@ -88,6 +88,7 @@ constructor(
internal var resolveFromModulesFirst: Boolean = false
@Suppress("unused")
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
val runtimeClasspath: FileCollection by lazy {
compilation.compileDependencyFiles
@@ -145,6 +146,7 @@ constructor(
private val projectDir = project.projectDir
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:Optional
@get:InputDirectory
open val configDirectory: File? by lazy {
@@ -36,12 +36,14 @@ internal open class CommonizerTask : DefaultTask() {
@get:Input
var targetGroups: Set<KonanTargetGroup> = emptySet()
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputDirectory
@Suppress("unused") // Only for up-to-date checker. The directory with the original common libs.
val originalCommonLibrariesDirectory = konanHome
.resolve(KONAN_DISTRIBUTION_KLIB_DIR)
.resolve(KONAN_DISTRIBUTION_COMMON_LIBS_DIR)
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputDirectory
@Suppress("unused") // Only for up-to-date checker. The directory with the original platform libs.
val originalPlatformLibrariesDirectory = konanHome
@@ -52,6 +54,7 @@ internal open class CommonizerTask : DefaultTask() {
val commonizerTargetOutputDirectories
get() = targetGroups.map { targets -> project.nativeDistributionCommonizerOutputDirectory(targets) }
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
@Suppress("unused") // Only for up-to-date checker.
val successMarkers
@@ -364,6 +364,7 @@ open class PodGenTask : DefaultTask() {
}
}
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFile
internal lateinit var podspec: Provider<File>
@@ -480,12 +481,14 @@ private fun getBuildSettingFileName(pod: CocoapodsDependency, sdk: String): Stri
*/
open class PodBuildTask : DefaultTask() {
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFile
internal lateinit var buildSettingsFile: Provider<File>
@get:Nested
internal lateinit var pod: Provider<CocoapodsDependency>
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
internal val srcDir: FileTree
get() = project.fileTree(
@@ -105,11 +105,13 @@ open class FatFrameworkTask: DefaultTask() {
private val fatDsym: IosDsymFiles
get() = fatFramework.dSYM
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
@get:SkipWhenEmpty
protected val inputFrameworkFiles: Iterable<FileTree>
get() = frameworks.map { project.fileTree(it.outputFile) }
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles
protected val inputDsymFiles: Iterable<FileTree>
get() = frameworks.mapNotNull { framework ->
@@ -33,6 +33,7 @@ abstract class KotlinNativeTest : KotlinTest() {
@get:Internal
val executableProperty: Property<FileCollection> = project.objects.property(FileCollection::class.java)
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:InputFiles // use FileCollection & @InputFiles rather than @InputFile to allow for task dependencies built-into this FileCollection
@get:SkipWhenEmpty
@Suppress("UNUSED") // Gradle input