Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ant-dev] Howto develop External Tools?

On 11/15/2002 12:36:39 PM platform-ant-dev-admin wrote:
> 
> What errors do you see? I do not have any? 
> 

I had forgotten to create a project for org.apache.ant which the 
org.eclipse.ant.core plugin requires as a relative path (i.e Update 
classpath doesn't help here as its not a plugin dependency)

This is what I ended up doing that works:

1) Checked out from CVS as project org.eclipse.ant.core, org.apache.ant, 
org.eclipse.ui.externaltools
2) Right clicked on plugin.xml(s) to "Update classpaths"
3) Right clicked on plugin.xml to Create plugin Jars for externaltools and 
ant.core
4) Run ant on genereated build.xml from (3)
5) Setup my runtime-workbench to use all plugins except those as projects 
in my workspace.
6) Ran/Debug as Run-time workbench
7) Found a bug =)

Of course, since I don't have any other platform plugins as projects in my 
workspace, I can't debug into those other plugins, but hopefully the code 
is encapsulated enough that I won't have to ;-)

On (7):
It seems AntProcessBuildLogger.getHyperLink() throws a null pointer 
exception when the location is a relative path - which it can be in 
externally parsed entities
For example, say I have a build file which does something like:

<!DOCTYPE project PUBLIC "-//ANT//DTD project//EN" 
"file:../../Build/ant/ant.dtd" [
   <!ENTITY build-driver SYSTEM "file:../../Build/ant/build-driver.xml">
]>

<project name="foo" default="all">
        <!-- Pulls in common build settings -->
        &build-driver;
</project>

If a task in build-driver gets executed, the task passed to the 
BuildLogger will have it Location's path equal to "../../Build/ant/build-driver.xml:LINE", and since relativity is being 
determined relative to the workbench's CWD (?) instead of the location of 
the build file, we get a null IFile, and thus the exception below. 
Solution, check if a relative path, and make relative to the buildfile's 
location.

java.lang.NullPointerException
        at 
org.eclipse.ui.externaltools.internal.ant.logger.AntProcessBuildLogger.getHyperLink(AntProcessBuildLogger.java:136)
        at 
org.eclipse.ui.externaltools.internal.ant.logger.AntProcessBuildLogger.logMessage(AntProcessBuildLogger.java:100)
        at 
org.eclipse.ui.externaltools.internal.ant.logger.AntProcessBuildLogger.messageLogged(AntProcessBuildLogger.java:179)
        at 
org.apache.tools.ant.Project.fireMessageLoggedEvent(Project.java:1967)
        at 
org.apache.tools.ant.Project.fireMessageLogged(Project.java:2012)
        at org.apache.tools.ant.Project.log(Project.java:394)
        at org.apache.tools.ant.Task.log(Task.java:302)
        at org.apache.tools.ant.taskdefs.Echo.execute(Echo.java:89)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at 
com.i2.logistics.build.ant.taskdefs.CallTarget.execute(CallTarget.java:152)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:166)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at 
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:528)
        at 
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:331)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.ant.core.AntRunner.run(AntRunner.java:312)
        at org.eclipse.ant.core.AntRunner.run(AntRunner.java:380)
        at 
org.eclipse.ui.externaltools.internal.ant.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:145)
        at java.lang.Thread.run(Thread.java:536)
Matt



Back to the top