javanature and .classpath [message #81062] |
Mon, 28 July 2003 18:06  |
Eclipse User |
|
|
|
THE SETUP:
----------
We have a proprietary file format. We also have a tool which parses files
in teh proprietary format and produces .java source files.
One goal we have is to create/modify the proprietary files in Eclipse,
then run the generation tool to obtain Java source, and finally compile
the Java source.
ATTEMPTED SOLUTION:
-------------------
We have added our own 'New Project' Wizard to Eclipse, along with our own
project Nature. However, it seems reasonable to add the
org.eclipse.jdt.core.javanature as well, in order to leverage existing
code to perform the Java compilation.
ISSUE:
------
Experimentation reveals that the builder for the JDT relies on the
project's .classpath file to figure out what it should do. So one
question is:
Where can I find documentation about the .classpath file?
I've noticed (and reading the 'Help' confirms) that the JDT builder wants
to copy all non-Java files it finds in the 'source' directory(ies) to the
output folder. This is maddening. So another question is:
Isn't there some way to turn this off?
The only approach I've seen so far is to explicitly exclude
files/patterns. This seems to be a rather limited/limiting approach.
Does the XML markup allow me to turn off this behavior, even if the UI
within Eclipse does not?
Thanks,
--dave
|
|
|
|
Re: javanature and .classpath [message #81509 is a reply to message #81404] |
Tue, 29 July 2003 13:33   |
Eclipse User |
|
|
|
I'm trying to avoid messing with the classpath programmatically. It seems
I shouldn't need to. Our projects will be set up in such a way that the
end user has no choice about the classpath definition, so I want to write
an appropriate .classpath file as part of the 'New Project' setup, and
then forget about it.
I want to know whether it is possible to write the .classpath file in such
a way that the javabuilder WON'T copy all of the non-Java resources it
finds to the output folder. I understand that I can add a series of tags
like this:
<classpathentry excluding="**/*.foo" kind="src" path="java/src"/>
but this is cumbersome.
If there is no better way of handling it, that's fine, I just thought I'd
ask.
--dave
Anou Manavalan wrote:
> Get the classpath entries from the JavaProject. Look at the help files for
> IClasspathEntry and IJavaProject to see more.
> IProject project
> --------
> IJavaElement jElement = JavaCore.create((IResource) (project));
> IJavaProject jProject = jElement.getJavaProject();
> IClasspathEntry cpEntries[];
> cpEntries = jProject.getResolvedClasspath(true);
> -Anou
> "David Bailey" <david.bailey@lawson.com> wrote in message
> news:bg46pr$frr$1@eclipse.org...
> > THE SETUP:
> > ----------
> > We have a proprietary file format. We also have a tool which parses files
> > in teh proprietary format and produces .java source files.
> >
> > One goal we have is to create/modify the proprietary files in Eclipse,
> > then run the generation tool to obtain Java source, and finally compile
> > the Java source.
> >
> > ATTEMPTED SOLUTION:
> > -------------------
> > We have added our own 'New Project' Wizard to Eclipse, along with our own
> > project Nature. However, it seems reasonable to add the
> > org.eclipse.jdt.core.javanature as well, in order to leverage existing
> > code to perform the Java compilation.
> >
> > ISSUE:
> > ------
> > Experimentation reveals that the builder for the JDT relies on the
> > project's .classpath file to figure out what it should do. So one
> > question is:
> >
> > Where can I find documentation about the .classpath file?
> >
> > I've noticed (and reading the 'Help' confirms) that the JDT builder wants
> > to copy all non-Java files it finds in the 'source' directory(ies) to the
> > output folder. This is maddening. So another question is:
> >
> > Isn't there some way to turn this off?
> >
> > The only approach I've seen so far is to explicitly exclude
> > files/patterns. This seems to be a rather limited/limiting approach.
> > Does the XML markup allow me to turn off this behavior, even if the UI
> > within Eclipse does not?
> >
> > Thanks,
> >
> > --dave
> >
|
|
|
Re: javanature and .classpath [message #86414 is a reply to message #81509] |
Tue, 19 August 2003 09:10  |
Eclipse User |
|
|
|
Dave,
Writing a .classpath file or changing the classpath through
IJavaProject.setRawClasspath(...) is equivalent. The format of the
..classpath file is proprietary and subject to change. The recommended way to
write it is to use the API.
If you want to exclude non-Java resources from being copied to the output
folder, use Windows->Preferences->Java->Compiler->Build Path->Filtered
Resources.
If you want to do it programatically, see JavaCore.setOptions(...) or
IJavaProject.setOptions(...) using the
'org.eclipse.jdt.core.builder.resourceCopyExclusionFilter' option id
(described in JavaCore.getDefaultOptions()).
Jerome
"David Bailey" <david.bailey@lawson.com> wrote in message
news:bg6b54$mvh$1@eclipse.org...
> I'm trying to avoid messing with the classpath programmatically. It seems
> I shouldn't need to. Our projects will be set up in such a way that the
> end user has no choice about the classpath definition, so I want to write
> an appropriate .classpath file as part of the 'New Project' setup, and
> then forget about it.
>
> I want to know whether it is possible to write the .classpath file in such
> a way that the javabuilder WON'T copy all of the non-Java resources it
> finds to the output folder. I understand that I can add a series of tags
> like this:
>
> <classpathentry excluding="**/*.foo" kind="src" path="java/src"/>
>
> but this is cumbersome.
>
> If there is no better way of handling it, that's fine, I just thought I'd
> ask.
>
> --dave
>
> Anou Manavalan wrote:
>
> > Get the classpath entries from the JavaProject. Look at the help files
for
> > IClasspathEntry and IJavaProject to see more.
>
> > IProject project
>
> > --------
>
> > IJavaElement jElement = JavaCore.create((IResource) (project));
>
> > IJavaProject jProject = jElement.getJavaProject();
>
>
> > IClasspathEntry cpEntries[];
>
> > cpEntries = jProject.getResolvedClasspath(true);
>
>
>
> > -Anou
>
>
>
> > "David Bailey" <david.bailey@lawson.com> wrote in message
> > news:bg46pr$frr$1@eclipse.org...
> > > THE SETUP:
> > > ----------
> > > We have a proprietary file format. We also have a tool which parses
files
> > > in teh proprietary format and produces .java source files.
> > >
> > > One goal we have is to create/modify the proprietary files in Eclipse,
> > > then run the generation tool to obtain Java source, and finally
compile
> > > the Java source.
> > >
> > > ATTEMPTED SOLUTION:
> > > -------------------
> > > We have added our own 'New Project' Wizard to Eclipse, along with our
own
> > > project Nature. However, it seems reasonable to add the
> > > org.eclipse.jdt.core.javanature as well, in order to leverage existing
> > > code to perform the Java compilation.
> > >
> > > ISSUE:
> > > ------
> > > Experimentation reveals that the builder for the JDT relies on the
> > > project's .classpath file to figure out what it should do. So one
> > > question is:
> > >
> > > Where can I find documentation about the .classpath file?
> > >
> > > I've noticed (and reading the 'Help' confirms) that the JDT builder
wants
> > > to copy all non-Java files it finds in the 'source' directory(ies) to
the
> > > output folder. This is maddening. So another question is:
> > >
> > > Isn't there some way to turn this off?
> > >
> > > The only approach I've seen so far is to explicitly exclude
> > > files/patterns. This seems to be a rather limited/limiting approach.
> > > Does the XML markup allow me to turn off this behavior, even if the UI
> > > within Eclipse does not?
> > >
> > > Thanks,
> > >
> > > --dave
> > >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03132 seconds