Hi,
I am trying to generate tasks, including their dependencies. Here is the code:
==================== build.gradle ==================
if (rootProject.hasProperty('debug'))
buildType = 'chk'
else
buildType = 'fre'
def operatingSystems = ['wxp', 'wnet', 'wlh']
def cpuArchs = ['x86', 'x64']
def makeTargets = ['build', 'clean']
// generate tasks
for (target in makeTargets) {
task "${target}"
for (os in operatingSystems) {
task "${target}-${os}"
tasks["${target}"].dependsOn "${target}-${os}"
for (arch in cpuArchs) {
if (os != 'wxp' || arch == 'x86')
{
task "${target}-${os}-${arch}" << {
invokeWdkBuild("$os", "$arch", "$target")
}
tasks["${target}-${os}"].dependsOn "${target}-${os}-${arch}"
}
}
}
}
// are there both dependencies??
println('dependencies: ' +
tasks['build-wlh'].taskDependencies.getDependencies())
def invokeMakefile(String os, String arch, String target) {
println( "building WDK $target-$os-$arch")
}
======EOF===========
==== output is following ====
>gradle -q build-wlh
dependencies: [task ':driver/win:build-wlh-x86', task
':driver/win:build-wlh-x64']
building clean-wlh-x64
building clean-wlh-x64
======== EOF=========
Simply the invokeWdkBuild() is called from any task with the values,
which are the very last iterated items in arrays. I.e.
'clean','wlh','x64'.
What I am doing wrong? How can I achieve that the values are expanded
right during iteration.
TIA,
Bronislav Gabrhelik
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email