Hi !
I believe "group" is a property used for grouping tasks.  Or rather all tasks 
have a property called group. For the "prop" property the story is a bit 
differentMaybe you could explain what you want to achieve with the group 
property ? 
You have defined a group property that would be applied to project scope in 
group-magic project. And same applies for project sub.However for the top and 
sub tasks I guess the tasks don't inherit the project property, but rather uses 
the already defined value of the group property for the task. (Which it would 
appear would be null unless you define itexplicitly by setting mytask.group = 
"mycustomtaskgroup" at configuration time for the task)
But the again I might be wrong... 
cheersMagnus 
   


Date: Thu, 25 Nov 2010 16:58:06 +0100
From: [email protected]
To: [email protected]
Subject: [gradle-user] Group property magic


The "group" property gets some special treatment in gradle.A simple 
multiproject test, with the following files:

group-magic\settings.gradle:
include 'sub'
-------------------------------------------------------------------------------------
group-magic\build.gradle:
group='testing'

prop='myprop'

println "in build.gradle: group=$group, prop=$prop"

task top << {
     println "in task top: group=$group, prop=$prop"
}

-------------------------------------------------------------------------------------

group-magic\sub\build.gradle:
println "in sub/build.gradle: group=$group, prop=$prop"

task sub << {
     println "in task sub: group=$group, prop=$prop"

}



Running "gradle top sub" results in the following output:
in build.gradle: group=testing, prop=myprop
in sub/build.gradle: group=group-magic, prop=myprop

:top
in task top: group=null, prop=myprop
:sub:sub
in task sub: group=null, prop=myprop


As you can see, the group property takes on three different values, while the 
other property "prop" stays the same.

It is rather confusing to me that the group property is changed behind the 
scenes in this manner.Anyone who can enlighten me as to what is happening here, 
and what the logic behind this behaviour is?

We typically want the group to be the same everywhere (i.e. inside and outside 
all tasks on all levels). Much like the behaviour you see from the other 
property "prop" in the example.
What's the simplest way to achieve this?

Regards,Steinar

                                          

Reply via email to