copy dependencies to some dir (without their dependencies)

View: New views
4 Messages — Rating Filter:   Alert me  

copy dependencies to some dir (without their dependencies)

by Tomek Kaczanowski-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi all,

once again about copying of dependencies to some dir.

I have few dependencies:
configurations {
    xyzJars
}

dependencies {
    xyzJars "someGroup:someId:version"
    xyzJars "someGroup2:someId2:version"
   etc.
}

Now, what I want is to copy these dependencies to some folder. But
only them, nothing more.
I've tried numerous variants of copy task but without success. Code
like this one:
task deployBundles << {
  copy {
    from configurations.xyzJars
    into "${tempDir}/deploy"
  }
}
copies also dependencies of these dependencies as well (so I have a
lot of "spring-xyz.jar", "log4j-xyz.jar" etc in the destination
folder). I can remove them later (and I do), but I wonder if there is
some simple way of making similar code work the way I expect.

BTW. gradle 0.8

As usual, I have this feeling that I'm missing something obvious... :(

--
Tomek

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

    http://xircles.codehaus.org/manage_email



Re: copy dependencies to some dir (without their dependencies)

by Tomek Kaczanowski-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

any hints here ?

--
Tomek

2009/10/20 Tomek Kaczanowski <kaczanowski.tomek@...>:

> hi all,
>
> once again about copying of dependencies to some dir.
>
> I have few dependencies:
> configurations {
>    xyzJars
> }
>
> dependencies {
>    xyzJars "someGroup:someId:version"
>    xyzJars "someGroup2:someId2:version"
>   etc.
> }
>
> Now, what I want is to copy these dependencies to some folder. But
> only them, nothing more.
> I've tried numerous variants of copy task but without success. Code
> like this one:
> task deployBundles << {
>  copy {
>    from configurations.xyzJars
>    into "${tempDir}/deploy"
>  }
> }
> copies also dependencies of these dependencies as well (so I have a
> lot of "spring-xyz.jar", "log4j-xyz.jar" etc in the destination
> folder). I can remove them later (and I do), but I wonder if there is
> some simple way of making similar code work the way I expect.
>
> BTW. gradle 0.8
>
> As usual, I have this feeling that I'm missing something obvious... :(
>
> --
> Tomek
>

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

    http://xircles.codehaus.org/manage_email



Re: copy dependencies to some dir (without their dependencies)

by Adam Murdoch-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Tomek Kaczanowski wrote:

> hi all,
>
> once again about copying of dependencies to some dir.
>
> I have few dependencies:
> configurations {
>     xyzJars
> }
>
> dependencies {
>     xyzJars "someGroup:someId:version"
>     xyzJars "someGroup2:someId2:version"
>    etc.
> }
>
> Now, what I want is to copy these dependencies to some folder. But
> only them, nothing more.
> I've tried numerous variants of copy task but without success. Code
> like this one:
> task deployBundles << {
>   copy {
>     from configurations.xyzJars
>     into "${tempDir}/deploy"
>   }
> }
> copies also dependencies of these dependencies as well (so I have a
> lot of "spring-xyz.jar", "log4j-xyz.jar" etc in the destination
> folder). I can remove them later (and I do), but I wonder if there is
> some simple way of making similar code work the way I expect.
>
> BTW. gradle 0.8
>
> As usual, I have this feeling that I'm missing something obvious... :(
>
>  

The simplest option is to set the transitive flag for the configuration
to false:

configurations {
    xyzJars { transitive = false }
}

Alternatively, you can copy the configuration and set the transitive flag:

task deployBundles << {
   copy {
      from configurations.xyzJars.copy().setTransitive(false)
      ...
   }
}


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


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

    http://xircles.codehaus.org/manage_email



Re: copy dependencies to some dir (without their dependencies)

by Tomek Kaczanowski-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Adam,

>> Now, what I want is to copy these dependencies to some folder. But
>> only them, nothing more.
> The simplest option is to set the transitive flag for the configuration to
> false:
>
> configurations {
>   xyzJars { transitive = false }
> }
worked like a charm :) thanks !

--
Tomek

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

    http://xircles.codehaus.org/manage_email