Com.eriwen.gradle.js fails with gradle 2.12


(Michael Mikhulya) #1

Plugin com.eriwen.gradle.js fails with following exception after updating to gradle 2.12:

Could not create an instance of type com.eriwen.gradle.js.source.internal.DefaultJavaScriptSourceSet_Decorated.

Caused by: org.gradle.internal.reflect.ObjectInstantiationException: Could not create an instance of type com.eriwen.gradle.js.source.internal.DefaultJavaScriptSourceSet_Decorated.
at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:51)
at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
at com.eriwen.gradle.js.source.internal.DefaultJavaScriptSourceSetContainer.doCreate(DefaultJavaScriptSourceSetContainer.java:25)
at com.eriwen.gradle.js.source.internal.DefaultJavaScriptSourceSetContainer.doCreate(DefaultJavaScriptSourceSetContainer.java:10)
at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:57)
at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:52)
at org.gradle.api.internal.NamedDomainObjectContainerConfigureDelegate._configure(NamedDomainObjectContainerConfigureDelegate.java:39)
at org.gradle.api.internal.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:73)
at build_2qgdrpqlkijmq2azbsvfblyvx$_run_closure10.doCall(/home/mihasik/workspace-aktivo/aktivo/build.gradle:193)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:68)
at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:24)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
at org.gradle.util.ConfigureUtil$configure.call(Unknown Source)
at com.eriwen.gradle.js.JavaScriptExtension.source(JavaScriptExtension.groovy:20)
at com.eriwen.gradle.js.JavaScriptExtension$source.call(Unknown Source)
at build_2qgdrpqlkijmq2azbsvfblyvx.run(/home/mihasik/workspace-aktivo/aktivo/build.gradle:192)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
… 50 more
Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.gradle.api.internal.file.DefaultSourceDirectorySet(java.lang.String, java.lang.String, org.gradle.api.internal.file.BaseDirFileResolver)
at com.eriwen.gradle.js.source.internal.DefaultJavaScriptSourceSet.(DefaultJavaScriptSourceSet.groovy:26)
at com.eriwen.gradle.js.source.internal.DefaultJavaScriptSourceSet_Decorated.(Unknown Source)
at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:49)
… 71 more

We use only JSHint exactly as described in documentation:


(Stefan Oehme) #2

Please open a bug report against that plugin, they are using Gradle internal APIs.


(Lance Java) #3

In future, the plugin author could switch to using the SourceDirectorySetFactory as discussed [here] (DefaultSourceDirectorySet Alternative)


(René Groeschke) #4

just for completeness be aware that SourceDirectorySetFactory is part of the internal api, which should be avoided in general. Though I understand how tempting it is to use it.

cheers,
René


(Eric Wendelin) #5

Thanks for the heads up. I will submit a patch for this as soon as I am legally allowed to do so.

In the meantime, anyone can patch the plugin using a similar method to this: https://github.com/trello/victor/commit/53ac2519f2706f9ed2a4257fd5a02e110931930f?diff=unified applied here: https://github.com/eriwen/gradle-js-plugin/blob/master/src/main/groovy/com/eriwen/gradle/js/source/internal/DefaultJavaScriptSourceSet.groovy#L26

Cheers,
Eric