Find *.class files.

Hello, community!

I'm looking for a simple way to get compiled *.class files tree. There is some utility, works with them, and I'd like to run it as menu "action". I have tried implement ClassPostProcessingCompiler, for tracking compiled files, it was created, but no more methods, like getProcessingItems() won't be called.

I think, there must be way better, than run javac from command line, or tools.jar. But I can't find it.

P.S. I'm working with android project, and in out directory i have only .apk files.

Comment actions Permalink

>  I have tried implement ClassPostProcessingCompiler

This API is deprecarted and is not used in the new compiler implementation that runs in a separate process now. Normally all classes are stored in output directories configured in Project Structure dialog. Your plugin can, for example, call CompilerModuleExtension.getInstance(module).getCompilerOutputPath() to find out classes output directory for particular module.


Comment actions Permalink

Thank you! It's work for me, but a little bit strange. When I removed out folder outside Idea, and then say Run, It's recreate out dir and put there apk files. If I say Make, it will do nothing.
And only when I ask Idea to Rebuild all project, It creates compiled *.class files, and put them (in package-corresponding folders) next to .apk files. Can I somehow ensure, that bin folder is correct, and corresponds to last build. And how can I ask rebuild programmatically? It will be perfect to rebuild only java class-es, because dex is slow, and i dont need it at this moment.


Please sign in to leave a comment.