Gradle: unsorted depends on the task, how to handle?

I have three stages of my installation:

1) download 2) unzip 3) configure

download, use ant.get and ant.checksum, so I create my own DownloadTask class and then in the assembly:

task download (type: DownloadTask) {
    url = url
    checksumAlgorithm = 'MD5'
    destFile = zipFile
}

so I came up with 4 tasks:

task download {...}
task unzip {...}
task configure {..}
task install(dependsOn: [download, unzip, configure]) {}

But I noticed that dependOn doesn't respect the sort order, http://issues.gradle.org/browse/GRADLE-427

So, how is the workaround here?

I cannot move only these tasks as methods, because loading uses my DownloadTask class. I can move everything as methods (even DownloadTask), but it doesn't seem like the best solution here.

thank

+3
source share
2 answers

Well, you can also manually name your dependencies if this helps you:

task install << {
    download.execute()
    unzip.execute()
    configure.execute()
}

, Gradle, .

,

Jan

+10

, . " " ? autwiring dependOn.

Autowire , . URL- "", destFile - . . 14.8 gradle userguide (http://www.gradle.org/current/docs/userguide/more_about_tasks.html#N10D4D). Javadoc TaskInputs TaskOutputs ( ).

,

+2

All Articles