runtime error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

runtime error

Ittay Dror
I run gradle -t -s where the build.gradle file just imports my plugin. I
get this:

Caused by: java.lang.NullPointerException
    at
org.gradle.api.plugins.DefaultConventionsToPropertiesMapping$__clinit__closure39.doCall(DefaultConventionsToPropertiesMapping.groovy)
    at
org.gradle.api.internal.ConventionAwareHelper.getValue(ConventionAwareHelper.groovy:58)
    at
org.gradle.api.internal.ConventionTask.getProperty(ConventionTask.groovy:39)
    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy:87)
    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy)
    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy)


The plugin's code is a copy of JavaPlugin except that it sets different
convention object (just rename)

Ittay

--
--
Ittay Dror <[hidden email]>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: runtime error

Ittay Dror
The error seems to be from using 'it.plugins.java' in several places.
since my build.gradle file doesn't use the java plugin, this is null.

I think fixing this requires creating a DefaultConvention object.

Thanks,
Ittay

Ittay Dror wrote:

> I run gradle -t -s where the build.gradle file just imports my plugin.
> I get this:
>
> Caused by: java.lang.NullPointerException
>    at
> org.gradle.api.plugins.DefaultConventionsToPropertiesMapping$__clinit__closure39.doCall(DefaultConventionsToPropertiesMapping.groovy)
>
>    at
> org.gradle.api.internal.ConventionAwareHelper.getValue(ConventionAwareHelper.groovy:58)
>
>    at
> org.gradle.api.internal.ConventionTask.getProperty(ConventionTask.groovy:39)
>
>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy:87)
>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy)
>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy)
>
>
> The plugin's code is a copy of JavaPlugin except that it sets
> different convention object (just rename)
>
> Ittay
>

--
--
Ittay Dror <[hidden email]>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: runtime error

Ittay Dror
correction, i think that DefaultConventionsToPropertiesMapping should
work through the property resolution of the convention object, and not
directly point to a plugin's convention object. so if a plugin's
convention object will have the property, it will be picked up
automatically.

then, having a DefaultConvention will help in reusing property names in
plugins.

ittay

Ittay Dror wrote:

> The error seems to be from using 'it.plugins.java' in several places.
> since my build.gradle file doesn't use the java plugin, this is null.
>
> I think fixing this requires creating a DefaultConvention object.
>
> Thanks,
> Ittay
>
> Ittay Dror wrote:
>> I run gradle -t -s where the build.gradle file just imports my
>> plugin. I get this:
>>
>> Caused by: java.lang.NullPointerException
>>    at
>> org.gradle.api.plugins.DefaultConventionsToPropertiesMapping$__clinit__closure39.doCall(DefaultConventionsToPropertiesMapping.groovy)
>>
>>    at
>> org.gradle.api.internal.ConventionAwareHelper.getValue(ConventionAwareHelper.groovy:58)
>>
>>    at
>> org.gradle.api.internal.ConventionTask.getProperty(ConventionTask.groovy:39)
>>
>>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy:87)
>>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy)
>>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy)
>>
>>
>> The plugin's code is a copy of JavaPlugin except that it sets
>> different convention object (just rename)
>>
>> Ittay
>>
>

--
--
Ittay Dror <[hidden email]>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Re: runtime error

hans_d
Administrator
Hi Ittay,

On Jun 19, 2008, at 5:56 PM, Ittay Dror wrote:

> correction, i think that DefaultConventionsToPropertiesMapping  
> should work through the property resolution of the convention  
> object, and not directly point to a plugin's convention object. so  
> if a plugin's convention object will have the property, it will be  
> picked up automatically.
>
> then, having a DefaultConvention will help in reusing property  
> names in plugins.

So far I have seen the DefaultConventionToPropertiesMapping as  
DefaultJavaConventionToPropertiesMapping. Therefore I have  
intentionally used the explicit namespace of the Java plugin  
(it.plugins.java.testClassesDir instead of it.testClassesDir). My  
idea was that to prevent namespace conflicts with other additional  
plugins. You need the opposite behavior. We are back to our last  
discussion that there should be some default convention object. But  
it is good to have this use cases before the implementation of the  
new plugin system. There are may ugly ways to make it run ;) You  
might add your convention object additionally to the java namespace.

- Hans


>
> ittay
>
> Ittay Dror wrote:
>> The error seems to be from using 'it.plugins.java' in several  
>> places. since my build.gradle file doesn't use the java plugin,  
>> this is null.
>>
>> I think fixing this requires creating a DefaultConvention object.
>>
>> Thanks,
>> Ittay
>>
>> Ittay Dror wrote:
>>> I run gradle -t -s where the build.gradle file just imports my  
>>> plugin. I get this:
>>>
>>> Caused by: java.lang.NullPointerException
>>>    at org.gradle.api.plugins.DefaultConventionsToPropertiesMapping
>>> $__clinit__closure39.doCall
>>> (DefaultConventionsToPropertiesMapping.groovy)
>>>    at org.gradle.api.internal.ConventionAwareHelper.getValue
>>> (ConventionAwareHelper.groovy:58)
>>>    at org.gradle.api.internal.ConventionTask.getProperty
>>> (ConventionTask.groovy:39)
>>>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy:87)
>>>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy)
>>>    at org.gradle.api.tasks.bundling.Bundle.jar(Bundle.groovy)
>>>
>>>
>>> The plugin's code is a copy of JavaPlugin except that it sets  
>>> different convention object (just rename)
>>>
>>> Ittay
>>>
>>
>
> --
> --
> Ittay Dror <[hidden email]>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email