As long as you have a valid Android project, you can use aapt package
to generate the R.java from resources. Here's example usage (all should be in one line):
aapt package --non-constant-id -f -m -M <abs_path_to_AndroidManifest.xml>
-S <abs_path_to_res_dir> -I <abs_path_to_platforms_android.jar>
-J <abs_path_to_dir_that_should_contain_gen_R_java)
--generate-dependencies
The above can be made scriptable using ANT by using the aapt target or by simply using an exec target.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…