oyvinmar / grails-closure-compiler

Grails Resources Plugin for Google Closure Compiler
Other
7 stars 6 forks source link

Plugin scans grails plugins and warnings cannot be surpressed from startup logs #11

Open alanmosely opened 10 years ago

alanmosely commented 10 years ago

Hi, thanks for the excellent plugin, we are currently facing two issues that are dirtying our production logs on startup.

The first issue is that the plugin is scanning some js from various grails resources/plugins and I don't see how we can exclude them, for example:

Jul 08, 2014 2:11:52 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: C:\Users\xxx\Work\xxx\target\work\tomcat\work\Tomcat\localhost\xxx\grails-resources\avatar-picker\lib\fd-slider\fd-slider.js:1261:      WARNING - Parse error. Non-JSDoc comment has annotations. Did you mean to start it with '/**'?
    /*@if (@_jscript_version < 9)
^

Jul 08, 2014 2:11:52 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 1 warning(s)
Jul 08, 2014 2:11:53 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING:     C:\Users\xxx\Work\xxx\target\work\tomcat\work\Tomcat\localhost\xxx\grails-resources\plugins\console-1.2\js\jquery.layout.js:4078: WARNING - Parse error. Non-JSDoc comment has annotations. Did you mean to start it with '/**'?
    /*
^

Jul 08, 2014 2:11:53 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 1 warning(s)
Jul 08, 2014 2:11:56 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: C:\Users\xxx\Work\xxx\target\work\tomcat\work\Tomcat\localhost\xxx\grails-resources\plugins\spring-security-ui-1.0-RC1\js\jquery\jquery.checkbox.js:10:   WARNING - Parse error. illegal use of unknown JSDoc tag "mailto"; ignoring it
 * @mailto wm.morgun@gmail.com
   ^

The second issue is that although we can surpress these warnings when in dev using: log4j = { error 'com.google.javascript.jscomp', 'org.grails.plugin.resource.mapper.googleclosurecompiler' }

When building a prod war and specifying grails.logging.jul.usebridge = false (for performance reasons) the working log4j config above seems to be ignored and I've found no way of surpressing the irrelevant warnings that are shown whenever our prod webapp is started up.

oyvinmar commented 10 years ago

Sorry for the late response. I've been on holiday the last weeks.

I don't have any suggestion on how to suppress the warnings. This seems like an issue that is not directly linked to the plugin.

alanmosely commented 10 years ago

Well there are two things here:

oyvinmar commented 10 years ago

I haven't tested it but you should be able to exclude certain files with grails.resources.googleclosurecompiler.exludes = ['**/*.min.js', 'filetoskip.js'] in your config.

See: http://grails-plugins.github.io/grails-resources/guide/6.%20Creating%20custom%20mappers.html#6.4%20Processing%20only%20the%20right%20types%20of%20files for more info.

alanmosely commented 10 years ago

Unfortunately that doesn't work, I tried both: grails.resources.googleclosurecompiler.exludes grails.resources.mappers.googleclosurecompiler.exludes

demon101 commented 9 years ago

for me works in this way grails.resources.mappers.googleclosurecompiler.excludes = ['**/*.min.js', '**/jquery.touchSwipe.js']