On 12/24/2009 10:11 AM, Russel Winder wrote:
To create the Gant distribution I am using Tar and Zip tasks with
copyspecs.  I need the copy to include some stream editing.  So I tried:

         standaloneCopySpec = copySpec {
           def scriptsDirectory = 'scripts'
           def projectBase = project ( projectNameForStandalone )
           from ( '.' ) { include ( 'README*' ) }
           into ( 'conf' ) { from ( scriptsDirectory + '/conf' ) { include ( 
'*.conf' ) } }
           into ( 'lib' ) {
             from ( projectBase.libsDir )
             from ( projectBase.configurations.runtime )
             from ( 'jarfiles' )
           }
           into ( 'bin' ) {
             fileMode = 0755
             from ( [ scriptsDirectory + '/bin' , scriptsDirectory + 
'/bin_standalone' ] )
             filter ( ReplaceTokens , tokens : [ GROOVYJAR : 'groovy-' + 
groovyVersions[groovyStandaloneSeries] + '.jar' ] )
           }
         }

If I remove the filter then things works as expected but not as
required, i.e. there is no stream editing, but all the files needed in
the archive find their way into the archive.

With the filter line in place I get:

         Execution failed for task ':standaloneBinTgz'.
         Cause: Could not add file 
'/home_local/users/russel/Repositories/Bazaar/Masters/Gant/Trunk_Development/scripts/bin/startGroovy.bat'
 to TAR 
'/home_local/users/russel/Repositories/Bazaar/Masters/Gant/Trunk_Development/build/gant-1.10.0-SNAPSHOT.tgz'.

which isn't very helpful :-(  The full stack trace doesn't appear to add
any extra useful information.

If someone can give me a fix for this, or even a workaround, I can make
a Gant 1.9.1 release.

Thanks.



Are you trying to make a Gant Christmas present?
I'm not sure how to help without a useful stack trace or a way for me to reproduce the problem, but I have a few ideas you could try.

1) Try doing this as a Copy task instead of a Tar. Is this really a copy spec processing problem or something related to the Tar task. I suspect you will have the same problem with the tar.

2) See if you can simplify the CopySpec to something someone else could reproduce, but still keep the problem. If you only try a CopySpec that selects just the single bat file, do you still have the problem?

3) Try changing the replace token to just a string literal for testing. Perhaps it is the evaluation of the expression there that is the problem.

4) I have seen a problem in the past with filters that were a peer of a from. You might try changing the filter to be inside the last from closure:
into ( 'bin' ) {
 fileMode = 0755
from ([ scriptsDirectory + '/bin' , scriptsDirectory + '/bin_standalone' ]){ filter ( ReplaceTokens , tokens : [ GROOVYJAR : 'groovy-' + groovyVersions[groovyStandaloneSeries] + '.jar' ] ) }
}

--
Steve Appling
Automated Logic Research Team

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

   http://xircles.codehaus.org/manage_email


Reply via email to