问题
Even if it is not possible to use proguard for an entire grails app would it be possible to just use it for the src/java folder?
回答1:
I don't know either Proguard or Grails in depth, but I do know that:
- Grails uses Groovy
- Groovy compiles down to bytecode
- Proguard operates on bytecode (not source code)
Thus my intuition is yes, ProGuard can shrink/obfuscate grails apps. Your question asks about using ProGuard on the src/java folder. It's important to understand that ProGuard operates on .class files, not .java files. A correct configuration will need to operate on your bin directory, not src. Unfortunately I'm not qualified to give you a detailed example configuration, but I hope this gets you on the right path.
来源:https://stackoverflow.com/questions/9897426/is-it-possible-to-use-proguard-with-grails