Skip to content
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.

MinifyJsTask doesn't work from an included file #61

Open
esycat opened this issue Mar 25, 2013 · 4 comments
Open

MinifyJsTask doesn't work from an included file #61

esycat opened this issue Mar 25, 2013 · 4 comments

Comments

@esycat
Copy link

esycat commented Mar 25, 2013

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.
@ghost ghost assigned eriwen Apr 6, 2013
@clalbus
Copy link

clalbus commented Dec 17, 2013

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.

@esycat
Copy link
Author

esycat commented Dec 25, 2013

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.

@esycat
Copy link
Author

esycat commented Feb 22, 2014

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

@benweizhu
Copy link

Same issue.

@eriwen eriwen removed their assignment Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants