MinifyJsTask doesn't work from an included file
It seems that something goes wrong with CompilerOptions instance if a task of MinifyJsTask type is defined in a standalone file that is then included via apply from.
Please, check this example: https://dl.dropbox.com/u/1571429/devroom/gradle-js-test.tar
buildAlt task uses minifyJsLocal task that is defined right in build.gradle and it does work properly. But build, which depends on minifyJsExtermal from commons/minify.gradle, produces the following exception:
Execution failed for task ':minifyJsExtermal'.
> No signature of method: com.eriwen.gradle.js.JsMinifier.minifyJsFile() is applicable for argument types: (java.util.LinkedHashSet, java.util.LinkedHashSet, java.io.File, com.google.javascript.jscomp.CompilerOptions, java.lang.String, java.lang.String) values: [[/Volumes/Users/esycat/tmp/gradle-js-test/js/main.js], ...]
Possible solutions: minifyJsFile(java.util.Set, java.util.Set, java.io.File, com.google.javascript.jscomp.CompilerOptions, java.lang.String, java.lang.String)
The following classes appear as argument class and as parameter class, but are defined by different class loader:
com.google.javascript.jscomp.CompilerOptions (defined by 'org.gradle.util.MutableURLClassLoader@7f3846fc' and 'org.gradle.util.MutableURLClassLoader@6574f7a7')
If one of the method suggestions matches the method you wanted to call,
then check your class loader setup.
Hi @eriwen,
I have also run into this issue (in a multi-project setup).
Do you have any timelines in mind for this fix? If not, are there any workarounds?
Thanks.
I've moved the test code: https://gist.github.com/esycat/8122571 Still and issue with v1.9 of the plugin and Gradle v1.10.
It seems a workaround for this is to apply the plugin by class name instead of the extension name (i.e. JsPlugin instead of 'js') inside the includable file. An example:
https://github.com/esycat/devops/blob/master/gradle/project/minify.gradle
Same issue.