problems importing gradle files

1,133 views
Skip to first unread message

Roman Romkin

unread,
Jul 16, 2013, 1:14:22 PM7/16/13
to adt...@googlegroups.com
Hi, 

We would like to support both gradle and ant for a while and we created the gradle files which build fine in command line, however when we import root project build.gradle we getting the following error Can't register given path of type 'TEST' because it's out of content root.
Content root: 'bla/bla/bla/android-develop'
Given path: 'bla/bla/bla/android-tests/src'

Our test code is in seperate folder and the develop app - i.e. sample app has the following in gradle to make it work:

        project.ext.testsRootDir = new File('../android-tests/src').toString()
       
        instrumentTest.setRoot(project.ext.testsRootDir)        

        instrumentTest {
            dependencies {
                compile fileTree(dir: "$project.ext.testsRootDir/libs", include: '*.jar')
            }
            java.srcDirs = ["$project.ext.testsRootDir/src"]
            resources.srcDirs = ["$project.ext.testsRootDir/src"]
            aidl.srcDirs = ["$project.ext.testsRootDir/src"]
            renderscript.srcDirs = ["$project.ext.testsRootDir/src"]
            res.srcDirs = ["$project.ext.testsRootDir/res"]
            assets.srcDirs = ["$project.ext.testsRootDir/assets"]
            
        }

Thanks.

Xavier Ducrohet

unread,
Jul 16, 2013, 1:18:32 PM7/16/13
to adt...@googlegroups.com
Studio (or IntelliJ) can't have source folders outside of the project root. You could try to move android-tests inside the app folder.


--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Roman Romkin

unread,
Jul 16, 2013, 7:47:04 PM7/16/13
to adt...@googlegroups.com
but they all in root, 
main-repo\library1
               build.gradle
              \library2
               build.gradle
              \sample-app
               build.gradle
              \robotium-test
              settings.gradle
              build.gradle

Xavier Ducrohet

unread,
Jul 16, 2013, 8:12:36 PM7/16/13
to adt...@googlegroups.com
Oh yeah but you have source folder outside of the module folder.

Roman Romkin

unread,
Aug 30, 2013, 1:06:53 PM8/30/13
to adt...@googlegroups.com
yes for historical reason cause we want to support ant and gradle at the same time.
Reply all
Reply to author
Forward
0 new messages