Monday, May 13, 2019

runtimeClasspath doesn't exist on Android source sets

Recently I was trying to adapt a Gradle/IntelliJ-based testing tool to an Android app module. It used sourceSets.main.runtimeClasspath and the test counterpart to assemble the classpath, but that doesn't seem to exist for Android, even using android.sourceSets instead of just sourceSets. Getting the full classpath from script seems to be tough, but in this case I really only needed my test suites to be included. So I just specified the path to those:

"${project.getRootDir()}/app/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes"

No comments:

Post a Comment