Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » custom ant build script: how to get the project's classpath ?
custom ant build script: how to get the project's classpath ? [message #478694] Thu, 06 August 2009 12:39 Go to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 35
Registered: July 2009
Member
Hello,

I searched the archives and just found this subject discussed about once or twice in 2005.

I want to run a custom ant build script after the java builder. This ant build script will have to call some targets that need the project's classpath ?

Back in 2005 it was considered an interesting idea, but not possible at that time.

Is there a possibility to do so now ?

Thanks in advance for your answers,

--
Laurent Petit
Re: custom ant build script: how to get the project's classpath ? [message #478767 is a reply to message #478694] Thu, 06 August 2009 18:51 Go to previous messageGo to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 35
Registered: July 2009
Member
Hi,

Replying to myself since I may well have found a solution (more by chance than by a rational approach to google / documentation browsing etc. :-).

by making my ant script "run inside the same JVM as eclipse", I have access to a lot of interesting (though undocumented) task.

Among them : eclipsetools.getclasspath

Which I found can be used as :

<eclipsetools.getclasspath javaproject="<my-eclipse-project-name>" property="build.ide.classpath" />

and then use it to create a classpath:

<path id="project.classpath">
<pathelement path="${build.ide.classpath}" />
...
</path>

Of course, since I now have asked my script to execute from within eclipse,

* I can no longer use it headless but I don't care because I already have an headless build with custom targets :-)
* I must be careful using the fork="true" attribute when I call the java task.

Regards,

--
Laurent

Laurent Petit wrote:
> Hello,
>
> I searched the archives and just found this subject discussed about once
> or twice in 2005.
>
> I want to run a custom ant build script after the java builder. This ant
> build script will have to call some targets that need the project's
> classpath ?
>
> Back in 2005 it was considered an interesting idea, but not possible at
> that time.
>
> Is there a possibility to do so now ?
>
> Thanks in advance for your answers,
>
Re: custom ant build script: how to get the project's classpath ? [message #478839 is a reply to message #478767] Fri, 07 August 2009 08:21 Go to previous messageGo to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 35
Registered: July 2009
Member
Laurent Petit wrote:
> Hi,
>
> Replying to myself since I may well have found a solution (more by
> chance than by a rational approach to google / documentation browsing
> etc. :-).
>
> by making my ant script "run inside the same JVM as eclipse", I have
> access to a lot of interesting (though undocumented) task.
>
> Among them : eclipsetools.getclasspath
>
> Which I found can be used as :
>
> <eclipsetools.getclasspath javaproject="<my-eclipse-project-name>"
> property="build.ide.classpath" />
>
> and then use it to create a classpath:
>
> <path id="project.classpath">
> <pathelement path="${build.ide.classpath}" />
> ...
> </path>
>
> Of course, since I now have asked my script to execute from within eclipse,
>
> * I can no longer use it headless but I don't care because I already
> have an headless build with custom targets :-)
> * I must be careful using the fork="true" attribute when I call the
> java task.
>
> Regards,
>
Re: custom ant build script: how to get the project's classpath ? [message #478840 is a reply to message #478767] Fri, 07 August 2009 08:22 Go to previous message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 35
Registered: July 2009
Member
My bad, I didn't verify the "provider" of this "eclipsetools.getclasspath".

It was provided by a commercial licensed product, so it's not at all the solution I was looking for.

Still searching ....

--
Laurent

Laurent Petit wrote:
> Hi,
>
> Replying to myself since I may well have found a solution (more by
> chance than by a rational approach to google / documentation browsing
> etc. :-).
>
> by making my ant script "run inside the same JVM as eclipse", I have
> access to a lot of interesting (though undocumented) task.
>
> Among them : eclipsetools.getclasspath
>
> Which I found can be used as :
>
> <eclipsetools.getclasspath javaproject="<my-eclipse-project-name>"
> property="build.ide.classpath" />
>
> and then use it to create a classpath:
>
> <path id="project.classpath">
> <pathelement path="${build.ide.classpath}" />
> ...
> </path>
>
> Of course, since I now have asked my script to execute from within eclipse,
>
> * I can no longer use it headless but I don't care because I already
> have an headless build with custom targets :-)
> * I must be careful using the fork="true" attribute when I call the
> java task.
>
> Regards,
>
Previous Topic:NPE on software update
Next Topic:Property page vs preference page
Goto Forum:
  


Current Time: Tue Mar 19 08:49:59 GMT 2024

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

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

Back to the top