Enable caching of task outputs for custom build tasks
This commit is contained in:
parent
e42e36c4de
commit
6869a4d5f4
|
@ -6,6 +6,7 @@ import org.gradle.api.tasks.*
|
|||
// create a Javadoc-style "package-list" file
|
||||
//
|
||||
|
||||
@CacheableTask
|
||||
class CreatePackageList extends org.gradle.api.DefaultTask {
|
||||
|
||||
@Input Object sourceSet
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.gradle.api.tasks.*
|
|||
// download and use checksum to verify that we got what we expected
|
||||
//
|
||||
|
||||
@CacheableTask
|
||||
class VerifiedDownload extends org.gradle.api.DefaultTask {
|
||||
|
||||
// URL of resource to download
|
||||
|
|
|
@ -33,6 +33,7 @@ task generateJniHeaders(type: Exec, dependsOn: [testClasses, ':com.ibm.wala.cast
|
|||
}
|
||||
inputs.files files(qualifiedClasses.collect { "$buildDir/${it.replace('.', '/')}.class" })
|
||||
outputs.files files(qualifiedClasses.collect { "$headerDir/${it.replace('.', '_')}.h" })
|
||||
outputs.cacheIf { true }
|
||||
|
||||
// javah command to generate headers
|
||||
def sourceSets = [sourceSets.test, project(':com.ibm.wala.cast').sourceSets.main]
|
||||
|
|
|
@ -101,6 +101,7 @@ task generateHelloHashJar(type: JavaExec, dependsOn: unpackOcamlJava) {
|
|||
inputs.file 'ocaml/hello_hash.ml'
|
||||
outputs.file 'hello_hash.jar'
|
||||
args inputs.files.singleFile, '-o', outputs.files.singleFile
|
||||
outputs.cacheIf { true }
|
||||
|
||||
def ocamlJavaHome = new File(files(unpackOcamlJava).singleFile, downloadOcamlJava.basename)
|
||||
classpath new File(ocamlJavaHome, 'lib/ocamljava.jar')
|
||||
|
|
|
@ -53,6 +53,7 @@ task unpackAndroidSdk(type: Sync, dependsOn: downloadAndroidSdk) {
|
|||
into temporaryDir
|
||||
}
|
||||
|
||||
@CacheableTask
|
||||
class InstallAndroidSdkComponent extends DefaultTask {
|
||||
@Input def component
|
||||
@Input def version
|
||||
|
|
Loading…
Reference in New Issue