Android Studio - 如何在子目录中制作模块? [英] Android Studio - How to make modules inside a subdirectory?

查看:44
本文介绍了Android Studio - 如何在子目录中制作模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有 3 个模块:mod1、mod2 和 mod3.

Suppose that I had 3 modules: mod1, mod2 and mod3.

在正常情况下,文件系统层次结构应该是:

In normal case, the file system hierarchy should be:

[android_root_dir]
build.gradle # list this file just to make it clear.
----mod1
----mod2
----mod3

但我想要的是:

[android_root_dir]
build.gradle # list this file just to make it clear.
----modules
    ----mod1
    ----mod2
    ----mod3

如何在 Android Studio 1.1.0 中实现?

how to do it in Android Studio 1.1.0?

PS:我找到了这篇文章,但它似乎不起作用,或者它适用于早期版本的 AS,而不是 1.1.0:如何在子目录中移动模块?

PS: I find this article but it does not seem to work, or it works for earlier versions of AS, not 1.1.0: How can I move a module inside a subdirectory?

推荐答案

你可以做到:

root
  build.gradle
  settings.gradle
  modules
    mod1
      build.gradle
    mod2
      build.gradle
    mod3
      build.gradle

在你的 settings.gradle

include ':modules:mod1' , ':modules:mod2', ':modules:mod3'

这篇关于Android Studio - 如何在子目录中制作模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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