Bug 14284 - Builder not run after changing project nature
Summary: Builder not run after changing project nature
Status: RESOLVED DUPLICATE of bug 12977
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-20 17:25 EDT by Felix Wong CLA
Modified: 2002-04-29 12:29 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Wong CLA 2002-04-20 17:25:10 EDT
Build 20020412

I have to change the project nature because I have to workaround a problem.

1. I have create a simple project SP1
2. Copy a Java project from Eclipse 1.0 and its files from another directory 
into SP1
3. Since the Java project does not contain the .project file from Eclipse 1.0, I 
have to manually change the .project and add the java builder and java nature.
4. The project does not get built even tried Rebuild Project and Build All.
5. Finally, I have to create a new java files and the project starts building.
Comment 1 Kent Johnson CLA 2002-04-24 13:31:42 EDT
John: Does the BuildManager perform a full or incremental build in this case?

What other .metafiles should I look for deltas?
Comment 2 John Arthorne CLA 2002-04-24 14:27:13 EDT
If autobuild is on, editing the .project file should trigger an incremental 
build.  The very first build for a builder will have a null delta (eg, 
immediately after adding it to the .project file), but the build "kind" may 
still be incremental.  If this isn't happening, please move the PR to me and I 
will investigate.

The "Rebuild All" or "Rebuild Project" actions trigger full builds, and the 
"Build All" or "Build Project" actions trigger incremental builds.

I'm not sure I understand your second question... I don't think the java builder 
needs to know about any .metadata files created by core.
Comment 3 Kent Johnson CLA 2002-04-24 14:56:21 EDT
Since the Java builder shouldn't have to look for .project changes... its all 
yours John. ;)
Comment 4 John Arthorne CLA 2002-04-25 16:18:30 EDT
The builder gets invoked, but it is not configured properly (I guess because the 
.classpath file hasn't been created yet), so it doesn't build anything.  Here 
are my steps:

1) Create a simple project S1
2) Add file A.java to S1 with valid java file contents
3) Edit the .project for S1, and change the buildspec and natures as follows:

<buildSpec>
	<buildCommand>
		<name>org.eclipse.jdt.core.javabuilder</name>
		<arguments>
		</arguments>
	</buildCommand>
</buildSpec>
<natures>
	<nature>org.eclipse.jdt.core.javanature</nature>
</natures>

4) Save this .project file.  This triggers the Java builder to run, but it has 
not configured its build path, so it doesn't compile A.java.

Philippe, I believe there was a discussion about this recently in another bug 
report.  JDT Core should listen for changes to project descriptions, and then 
configure the .classpath correctly when the java nature is added to the 
description.  The one wrinkle is if the JDT Core plugin isn't activated yet.  In 
that case the creation of the java builder will cause the JDT Core plugin to be 
activated, at which point it is too late for a resource change listener to do 
appropriate initialization.
Comment 5 John Arthorne CLA 2002-04-25 16:23:53 EDT
See also bug 12977.
Comment 6 John Arthorne CLA 2002-04-29 12:29:59 EDT
This is a particular symptom of the general problem described in 12977.  Once 
that is fixed, builders should run with no problem.

*** This bug has been marked as a duplicate of 12977 ***