Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Natures and Builders
Natures and Builders [message #172212] Fri, 19 December 2003 03:25 Go to next message
Eclipse UserFriend
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 #172221 is a reply to message #172212] Fri, 19 December 2003 03:55 Go to previous messageGo to next message
Laura Werner is currently offline Laura WernerFriend
Messages: 51
Registered: July 2009
Member
George wrote:
> 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

I don't think the .project file is supposed to have a reference to the
builder. When Eclipse loads a project, it loads the project natures
specified in its .project file. The nature object is supposed to
override configure() and have it add its builder to the project if it's
not already there. I'm not sure where Eclipse stores the builder
information for projects -- probably somehwhere in .metadata.

-- Laura
Re: Natures and Builders [message #172275 is a reply to message #172212] Fri, 19 December 2003 08:22 Go to previous messageGo to next message
Jacques Leclercq is currently offline Jacques LeclercqFriend
Messages: 18
Registered: July 2009
Junior Member
George,

I have had the same kind of problem perhaps, its a good idea to look at

http://dev.eclipse.org/newslists/news.eclipse.tools/msg57107 .html

Jacques

George wrote:

> 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 #172394 is a reply to message #172212] Fri, 19 December 2003 13:13 Go to previous messageGo to next message
Alex Chapiro is currently offline Alex ChapiroFriend
Messages: 82
Registered: July 2009
Member
This is not a problem of the nature association with builder. You are
able to have many natures, associated with your project, but it doesn't
mean that each of them inevitably adds its own set of builders to the
project. Builder information should be stored in .project file. Use
IProjectDescription interface for example when you add your nature to
your project. This is a good moment to remove other builders (if they
were added to the project before) and to instantiate your own builder.

George wrote:

> 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 #172472 is a reply to message #172212] Fri, 19 December 2003 15:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Here's the article on natures and builders:

http://www.eclipse.org/articles/index.html

Tip: Try looking at eclipse org articles for things. There are many good
articles there to answer questions.
--
Thanks, Rich Kulp

Re: Natures and Builders [message #172573 is a reply to message #172472] Fri, 19 December 2003 19:21 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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

Previous Topic:IPageLayout.addNewWizardShortcut
Next Topic:Some basic questions that came up while setting up a workspace for debugging the platform
Goto Forum:
  


Current Time: Fri Dec 27 02:42:30 GMT 2024

Powered by FUDForum. Page generated in 0.03997 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top