Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [HOW] Setting ANT_HOME properties in runtime
[HOW] Setting ANT_HOME properties in runtime [message #300871] Sat, 18 March 2006 11:39 Go to next message
Eclipse UserFriend
Originally posted by: alexey.kalmykoff.inbox.ru

Hi,

I would like to change ANT_HOME property of Ant plugin from the code. Property changes, but JARs list is still the same (JARs from the old ANT_HOME are in list and they are used by Ant plugin). How can I force Ant plugin to reload/recalculate JARs list and use JARs from new ANT_HOME?

I try to change ANT_HOME using the following code:

AntCorePreferences antPreferences = AntCorePlugin.getPlugin().getPreferences();
antPreferences.setAntHome(...);
antPreferences.updatePluginPreferences ();


Thanks in advance!
Re: [HOW] Setting ANT_HOME properties in runtime [message #300873 is a reply to message #300871] Sat, 18 March 2006 11:59 Go to previous messageGo to next message
Eclipse UserFriend
See the code in AntRuntimePreferencePage.performOk, the AntClasspathPage and
the ClasspathModel
found in org.eclipse.ant.internal.ui.preferences of the org.eclipse.ant.ui
plugin.

Essentially you will need to call
antPreferences.setAntHomeClasspathEntries(IAntClasspathEntry )

HTH
Darins

"Alexey Kalmykoff" <alexey.kalmykoff@inbox.ru> wrote in message
news:6337582.1142699973532.JavaMail.root@cp1.javalobby.org...
> Hi,
>
> I would like to change ANT_HOME property of Ant plugin from the code.
Property changes, but JARs list is still the same (JARs from the old
ANT_HOME are in list and they are used by Ant plugin). How can I force Ant
plugin to reload/recalculate JARs list and use JARs from new ANT_HOME?
>
> I try to change ANT_HOME using the following code:
>
>
> AntCorePreferences antPreferences =
AntCorePlugin.getPlugin().getPreferences();
> antPreferences.setAntHome(...);
> antPreferences.updatePluginPreferences ();
> 

>
> Thanks in advance!
Re: [HOW] Setting ANT_HOME properties in runtime [message #300887 is a reply to message #300873] Sun, 19 March 2006 04:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexey.kalmykoff.inbox.ru

>
> Essentially you will need to call
> antPreferences.setAntHomeClasspathEntries(IAntClasspat
> hEntry)
>

The problem is that AntClasspathEntry (which implements IAntClasspathEntry) is marked as "internal". I would like to avoid relying on "internal" classes. And as far as I can see there is no other way to create AntClasspathEntry object.

AntRuntimePreferencePage, the AntClasspathPage and
the ClasspathModel also use a lot of "internal" structures and functions which are hard to be reused.

Possible solution could be antPreferences.setAntURLs. But it's deprecated. I would like to avoid using deprecated methods.

May be a better solution exists?

Any suggestions would be very appreciated!
Thanks in advance!
Re: [HOW] Setting ANT_HOME properties in runtime [message #300909 is a reply to message #300887] Sun, 19 March 2006 13:30 Go to previous message
Eclipse UserFriend
You are correct in that there is no programmatic way to set the Ant home
classpath entries without using internal or deprecated means.

The API for Ant core and Ant UI is very limited and there are no plans
currently to extend the API

Darins

"Alexey Kalmykoff" <alexey.kalmykoff@inbox.ru> wrote in message
news:33016848.1142762323015.JavaMail.root@cp1.javalobby.org...
> >
> > Essentially you will need to call
> > antPreferences.setAntHomeClasspathEntries(IAntClasspat
> > hEntry)
> >
>
> The problem is that AntClasspathEntry (which implements
IAntClasspathEntry) is marked as "internal". I would like to avoid relying
on "internal" classes. And as far as I can see there is no other way to
create AntClasspathEntry object.
>
> AntRuntimePreferencePage, the AntClasspathPage and
> the ClasspathModel also use a lot of "internal" structures and functions
which are hard to be reused.
>
> Possible solution could be antPreferences.setAntURLs. But it's deprecated.
I would like to avoid using deprecated methods.
>
> May be a better solution exists?
>
> Any suggestions would be very appreciated!
> Thanks in advance!
Previous Topic:occurrences of a word in the file
Next Topic:org.eclipse.search plugin adds unexpected menu/toolbar contribution
Goto Forum:
  


Current Time: Fri May 23 19:55:39 EDT 2025

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

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

Back to the top