2

根据这里的指南http://tools.android.com/tech-docs/new-build-system/user-guide 我有点困惑。

例如,如果我将多项目设置为以下文件结构:

 MyProject/
         + app/
         + libraries/
                   + lib1/
                   + lib2/

我们可以设置一个settings.gradle 文件

        `include ':app', ':libraries:lib1', ':libraries:lib2'`

这些项目是我们自己创建的。

但,

  1. 如果我们克隆第三方库,例如 ActionBarSherlock
  2. 并克隆另一个应用程序,github for android,它需要 ActionBarSherlock
  3. 我想在 Android Studio(或 Intellij)中将源 ActionBarSherlock 分享到 github-android

      ActionBarSherlock/
                -settings.gradle
                +actionBarSherlock
                +actionBarSherlock-i18n
    
      github-android/
             - build.gradle
             + app
             + test
    

它们存在于具有不同根项目的不同父目录中。

我应该如何分配编译项目路径build.gradle?github android客户端如何获取相关库?

dependencies {
    compile project(':actionbarsherlock')
}
4

1 回答 1

0

ok,i have gave up the gradle temporary and choose maven-android-plugin + Intellij as my favorite gadgets. as Maven-android-plugin GettingStarted: https://code.google.com/p/maven-android-plugin/wiki/GettingStarted mentioned:

If you have JUnit tests that don't call any Android APIs (directly or transitively), put them in src/test/java so JUnit runs them locally and more quickly than if run on the device.

I put my Robolectric+Junit in the src/test in the main app module and Instrument Test in the test module.

At present, i feels they work fine.

于 2013-07-24T02:04:51.123 回答