Hi, I’m trying to dynamically create some tasks which package up various different artifacts. I’m also adding each of those tasks to the ‘compile’ artifact configuration. However I get the error message “Could not determine the dependencies of task ‘:uploadArtifacts’.”
If I remove the dynamic generation of tasks and type out the definition of the tasks long-hand then it works fine. Although I’d prefer not to do this because I may have many more different zips than just Debug and Release.
I was wondering if anyone could please help me with this.
The code:
configurations {
compile
}
["Debug", "Release"].each { conf ->
task("package" + conf, type: Zip) {
classifier = conf
includes = ["src/*.h", "lib/$conf/*.lib"]
baseName = 'external-lib'
includeEmptyDirs = false
from "."
}
configurations.compile.artifacts.add "package" + conf
}
task uploadArtifacts(type: Upload) {
group = "Packaging"
description = "Uploads all packages to the repository."
uploadDescriptor = true
descriptorDestination = new File("ivy.xml")
configuration = configurations.compile
}
The command line: gradle tasks
The error: Execution failed for task ‘:tasks’. > Could not determine the dependencies of task ‘:uploadArtifacts’.