以编程方式组织Java导入 [英] Organize Java Imports programmatically
问题描述
我已经为我的android应用程序编写了一个自定义构建脚本.我进行了一些简单"的预处理,因此我可以定义类似的注释
I have written a custom build script for my android app. I included some "easy" preprocessing, so I can define comments like
//#ifdef something
... CODE
//#endif
并删除Code部分(如果已配置).问题是,在预处理之后,我不再需要一些模块,因此将其省略.如果我想最终构建该应用程序,那么剩下的就是该模块的导入语句,该语句使我很吃力.我正在寻找一种预处理方式,以在预处理发生后在脚本内组织java导入.任何不需要其他点击"的解决方案都是非常受欢迎的.
and get rid of the Code part if configured so. The Problem is, that after preprocessing I don't need some modules anymore, so I leave them out. What remains is the import statement for that module which bites me, if I want to build the app finally. I'm searching for a way within my preprocessing, to organize the java Imports inside my script after preprocessing happens. Any Solution without the need for additional "clicks" is very welcome.
推荐答案
看看 http://code.google.com/p/java-comment-preprocessor/ p.s. 我的一种情况的用法示例 http://code.google.com/p/java-comment-preprocessor /wiki/ExampleOfUsageForJ2ME
take a look at http://code.google.com/p/java-comment-preprocessor/ p.s. example of usage for one of my cases http://code.google.com/p/java-comment-preprocessor/wiki/ExampleOfUsageForJ2ME
这篇关于以编程方式组织Java导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!