node-gradle / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
602 stars 118 forks source link

NpmTask is abstract #175

Closed Mazorius closed 3 years ago

Mazorius commented 3 years ago

Why do you need to define the NpmTask as abstract?

The ObjectFactory and ProviderFactory are provided by the project during the apply prozess.

project.objects && project.providers

deepy commented 3 years ago

The reason it was changed to be abstract was to support the configuration-cache (see https://github.com/node-gradle/gradle-node-plugin/issues/111 for full history) and still be compatible with Gradle 5.

Out of curiosity, why do you need it to be concrete?

Mazorius commented 3 years ago

I tried to create an open class task which breaks with null-pointer exceptions. I thought it is the case due to the abstract task.

But if this is due to compatibility this is fine for me.

Maybe my skills are not good enough :-)

Thanks

deepy commented 3 years ago

It's been a while so I can't comment much on the implementation, but in your case, does your class need to be a concrete class?

Even if your task is abstract you should still be able to register/create it as before in the build

Mazorius commented 3 years ago

I will try this :-) Thanks a lot.

Due to the fact that is not a issue more a miss-understanding from my side I will close this issue.