mirror of
https://github.com/OpenFlutter/fluwx.git
synced 2025-05-17 15:25:59 +08:00
32 lines
1.0 KiB
Plaintext
32 lines
1.0 KiB
Plaintext
abstract class GenFluwxHelperTask : DefaultTask() {
|
|
@get:Incremental
|
|
@get:PathSensitive(PathSensitivity.NAME_ONLY)
|
|
@get:InputDirectory
|
|
abstract val inputDir: DirectoryProperty
|
|
|
|
@get:OutputDirectory
|
|
abstract val outputDir: DirectoryProperty
|
|
|
|
@get:Input
|
|
abstract val inputProperty: Property<String>
|
|
|
|
@TaskAction
|
|
fun execute(inputChanges: InputChanges) {
|
|
println(
|
|
if (inputChanges.isIncremental) "Executing incrementally"
|
|
else "Executing non-incrementally"
|
|
)
|
|
|
|
inputChanges.getFileChanges(inputDir).forEach { change ->
|
|
if (change.fileType == FileType.DIRECTORY) return@forEach
|
|
|
|
println("${change.changeType}: ${change.normalizedPath}")
|
|
val targetFile = outputDir.file(change.normalizedPath).get().asFile
|
|
// if (change.changeType == ChangeType.REMOVED) {
|
|
// targetFile.delete()
|
|
// } else {
|
|
// targetFile.writeText(change.file.readText().reversed())
|
|
// }
|
|
}
|
|
}
|
|
} |