Skip to content

Commit

Permalink
Update tasks
Browse files Browse the repository at this point in the history
- SyncFile is no longer cachable
- removed KotlinApiCompareTask's ctor
  • Loading branch information
fzhinkin committed Jun 21, 2024
1 parent cd2a320 commit d8271ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/KotlinApiCompareTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.*

@CacheableTask
public open class KotlinApiCompareTask @Inject constructor() : DefaultTask() {
public open class KotlinApiCompareTask : DefaultTask() {

@get:InputFiles // don't fail the task if file does not exist, instead print custom error message from verify()
@get:PathSensitive(PathSensitivity.RELATIVE)
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/SyncFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ package kotlinx.validation
import org.gradle.api.DefaultTask
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.*
import org.gradle.work.DisableCachingByDefault
import java.nio.file.Files
import java.nio.file.StandardCopyOption

// Built-in Gradle's Copy/Sync tasks accepts only a destination directory (not a single file)
// and registers it as an output dependency. If there's another task reading from that particular
// directory or writing into it, their input/output dependencies would clash and as long as
// there will be no explicit ordering or dependencies between these tasks, Gradle would be unhappy.
@CacheableTask
@DisableCachingByDefault(because = "No computations, only copying files")
internal abstract class SyncFile : DefaultTask() {
@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
Expand Down

0 comments on commit d8271ab

Please sign in to comment.