Natures and Builders [message #172212] |
Fri, 19 December 2003 03:25 |
Eclipse User |
|
|
|
Originally posted by: GeorgeBaby.comcast.net
I'm creating a plugin to manage projects of a new type. I'd like to use my
own builder type, but when I create a project (and have the wizard add the
nature), no reference to the builder shows up in the .project file, just the
nature is shown. I'm assuming that I don't have the nature properly
associated with the builder, but I can't tell what I've done wrong. I've
tried many variations (qualifing the builder reference in the nature with
the project id, or not qualifying it; using hasNature as true/false or
omitted altogether, and never get a builder).
Could someone point out my error?
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>a1</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>packagebuilder.OVPIPackageNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<plugin
id="packagebuilder"
name="%OVPI"
version="0.0.1">
<extension
id="OVPIPackageNature"
name="%OVPIPackageNature"
point="org.eclipse.core.resources.natures">
<runtime>
<run
class="xxx.natures.BuilderNature">
</run>
</runtime>
<builder
id="packagebuilder.PackageBuilder">
</builder>
</extension>
<extension
id="PackageBuilder"
name="%OVPIBuilder"
point="org.eclipse.core.resources.builders">
<builder hasNature="true">
<run
class="xxx.builders.PackageBuilder">
</run>
</builder>
</extension>
</plugin>
|
|
|
|
|
|
|
Re: Natures and Builders [message #172573 is a reply to message #172472] |
Fri, 19 December 2003 19:21 |
Eclipse User |
|
|
|
Originally posted by: GeorgeBaby.comcast.net
Yup -- I've read the article.
I was adding the nature by putting it in the project description at the time
I created the project. It seems that if I do this, configure is never
called. Instead, I am now adding the BuildCommand directly in the project
creation wizard -- with that change, it gets added as a buildCommand.
|
|
|
Re: Natures and Builders [message #172596 is a reply to message #172573] |
Fri, 19 December 2003 19:39 |
Eclipse User |
|
|
|
Originally posted by: richkulp.NO.SPAM.us.ibm.com
I have nature that gets added later, after creation, and in the nature's
config() method I add the builder. In this case the nature's config
method is called, and so the nature adds the builder. The deconfig()
method removes the builder. This works.
Actually I think it may be a bug, but if you use the
IProject.create(projectDescription,...) with a nature already in the
description, it won't run the nature's config() method. It only runs the
nature's config method on IProject.setDescription on an existing
project. To me this is wrong because it doesn't give the nature a chance
to config things.
--
Thanks, Rich Kulp
|
|
|
Re: Natures and Builders [message #179475 is a reply to message #172596] |
Tue, 13 January 2004 22:57 |
Eclipse User |
|
|
|
Originally posted by: John_Arthorne.oti.com_
See "more on nature lifecycle" at the end of my nature/builder article.
--
Rich Kulp wrote:
> I have nature that gets added later, after creation, and in the nature's
> config() method I add the builder. In this case the nature's config
> method is called, and so the nature adds the builder. The deconfig()
> method removes the builder. This works.
>
> Actually I think it may be a bug, but if you use the
> IProject.create(projectDescription,...) with a nature already in the
> description, it won't run the nature's config() method. It only runs the
> nature's config method on IProject.setDescription on an existing
> project. To me this is wrong because it doesn't give the nature a chance
> to config things.
>
>
|
|
|
Re: Natures and Builders [message #179869 is a reply to message #179475] |
Wed, 14 January 2004 14:57 |
Eclipse User |
|
|
|
Originally posted by: richkulp.NO.SPAM.us.ibm.com
OK. I see and understand what you are saying in the article. It would be
good though if the javadoc for create itself says this because without
your explanation in the article it wasn't clear at all that (1) it
didn't call configure and (2) why it isn't smart to call configure for
create itself and (3) if you really want configure to be called when
creating a brand new project, to add the nature AFTER the create is done.
John Arthorne wrote:
> See "more on nature lifecycle" at the end of my nature/builder article.
> --
--
Thanks, Rich Kulp
|
|
|
Re: Natures and Builders [message #180027 is a reply to message #179869] |
Wed, 14 January 2004 17:45 |
Eclipse User |
|
|
|
Originally posted by: John_Arthorne.oti.com_
This is from the javadoc of IProject.create:
* If there is an existing project description file, it is not
overwritten. In either
* case, this method does not cause natures to be configured.
--
Rich Kulp wrote:
>
> OK. I see and understand what you are saying in the article. It would be
> good though if the javadoc for create itself says this because without
> your explanation in the article it wasn't clear at all that (1) it
> didn't call configure and (2) why it isn't smart to call configure for
> create itself and (3) if you really want configure to be called when
> creating a brand new project, to add the nature AFTER the create is done.
>
> John Arthorne wrote:
>
>> See "more on nature lifecycle" at the end of my nature/builder article.
>> --
>
>
|
|
|
Re: Natures and Builders [message #180065 is a reply to message #180027] |
Wed, 14 January 2004 19:22 |
Eclipse User |
|
|
|
Originally posted by: richkulp.NO.SPAM.us.ibm.com
A year ago, which is the last time I needed to do this kind of stuff,
and the last time I looked at it, it didn't say that. :-) The additional
comment had been added since then.
However, it doesn't really stand out and can be easily missed in the
comment. And it wasn't clear why this was important to not configure
them. That would be nice to know.
--
Thanks, Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03997 seconds