Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

Tests sources don't appear in the new Android Project View #12

Open
JurgenCruz opened this issue Aug 9, 2014 · 4 comments
Open

Tests sources don't appear in the new Android Project View #12

JurgenCruz opened this issue Aug 9, 2014 · 4 comments

Comments

@JurgenCruz
Copy link

Since AS 0.8.4 they added a new Project View called Android. This view groups all source code under the java folder even if from different flavors or build types. It groups the resources under res and further subgroups like layout and finally the resource name. if different version of the same resource exist it will group them under the resource name. and so on. It will also group manifests and such.

The thing is the test folder disappears under this view. I'm assuming because this view is not expecting it. I'm not sure if your plugin can do anything about it or if we would need the AS team to open an API for us or something.

Otherwise I have to be switching from Android view to Project view to see the tests.

Thanks.

@evant
Copy link
Owner

evant commented Aug 9, 2014

If the folders are marked in a similar way to project view this should be possible. Will investigate.

@evant
Copy link
Owner

evant commented Sep 14, 2014

Just an update, the only reason I haven't started working on this is because the Android project view is only in Android Studio, and you can only debug IDE plugins from Intellij, making this a PITA to test.

@nenick
Copy link

nenick commented Nov 22, 2014

here is an idea to add the test source folder to the android project view. It works but I have not much tests done, perhaps it have some bad side effects.

in your build.gradle add the following to the end of android block

android {
    ....
    sourceSets {
        androidTest.java.srcDirs += 'src/test/java'
    }
}

Update this pollutes the sources for android tests

@sschuberth
Copy link

But that's the whole point: We do not want to (re-)use the existing androidTest source set as that is often already used for functional / instrumentation tests, and unit tests should be cleanly separated from these. Being able to do so is the main benefit of the android-unit-test Gradle plugin over the official Robolectric Gradle plugin which has this limitation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants