Hi all,

Is there a reason why there is no distinction between the separator between
two project names and the separator between a project name and a task name?
They both are ":".

Reason I ask is because of the example in
http://www.gradle.org/tutorial_using_tasks.html:


gradle.taskGraph.whenReady {taskGraph ->
    if (taskGraph.hasTask(':release')) {
        version = '1.0'
    } else {
        version = '1.0-SNAPSHOT'
    }
}

This example does not function properly when used in in a sub project. For
sub projects one needs to (for instance) prepend getPath() like this:


gradle.taskGraph.whenReady {taskGraph ->
    if (taskGraph.hasTask(getPath() + ':release')) {
        version = '1.0'
    } else {
        version = '1.0-SNAPSHOT'
    }
}

Unfortunately, this would mean that you cannot simply use this example in an
allprojects { } block, because getPath() returns ":" for the root project,
and there is never a task "::release", only a task ":release".

For me, it is also confusing that ":sub:foo" can mean 'project foo in
project sub' as well as 'task foo in project sub'. Is there a way to fix
this?

cheers,
--L

Reply via email to