Hi Sean, 
Have a Look at the userguide chapter 38 
http://gradle.org/current/docs/userguide/userguide_single.html#sec:project_jar_dependencies

There is an example on how to declare a dependency to a custom jar task of 
another project by defining another configuration. Btw, you may need runtime 
dependencies in your dist Task instead of compile dependencies.

Regards,

Rene

--
Rene Groeschke

Email:  [email protected]
twitter: @breskeby
Blog:    http://www.breskeby.com

Am 06.05.2011 um 07:48 schrieb Sean Van Buggenum <[email protected]>:

> I take it back. i am stuck. 
> 
> The two ways I can think of doing this neatly are;
> 
> 1. customize the main jar task so that it uses the obfuscated classes instead 
> of the clean classes, 
>    and make the extra jar task use the clean ones.
> 
> or
> 
> 2. get my dist task (type: Zip) to know where to pick up the obfuscated .jar 
> files from the other projects... (and not pick up the non-obfuscated ones)
> 
> task dist(type: Zip) {
>     // as per http://www.gradle.org/tutorial_java_projects.html
>     dependsOn jar
>     into('libs') {
>         from jar.archivePath
>         from configurations.compile
>       exclude '*ZKM*.jar', '*junit*.jar'
>     }
> }
> 
> 1. 
> My problem with No.1 is that while I can get it to jar up the obfuscated 
> classes (by adding a from clause) 
> It still also includes the non-obfuscated classes. This is because by my 
> adding my own 'from' I am only appending to the list of sources to jar up, 
> not overriding.
> And I can't find for the life of me how to override this... and cause the 
> main jar task NOT to include the clean classes..... (I hope I am clear here).
> 
> 2. 
> My problem with No.2 is that I can't find any documentation for how this 
> configurations.compile thing works.... 
> As  you can see in my 'dist' task (above) ... it uses two 'from' clauses; 
> 
>         from jar.archivePath
>         from configurations.compile
> 
> the first gets the jar that was built for this project, 
> and the second seems to get all the OTHER jars built in the multi-project 
> build, as well as all dependencies.
> So, replacing 'from jar.archivePath' seems pretty easy, just to include my 
> own obfuscated jar for this project.
> But that does not solve the fact that I am including all the non-obfuscated 
> jars from my other projects. 
> So how does 'configurations.compile' work.... and what else in there can I 
> work witih?
> 
> Sorry if I am asking stupid questions, or somehow overlooking the 
> obvious..... 
> But I have been trying! 
> 
> thanks for any help, 
> 
> sean
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> 
> 

Reply via email to