Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] Adding source folders programmatically

Hi 

I want to automatically add new (unknown) source folders to an eclipse
project. (CVS update - include new modules created by others automatically).

For that I use the following code:

// new source folder = path
IClasspathEntry cpe = JavaCore.newSourceEntry(path);

/** put current classpath (IClasspathEntry[] oldClasspath =
project.getRawClasspath(); ) 
together with new folder (cpe) in IClasspathEntry[] classpath. then set it:
*/

project.setRawClasspath(classpath, new NullProgressMonitor());


As a result (with elicpse 2.1.1 and 2.1.2), I do not have a new source
folder, but my project is now dependent on another project (name = path
name).

What's wrong here? 

Thanks in advance for help how to do this

Chris

PS: I found 1 posting
(http://dev.eclipse.org/newslists/news.eclipse.tools/msg60431.html), where
the same solution was suggested, and the other guy seemed to be happy with
it. What am I doing wrong? 



Back to the top