Bug 5797 - External Zip program is called by build.xml even though the program is not available
Summary: External Zip program is called by build.xml even though the program is not av...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 2.0   Edit
Hardware: PC All
: P1 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-12 11:02 EST by Rodrigo Peretti CLA
Modified: 2002-03-07 16:50 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Peretti CLA 2001-11-12 11:02:23 EST
From the newsgroups:

When I try to create a new plugin with the last version of Eclipse, I have
some problems to build it because the build.xml reference a external zip
command that does not work on my PC. I don't understand why this version of
eclipse generate a build.xml that does not support the ant's internal zip
and jar task.

May be I do something wrong when I generate the plugIn project ?

Thomas Papiernik
Comment 1 Edwin Fine CLA 2001-11-16 12:19:16 EST
I am having the same problem. Other Ant scripts seem to use a command <zip ..>, 
while this one is using

	<exec dir="${basedir}/_temp___" executable="zip">
	   <arg line="-r ../${component}${stamp}.jar ."/>
	</exec>
Comment 2 Rodrigo Peretti CLA 2001-11-16 12:52:10 EST
It was added in order to solve a problem in our build process where the zip 
task from Ant was not preserving files' and folders' permissions. We should 
address this problem as soon as we migrate to Ant 1.4.1.
Comment 3 Rodrigo Peretti CLA 2001-11-29 17:37:23 EST
Fixed and released into HEAD. The default behaviour is to use Ant tasks: Zip 
and Jar. In order to get the old behaviour (external zip command), it is 
necessary to set the property useExternalZip to something like "true".
E.g.:

-DuseExternalZip=true

or

<property name="useExternalZip" value="true"/>
Comment 4 Rodrigo Peretti CLA 2001-12-10 15:01:05 EST
The user should be able to specify the external zip program. It should not be 
hardcoded in Eclipse. Reopening.
Comment 5 Rodrigo Peretti CLA 2001-12-10 16:04:03 EST
From an EC post: Besides the external zip problem, the user is facing problems 
with spaces on a path. We should consider it when using external programs.

----------------------------------

<...>

However, I have 2 problems:

1.  You can't launch if the path name has a space in it. I get:

  java.io.IOException : CreateProcess: c:\Program" "Files\Java\.......

2.  I can't seem to build the jar. I get:

  Execute failed: java.io.IOException: CreateProcess zip -r
c:\EclipseWorkspace\com.company.myplugin/myplugin.jar . error=2

  What catches my eye is forward slash.  I also notice the program name of
"zip".  I have a zip.dll in every JDK installed on my machine but that is
all.  I made sure they were in my path as well but no dice.
Comment 6 Rodrigo Peretti CLA 2001-12-12 00:12:03 EST
It should be fixed for fragments as well.
Comment 7 Rodrigo Peretti CLA 2002-03-07 16:50:40 EST
Here's the final story. There are 4 entries in the build.properties that can 
be used in this case: jar.external, zip.external, zip.program and zip.argument.

If you want to use an external program instead of the default Ant task for 
both jar and zip generation, set the following properties:

jar.external = true
zip.external = true

In order to set the external program (will be the same for both zip and jar 
tasks), use the following properties as examples:

zip.program  = c:\utils\zip.exe
zip.argument = -r ${zip.file} .

Note that ${zip.file} is a variable that indicates where in the command line 
the zip file has to be. It was added in order to be more flexible when dealing 
with different zip programs.
Comment 8 Rodrigo Peretti CLA 2002-03-07 16:50:58 EST
Fixed.