Skip to content

Commit

Permalink
Merge pull request #327 from hugares/support-caching
Browse files Browse the repository at this point in the history
 Make Deb and Rpm tasks cacheable
  • Loading branch information
rpalcolea authored Apr 30, 2019
2 parents f1db97d + 06dc39e commit 1cdee21
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/main/groovy/com/netflix/gradle/plugins/deb/Deb.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ import com.netflix.gradle.plugins.packaging.Dependency
import com.netflix.gradle.plugins.packaging.SystemPackagingTask
import org.gradle.api.internal.ConventionMapping
import org.gradle.api.internal.IConventionAware
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputFile

@CacheableTask
class Deb extends SystemPackagingTask {
Deb() {
super()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import com.netflix.gradle.plugins.deb.control.MultiArch
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.redline_rpm.header.Architecture
import org.redline_rpm.header.Os
import org.redline_rpm.header.RpmType
Expand Down Expand Up @@ -47,7 +49,7 @@ class SystemPackagingExtension {
@Input @Optional
String signingKeyPassphrase

@InputFile @Optional
@InputFile @Optional @PathSensitive(PathSensitivity.RELATIVE)
File signingKeyRingFile

// Metadata, some are probably specific to a type
Expand Down Expand Up @@ -158,13 +160,13 @@ class SystemPackagingExtension {

// Scripts

@InputFile @Optional
@InputFile @Optional @PathSensitive(PathSensitivity.RELATIVE)
File preInstallFile
@InputFile @Optional
@InputFile @Optional @PathSensitive(PathSensitivity.RELATIVE)
File postInstallFile
@InputFile @Optional
@InputFile @Optional @PathSensitive(PathSensitivity.RELATIVE)
File preUninstallFile
@InputFile @Optional
@InputFile @Optional @PathSensitive(PathSensitivity.RELATIVE)
File postUninstallFile

final List<Object> configurationFiles = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ abstract class SystemPackagingTask extends AbstractArchiveTask {
* @return Collection of files
*/
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
@SkipWhenEmpty
private final FileCollection getFakeFiles() {
project.files('fake')
Expand Down
9 changes: 6 additions & 3 deletions src/main/groovy/com/netflix/gradle/plugins/rpm/Rpm.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@ package com.netflix.gradle.plugins.rpm

import com.netflix.gradle.plugins.packaging.AbstractPackagingCopyAction
import com.netflix.gradle.plugins.packaging.SystemPackagingTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.redline_rpm.header.Architecture
import org.redline_rpm.header.Os
import org.redline_rpm.header.RpmType
import org.gradle.api.internal.ConventionMapping
import org.gradle.api.internal.IConventionAware

@CacheableTask
class Rpm extends SystemPackagingTask {
@InputFile @Optional
@InputFile @Optional @PathSensitive(PathSensitivity.RELATIVE)
File changeLogFile

Rpm() {
Expand Down

0 comments on commit 1cdee21

Please sign in to comment.