如何自动化Android项目骨架创建?(没有 Android Studio) [英] How to automate Android project skeleton creation? (no Android Studio)

查看:90
本文介绍了如何自动化Android项目骨架创建?(没有 Android Studio)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个常规的 Android 项目框架(例如,为所有源、资源、风味维度等创建目录;创建清单和 xml 存根)

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)

我知道您可以在 shell 脚本中执行此操作,但如果可能的话,我想使用 Gradle.

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

该功能是内置在 Gradle 中的,还是我必须编写自己的扩展/插件.Studio 实际上是如何创建项目骨架的?

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?

我不想重新发明轮子,但我不想要 IDE.

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

推荐答案

该功能是否内置于 Gradle 中

Is that functionality built into Gradle

Android Plugin for Gradle 中目前没有用于创建 Android 项目的任务.Google 曾经发布过可以创建项目的 android 工具,但那是针对旧的基于 Ant 的构建过程,而 Google 从未提供替代品. 旧的 android 工具虽然仍然可用,但已弃用,并且不再具有用于创建项目的子命令.

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.

Studio 实际是如何创建项目骨架的?

How does Studio create the project skeleton in actuality?

它有自己的模板系统,可根据您通过新建项目向导提供的输入创建项目文件.AFAIK 这只是被嵌入到 IDE 中;没有用于访问该功能的文档化 CLI.

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.

这篇关于如何自动化Android项目骨架创建?(没有 Android Studio)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆