ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47830] New: Hanlde servral ProjectHelper and default file support
Date Sun, 13 Sep 2009 14:38:43 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47830

           Summary: Hanlde servral ProjectHelper and default file support
           Product: Ant
           Version: 1.8Alpha (nightly)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: nicolas.lalevee@hibnet.org


Here is a patch as discussed here:
http://mail-archives.apache.org/mod_mbox/ant-dev/200908.mbox/%3c200908311042.48291.nicolas.lalevee@hibnet.org%3e

I didn't committed it directly as there will be a release really soon and I
don't want to break anything and then force this new feature to be in that
release.

So there is now a ProjectHelperRepository which is responsible to gather every
declared implementation of ProjectHelper in the classpath. The default
ProjectHelper will be the first found in the classpath. And this repository
will never be empty as the ProjectHelper2 will always be added at the last
position.

I did some a few test with another implemetation of ProjectHelper that read
groovy files. Everything works like a charm execept one case: 
* simple launch of ant : the default helper is the groovy one : OK
* ant -f build.xml : the helper used is the ProjectHelper2 : OK
* in the build.gant I put an ant task without specifying any build file: the
build.xml is taken: OK
* in the build.gant I put an gant task without specifying any build file: I
got:

BUILD FAILED
java.lang.NullPointerException
    at org.hibnet.gant.GroovyRunner.run(GroovyRunner.java:38)
    at org.hibnet.gant.GantTarget.execute(GantTarget.java:42)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
    at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
    at org.apache.tools.ant.Main.runBuild(Main.java:777)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: :
java.lang.NullPointerException
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:92)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
    at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:248)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756)
    at
groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
    at org.hibnet.gant.GantMetaClass.invokeMethod(GantMetaClass.java:40)
    at groovy.lang.Closure.call(Closure.java:292)
    at groovy.lang.Closure.call(Closure.java:287)
    at org.hibnet.gant.GantTarget$1.doRun(GantTarget.java:45)
    at org.hibnet.gant.GroovyRunner.run(GroovyRunner.java:32)
    ... 10 more
Caused by: : java.lang.NullPointerException
    at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:199)
    at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:153)
    at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:149)
    at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
    at org.hibnet.gant.GantMetaClass.invokeMethod(GantMetaClass.java:43)
    at
org.hibnet.gant.GantScriptMetaClass.invokeMethod(GantScriptMetaClass.java:54)
    at org.hibnet.gant.GantMetaClass.invokeMethod(GantMetaClass.java:58)
    at
groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)
    at groovy.lang.Script.invokeMethod(Script.java:78)
    at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:371)
    at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:322)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756)
    at
groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
    at org.hibnet.gant.GantMetaClass.invokeMethod(GantMetaClass.java:40)
    at org.hibnet.gant.GantMetaClass.invokeMethod(GantMetaClass.java:73)
    at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)
    at build$_run_closure1.doCall(build.gant:12)
    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:597)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
    at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:248)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756)
    at
groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:142)
    at org.hibnet.gant.GantMetaClass.invokeMethod(GantMetaClass.java:40)
    at org.hibnet.gant.GantMetaClass.invokeMethod(GantMetaClass.java:73)
    at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:78)
    at build$_run_closure1.doCall(build.gant)
    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:597)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
    ... 19 more
Caused by: java.lang.NullPointerException
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:380)
    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:597)
    at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    ... 55 more

I didn't look closely but it is probably a bug in my groovy frontend.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message