On 22/11/2010, at 12:33 AM, Jason Voegele wrote: > Hello, I am working on some fixes to the gradle-android-plugin and have what > I hope is a simple question. I need to get a File object that refers to the > main JAR file of the project using the plugin, i.e. whatever JAR file would > be constructed by the gradle jar task. Given a Project object, what methods > do I need to call on that Project object to get a handle to this file, taking > into consideration that the user may configure this JAR file to have a > different name and location than the Gradle default?
The Jar task has an archivePath property, so you can do something like 'project.jar.archivePath' to get the value. It can potentially be a bit tricky to get the timing right from inside a plugin, given, as you say, the value can be changed from its default value, right up until the jar is created. Can you give a bit more detail about what you need to do with the JAR file? The issue of timing is turning out to be a bit of a problem, particularly for plugin authors. It's something we'd like to fix before Gradle 1.0. -- Adam Murdoch Gradle Developer http://www.gradle.org CTO, Gradle Inc. - Gradle Training, Support, Consulting http://www.gradle.biz
