jeudi 3 septembre 2015

Assets folder for unit tests not copied

I am trying to mock some data I used from assets in a library. So, as it is in the new Android Studio IDE with gradle. I used the test folder to write unit tests that run on the JVM and not the androidTests that run on a device. Everything looks great apart from the detail that assets are not copied to its respective build folder, in this case build/intermediates/bundles/qa/debug/assets. That means when I try to find my folder using context.getAssets() I can't.

Here it is the relevant stuff from my build.gradle:

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode theCode
        versionName myName
    }

    publishNonDefault true

    productFlavors {
        integration {

        }
        qa {

        }
    }
}

And for the Android build tools plugin I am using the version 1.3.1 just in case that can help.

Aucun commentaire:

Enregistrer un commentaire