On Thu, Dec 17, 2009 at 3:33 PM, Paul Speed <[email protected]>wrote:
> In case it matters as far as evidence collection, when it worked for me I
> only had a handful of files in the src/ directory as I created it just for
> the test. My real src directory is elsewhere.
>
> It may also be important to note that prior to creating this src/ directory
> the zip task would never run since it considered itself up to date.
>
> I never saw an NPE in any of my testing so it's either a problem with a
> later build than what I have or your environment somehow.
>
> Incidentally, Hans's comments not withstanding, the syntax below is
> incorrect for your intent, I think since there is nothing associating the
> into( 'test' ) with any from()s. When I tried the blow (which worked, by
> the way) it produced a zip with only the files and no src or test
> subdirectories.
>
You are right. But this is a bug (which will be fixed for 0.9). A top-level
into should be used by any from (unless a particular into is specified by a
from).
So at the moment you have to do:
task srcZip(type: Zip) {
from(projectDir) {
into 'someSubDi'
}
}
I have just realized that the following is equivalent:
task srcZip(type: Zip) {
into('someSubDir') {
from(projectDir)
}
}
- Hans
--
Hans Dockter
Gradle Project Manager
http://www.gradle.org
>
> -Paul
>
>
> Russel Winder wrote:
>
>> On Thu, 2009-12-17 at 14:18 +0000, Russel Winder wrote:
>>
>>> On Thu, 2009-12-17 at 14:00 +0000, Russel Winder wrote:
>>>
>>> I just tried:
>>>>
>>>> task trialZip ( type : Zip ) {
>>>> into ( 'test' ) from ( 'src' )
>>>> }
>>>>
>>>> on its own in a completely separate build file and I get an NPE.
>>>>
>>> But that was in a Gant branch. Taking it out to a new directory it
>>> works
>>>
>>
>> Wrong again. As soon as I put a file into the src directory, I get NPE
>> again.
>>
>> So there is something about the Gant filestore hierarchy that is causing
>>> the task for fail with an NPE and no explanation for its failure.
>>>
>>
>> Wrong deduction.
>>
>> This is not good.
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>