Is it possible to use proguard with Grails

2019-07-03 21:44发布

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条回答
小情绪 Triste *
2楼-- · 2019-07-03 22:21

I don't know either Proguard or Grails in depth, but I do know that:

  1. Grails uses Groovy
  2. Groovy compiles down to bytecode
  3. 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.

查看更多
登录 后发表回答