Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334950 - Additional tasks to AntRunner
Summary: Additional tasks to AntRunner
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-20 16:27 EST by Suganya Devi CLA
Modified: 2011-01-24 15:24 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Suganya Devi CLA 2011-01-20 16:27:17 EST
Build Identifier: I20100608-0911

I am executing PDE build from the command line (using AntRunner). I have some additional tasks from StarTeam (stcheckout) in my build script. When I run from Eclipse, I include "C:\Program Files\Borland\StarTeam SDK 11.0\Lib\starteam110.jar" in the classpath (External Tools configurations->classpath) and it works fine. When I execute from command-line (AntRunner), I'm contributing the classpath using -lib parameter and its failing with,

"-lib not supported
Configure the Ant runtime classpath using either the global Ant runtime
classpath or the Ant runtime classpath for this particular build"


If I remove the -lib parameter, the build fails with error "Caused by: java.lang.ClassNotFoundException: com.starbase.starteam.File". I even tried setting CLASSPATH (Env Variable). I could not make it work from command-line.

Please let me know how to pass additional tasks to AntRunner?

Reproducible: Always
Comment 1 Andrew Niefer CLA 2011-01-20 16:49:51 EST
This would be the org.eclipse.ant.core.antRunner application.
Comment 2 Michael Rennie CLA 2011-01-21 10:30:31 EST
(In reply to comment #0)
> Please let me know how to pass additional tasks to AntRunner?

Have you tried using the org.eclipse.ant.core.extraClasspathEntries extension point to add your jar to the classpath?

See the help doc entry about it: http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ant_core_extraClasspathEntries.html
Comment 3 Suganya Devi CLA 2011-01-21 10:57:19 EST
(In reply to comment #2)
> (In reply to comment #0)
> > Please let me know how to pass additional tasks to AntRunner?
> 
> Have you tried using the org.eclipse.ant.core.extraClasspathEntries extension
> point to add your jar to the classpath?
> 
> See the help doc entry about it:
> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ant_core_extraClasspathEntries.html

In my case, I have a releng build project which is a regular java project. The build script is inside the releng project. Can you please explain me how this extension can be contributed to my build project (which is not a plug-in)?
Comment 4 Michael Rennie CLA 2011-01-24 12:03:47 EST
(In reply to comment #3)
> In my case, I have a releng build project which is a regular java project. The
> build script is inside the releng project. Can you please explain me how this
> extension can be contributed to my build project (which is not a plug-in)?

If it is not a plug-in I do not know how you would contribute to the extension.

Have you tried using the classpath element in your buildfile?

Something like:

<classpath>
  <pathelement location="C:\Program Files\Borland\StarTeam SDK
11.0\Lib\starteam110.jar">
</classpath>

more info on the classpath element can be found: http://ant.apache.org/manual/using.html in the 'Path-like Structures' section.
Comment 5 Suganya Devi CLA 2011-01-24 14:55:20 EST
(In reply to comment #4)
> (In reply to comment #3)
> > In my case, I have a releng build project which is a regular java project. The
> > build script is inside the releng project. Can you please explain me how this
> > extension can be contributed to my build project (which is not a plug-in)?
> 
> If it is not a plug-in I do not know how you would contribute to the extension.
> 
> Have you tried using the classpath element in your buildfile?
> 
> Something like:
> 
> <classpath>
>   <pathelement location="C:\Program Files\Borland\StarTeam SDK
> 11.0\Lib\starteam110.jar">
> </classpath>
> 
> more info on the classpath element can be found:
> http://ant.apache.org/manual/using.html in the 'Path-like Structures' section.

Thanks, but classpath did not work for me (its not identifying the task). 

But extraClasspathEntries works for me. This is what I did,
- created a plugin org.eclipse.starteam.ant
- created a lib folder and placed starteam110.jar
- contributed org.eclipse.ant.core.extraClasspathEntries
- created plugin jar and placed it in eclipse dropins

Now the required classes are loaded perfectly and the build works fine.

Thank you once again for suggesting 'extraClasspathEntries'
Comment 6 Michael Rennie CLA 2011-01-24 15:24:48 EST
(In reply to comment #5)

> Now the required classes are loaded perfectly and the build works fine.
> 
> Thank you once again for suggesting 'extraClasspathEntries'

Glad you got it working, I am marking the bug as worksforme.