Log folder of Proguard and .gitignore on IntelliJ


In Android development, output folder of logs of Porguard is different between Eclipse and IntelliJ. In this article, I will explain the difference and managing of Git.

Proguard and Log Files

Proguard is a Java obfuscator and optimizer. You can use it by preparing a little on Eclipse or IntelliJ. Then, if you export a signed “.apk”, log files of proguard are output. In the log files, mapping ifnormation, etc. are recorded. You can use them on debug of the exported “.apk”.

In Eclipse, a folder named “proguard” is made under the project folder as below. Log files will be output in it.
eclipse_proguard_log_compressed

On the other hands, in IntelliJ, the log folder is “proguard_logs”.
intellij_proguard_log

For now, we can not seem to specify the folder of our choice.(YouTRACK:Change Proguard logs output dir)

Git and Logs

To export “.apk” and to modify sources are not one-to-one correspondence. So you should not manage the logs in version control system. (You should save them on release.)

In Git, defining a file named “.gitignore”, you can exclude files to unmanage. You may get a template of “.gitignore” for android from GitHub:A collection of useful .gitignore templates, Android.gitignore. In current version, it support Eclipse and InttelliJ.

However, to support Proguard logs, the templates include definition for Eclipse, but not for IntelliJ. So you should add lines as below.

*2013/04/09 Supplement: Than before, I had to add this PullReques to github. From joeblau, I got a comment that my suggestions have been merged into templates generated by gitignore.io. (add Proguard folder generated by Intellij to Android.gitignore by junf · Pull Request #543 · github/gitignore)
gitignore.io is a service that will automatically generate “.gitignore” for your environment.


Your email address will not be published.