Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 240986 - "build.xml" overwritten & deleted in the root of plug-in projects by "Build All" button in "site.xml" (update site)
Summary: "build.xml" overwritten & deleted in the root of plug-in projects by "Build A...
Status: RESOLVED DUPLICATE of bug 120840
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-15 16:17 EDT by Timothy Halloran CLA
Modified: 2008-07-15 17:10 EDT (History)
3 users (show)

See Also:


Attachments
Eclipse PDE is unhappy with a NetBeans build.xml file (43.61 KB, image/png)
2008-07-15 16:50 EDT, Timothy Halloran CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Halloran CLA 2008-07-15 16:17:14 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Create a plug-in project from the wizard named "Pluger".
2. Create a non-empty "build.xml" file in the root directory of the "Pluger" project.
3. Copy the a non-empty "build.xml" to "build.old" to save a copy for comparison later on.
4. Create a feature project named "PlugerFeature" with the "Pluger" plug-in as the only plug-in to be packaged in the feature.
5. Create an update site project named "PlugerUpdateSite".
6. Add "PlugerFeature" to be published on the update site.
7. Press the "Build All" button in the "site.xml" "Site Map" page (in the update site project).
RESULT: This deletes the "build.xml" file in the "Pluger" project (the bug). If you try to compare "build.xml" with "build.old" you will get an internal error that the "build.xml" file doesn't exist (there is a refresh problem here).


More information:
I ran into this creating projects that are both Eclipse plug-ins and NetBeans modules.  NetBeans "owns" the "build.xml" file and when we built our Eclipse update site I was surprised to see all the "build.xml" files in plug-in/module projects were deleted.  Despite my specific case, this seems to be a bad behavior overall.

I was unable to determine a workaround on my own (there may be one).  I'd suggest a temp file be used for the generated build file (it doesn't have to be in the project to be run)...or some way to change the name of the file used...but I am not too familiar with the details of the current PDE code so these might be a bad suggestions :-)
Comment 1 Andrew Niefer CLA 2008-07-15 16:26:01 EDT
> NetBeans "owns" the "build.xml" file
Eclipse also "owns" it :)

You can add "custom=true" to your build.properties and the file won't get deleted, but the build still uses the build.xml file and it is expected to contain the necessary targets to build a bundle.

I'm sure UI has something appropriate to mark this a duplicate of.
Comment 2 Curtis Windatt CLA 2008-07-15 16:35:48 EDT
I don't know which bug actually added the option in the build.properties, but that is the workaround.  It has worked this way for a while, see bug 53807.

We did just add in a change to warn the user when exporting that their build.xml files are being deleted, but this does not apply to update sites.  See bug 82302.

Marking as WORKFORME.
Comment 3 Timothy Halloran CLA 2008-07-15 16:50:29 EDT
Created attachment 107524 [details]
Eclipse PDE is unhappy with a NetBeans build.xml file

The current workaround doesn't solve the reported issue...but I can understand this might be a high priority to fix.

More on why the current "fix" is not ideal:

When NetBeans owns the "build.xml" file it simply contains:

<?xml version="1.0" encoding="UTF-8"?>
<project name="com.surelogic.adhoc" default="netbeans" basedir=".">
    <description>Builds, tests, and runs the project com.surelogic.adhoc.</description>
    <import file="nbproject/build-impl.xml"/>
</project>

Eclipse doesn't like this project because the default target "netbeans" relies upon variable definitions that are "internal" to NetBeans (see screenshot image).  Regardless of the wisdom of this approach. it make it pretty impossible to "merge" the plug-in build.xml from Eclipse with the NetBeans module build.xml.

It would be nice to allow the name of the (Eclipse) custom build file to be specified in the build.xml, for example

custom=true

would use "build.xml"

custom=build-plug-in.xml

would use "build-plug-in.xml"

I could probably make this change and submit the patch (it doesn't seem to difficult).  Is there some reason this change would not be considered?
Comment 4 Timothy Halloran CLA 2008-07-15 17:05:36 EDT

*** This bug has been marked as a duplicate of bug 120840 ***
Comment 5 Andrew Niefer CLA 2008-07-15 17:10:07 EDT
I found the enhancement request, see bug 120840.  The majority of the work would be in PDE/Build rather than UI.  There is an automated headless build system built around the build.xml.  The backbone of the automated build are static ant scripts that delegate out to the generated build.xml files.  Supporting a different name on a per-bundle basis would be a major change.