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

查看:670
本文介绍了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天全站免登陆