How to automate Android project skeleton creation? (no Android Studio)

别说谁变了你拦得住时间么 提交于 2021-02-10 14:35:31

问题


I would like to create a regular Android project skeleton (e.g. create directories for all the sources, resources, flavors dimensions, etc; create manifest and xml stubs)

I know you can do this in a shell script, but I want to use Gradle, if it is possible at all.

Is that functionality built into Gradle, or do I have to write my own extension/plugin. How does Studio create the project skeleton in actuality?

I don't want to re-invent the wheel, but I do not want the IDE.


回答1:


Is that functionality built into Gradle

There is no task presently in the Android Plugin for Gradle for creating an Android project. Google used to distribute the android tool that could create a project, but that was for the old Ant-based build process, and Google has never delivered a replacement. The old android tool, while still available, is deprecated and no longer has a sub-command for creating a project.

How does Studio create the project skeleton in actuality?

It has its own template system that creates project files based upon the input that you provide via the new-project wizard. AFAIK this is just baked into the IDE; there is no documented CLI for accessing that functionality.



来源:https://stackoverflow.com/questions/54846173/how-to-automate-android-project-skeleton-creation-no-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!