Am 06.05.11 15:45, schrieb Szczepan Faber:
Hey,

and it tells me the collection can't be modified! (what is the add function 
doing there then? confused).
Here's one of the ways you can work with FileCollection:
files('fileOne', 'fileTwo')

and it worked. However, even though we've change how zkm and junit are used in 
the dependencies block,
they've arrived back again in my distribution zip

Perhaps the transitive dependencies are being pulled.

configurations {
    obfuscated.extends Compile
should be: obfuscated.extendsFrom compile

Also, any idea how to get it to stop magically building an unobfuscated project 
B (that's the SimpleSharedProject from the dependencies)
and get it to use the one that is actually built by the project?
If it is a project dependency then gradle should build it, right? If
it's not needed I would remove it from the dependencies.

I think what Sean wants is that his own jar task definition is referenced in project dependencies and not the one shipped with the Java Plugin. Using the overwrite flag doesn't work for project dependencies as the Java Plugin adds the instance of the jar task generated when the java plugin is applied to the project to the archives configuration. I can't see a way to replace this by the own jar task definition. First I thought he can use a workarround like the following in his script
-------------------
apply plugin:'java'
....
artifacts.configurationContainer.getByName("archives").artifacts.remove(jar)

task jar(dependsOn: obfuscate, type: Jar, overwrite: true) {
    from "build/obf"
}

artifacts{
    archives jar
}
....
-------------------

But Configuration.getArtifacts() returns a unmodifiable list, so this doesn't work.

I would suggest to apply the java-base plugin and start from there and add my own jar task, instead of doing several hacks on the java plugin. Other thoughts. Maybe I miss something obvious.

regards,
René

Hope that helps!
Szczepan

On Fri, May 6, 2011 at 3:01 PM, Sean Van Buggenum<[email protected]>  wrote:
Hi Rene,
also, I started playing with some of that gradle code you pasted me, setting
up the configurations.
I'm still trying to get the dist task to actually zip up the obfuscated
files that I really want.... (not generate them itself).
  configurations {
         obfuscated.extends Compile
     }

This line seems to be in error, yielding :
Total time: 5.824 secs
seanvb@svUbuntuX2:/mnt/data/dev2$
/mnt/data/bin/gradle-1.0-milestone-3/bin/gradle build
FAILURE: Build failed with an exception.
* Where:
Build file '/mnt/data/dev2/GenericDataExportShared/build.gradle' line: 31
* What went wrong:
A problem occurred evaluating project ':GenericDataExportShared'.
Cause: Could not find method extends() for arguments [class
org.gradle.api.tasks.compile.Compile] on configuration
':GenericDataExportShared:obfuscated'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
BUILD FAILED

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

     http://xircles.codehaus.org/manage_email




--
-----------------------
regards René

rene groeschke
http://www.breskeby.com
@breskeby


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

   http://xircles.codehaus.org/manage_email


Reply via email to