On 18/06/10 12:41 AM, Philip Crotwell wrote:
Nevermind, although File is not one of the listed types, it seems to
handle it fine with the toString default.

I've updated the docs for files() to mention that you can pass it a File.

My problem turned out to be an extra project that no longer existed
still being in the settings file. Gradle seemed completely happy that
there was not even a directory, but the getBuildFile() returned null.
Makes sense that you cannot add a Null to a FileCollection.

Philip

On Thu, Jun 17, 2010 at 10:26 AM, Philip Crotwell<[email protected]>  wrote:
Hi

I want to add the gradle build file to the inputs of a task. This is
to grab the version from the build.gradle file and so should run
whenever the buildfile has been modified, but doesn't need to
otherwise.

To try and not hard code "build.gradle" in case it is ever run with an
alternative build file, I tried to use Project.getBuildFile(). This is
when I discovered that the  Project.files() method to build a file
collection takes lots of things, but File is not one of them! Seems a
little weird that you cannot easily put a File into a FileCollection.

Is there an easy way to convert the File object into something that
can be passed into Project.files()? Doing a File to String conversion
and then trying to resolve a relative path seems more complicated than
needed.

Or is there an easy way to generate a FileCollection from a single
File instance?
...Just found SingletonFileCollection, Is that is the best way, even
if I don't have a TaskDependency? Using something in api.internal
seems wrong as well.

thanks,
Philip

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

     http://xircles.codehaus.org/manage_email




--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz


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

   http://xircles.codehaus.org/manage_email


Reply via email to