Hi Philip,

thank you for your link, but I think it can be useful only after I
have found the lib folders of ALL DEPENDENTS projects. Let me extend
my example. Suppose there are 3 projects

prjA
  lib
  dist
prjB
   lib
   dist
prjC
   lib
   dist

where dependencies are
  prjA -> prjB
  prjA -> prjC

  prjB -> prjC

Note that the prjC's jar is needed by prjA and prjB. Hence, I would
like the :prjC:uploadArchives task to copy its prjC/dist/prjC.jar into
the lib folder of ALL DEPENDENTS projects, i.e. into prjA/lib and
prjB/lib. I need this because all project must be self-consistent if
they are checked out from the repository.

The java plugin has the task buildDependents. So, I suppose there is a
way to know which project need the jar produced by the current
project.  I have tried to use the following but it returns only the
current project.

             def t = task.project.tasks.buildDependents
             def myset = t.taskDependencies.getDependencies(t)*.path as Set

Ciao

Walter

On 13 May 2010 16:22, Philip Crotwell <[email protected]> wrote:
> Hi
>
> See the cookbook:
> http://gradle.codehaus.org/Cookbook#Cookbook-GatheringalldependencieslibrariesJARsinonefolder
>
> Philip
>
> On Thu, May 13, 2010 at 9:31 AM, Walter Di Carlo <[email protected]> wrote:
>> Hi,
>>
>> I am trying to customize the uploadArchives task in order to copy the
>> generated jar into the lib folder of the dependents project. So,
>> having the follwoing structure
>>
>> prjA
>>   lib
>>   dist
>> prjB
>>   lib
>>   dist
>>
>> where prjA depends on prjB. Then I would like to copy the generated
>> jar in the prjB/dist into the prjA/lib.
>>
>> As first step I am trying to figure out ho to obtain the list of
>> depentents project using the following task
>>
>> subprojects {
>>    apply plugin: 'java'
>>    ....
>>    task list_dependents << { task ->
>>             def t = task.project.tasks.buildDependents
>>             def myset = t.taskDependencies.getDependencies(t)*.path as Set
>>             myset.each { o -> println o }
>>    }
>> }
>>
>> The problem is the it returns only the current project. What am I
>> missing? Note that I am using the gradle 0.9-preview
>>
>> Regards,
>>
>> Walter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to