Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 75757

Summary: A clear example of how to generate build.xml files for a feature at command line.
Product: [Eclipse Project] PDE Reporter: Alex Le <unbonnevie>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Alex Le CLA 2004-10-06 21:13:08 EDT
Hi,

Please provide a clear example of how to generate build.xml files for a 
feature at command line.

There are many people who use Eclipse have encountered the below infamous 
error.

org.eclipse.core.runtime.CoreException: Unable to find feature: x.y.z.

Many posts from IBM/Eclipse engineers that keep referencing to the user guide, 
which is very scarcely written, and to script files that add more confusion to 
the situation.

Ok, all the Eclipse-user community needs is a very simple BUT exact to the 
values used in the XML file to generate build.xml files for a feature.

Consider this scenario.

In my directory C:\MyWork, I have the below directories 
("MyFeature", "Plugin#1", and "Plugin#2") and the file called 
buildscripts.xml.  Please take the names as is; that is, the directory name 
for "MyFeature" is "MyFeature", literally, not "my.com.feature". 
MyFeature/feature.xml has the id of "my.com.feature".

  MyWork
    MyFeature
    plugin#1
    plugin#2
    buildscripts.xml

buildscripts.xml has the below contents.  *Is the below correct and what needs 
to be fixed to have the build.xml files generated into the above 
directories, "MyFeature", "plugin#1", "plugin#2"?*

The command to run in the "MyWork" directory is:

java -cp c:\eclipse\startup.jar org.eclipse.core.launcher.Main -application 
org.eclipse.ant.core.antRunner -buildfile buildscripts.xml "buildScripts"




<?xml version="1.0" encoding="UTF-8"?>
<project name="my.com.project" default="buildScripts" basedir=".">

      <!-- Comments:
      -->

      <target name="init">
         <!-- Need to change on this on different platform.  The
     standard Eclipse installation location is used here
     for the WINDOWS XP platform.
         -->
     <property name="eclipse.install.dir" value="c:/eclipse"/>

      </target>

      <target name="buildScripts" depends="init">

        <eclipse.buildScript
            elements="feature@my.com.feature"
            buildDirectory="${basedir}/MyFeature"
            baseLocation="${eclipse.install.dir}"
            buildingOSGi="true"
            children="true"
            recursiveGeneration="true"
            devEntries="${basedir}/plugin#1/bin,${basedir}/plugin#2/bin"
            configInfo="*, *, *"
            pluginPath="${basedir}/plugin#1/,${basdir}/plugin#2/"
        />
       
      </target>
</project>
Comment 1 Alex Le CLA 2004-10-07 18:41:49 EDT
Hi,

Please kindly help out on this "bug" with an example promptly.  I have done 
much research and am wondering if Eclipse 3.x.x is able to do what requested 
in this bug report.  Thanks.
Comment 2 Pascal Rapicault CLA 2004-10-08 12:13:28 EDT
PluginPath and buildDirectory are mutually exclusie.
If you want to use pluginPath: then you have to give all the folders of all the plugins, as well as the full 
path to the feature.xml file.
In your case: pluginPath should be:
   ...../MyWork/plugin1, ..../MyWork/plugin2, ..../MyWork/MyFeature/feature.xml

If you want to use buildDirectory, then features and plugins must respectively be located in a folder 
called features and in a folder called plugins (same organisation than the binary form).
Comment 3 Alex Le CLA 2004-10-08 15:37:57 EDT
Hi,

I re-opened this "bug"...I tried what PaScaL suggested per comment #2, but I 
got the below.  I took out the 'buildDirectory' attribute.  The documentation 
says that 'install' attribute is "deprecated, use buildDirectory instead'.  
Unfortunately, again per comment #2, I have to use 'pluginPath' rather than 
the 'buildDirectory' attribute.   Thanks for any tips on this.

BUILD FAILED
buildscripts.xml:29: org.eclipse.core.runtime.CoreException: Install location 
must be specified.
Comment 4 Pascal Rapicault CLA 2004-10-08 16:11:46 EDT
I got it to work using:
        <eclipse.buildScript
            elements="feature@com.my.feature"
            buildDirectory=""
            baseLocation="/Users/me/Desktop/eclipse"
            buildingOSGi="true"
            children="true"
            recursiveGeneration="true"
            configInfo="*,*,*"
            pluginPath="/Users/me/workspace/75757/MyFeature/feature.xml, /Users/me/workspace/
75757/plugins/plugin1, /Users/me/workspace/75757/plugins/plugin2"
        />
Comment 5 Alex Le CLA 2004-10-08 16:55:57 EDT
I got it worked.  I have to use 'buildDirectory' as well.  Thanks!

Alex.
Comment 6 Alex Le CLA 2004-10-08 17:13:51 EDT
Just a question on the side but relevant to this "bug"...

Is it possible that I can specify site.xml instead of feature.xml in 
the 'pluginPath' attribute so that all the features' and plugins' build.xml 
files that site.xml references to will get generated? Does Eclipse 3.x.x 
support this?  Thanks.
Comment 7 Pascal Rapicault CLA 2004-10-08 17:16:16 EDT
No. We are thinking about it,but we may not have enough time / resource to do 
it.