[英]Robolectric 3 support of Gradle splits
I have in build.gradle
Android splits: 我在
build.gradle
Android拆分:
splits {
abi {
enable true
reset()
include 'x86', 'mips', 'armeabi-v7a', 'armeabi'
universalApk false
}
}
android.applicationVariants.all { variant ->
// assign different version code for each output
variant.outputs.each { output ->
output.versionCodeOverride =
versionCodes.get(output.getFilter(OutputFile.ABI), 0) * 1000000 + android.defaultConfig.versionCode
}
}
After update of Robolectric
to 3.0
I become path error: 将
Robolectric
更新为3.0
我变成路径错误:
build/intermediates/manifests/full/debug/AndroidManifest.xml not found or not a file; it should point to your project's AndroidManifest.xml
because I in build/intermediates/manifests/full/ have 4 splits folders 因为我在build / intermediates / manifests / full /中有4个splits文件夹
armeabi/ armeabi-v7a/ mips/ x86/
How can i set in Robolectric
config or in gradle
configuration, that I have splits? 如何在已分割的
Robolectric
配置或gradle
配置中进行设置?
Thank you 谢谢
UPDATE: In all my classes I have following configuration: 更新:在我所有的班级中,我都有以下配置:
@RunWith(RobolectricGradleTestRunner.class)
@Config(sdk = 21, manifest = "../application/AndroidManifest.xml", constants = BuildConfig.class)
I think the easiest way will just be to point it to your x86/AndroidManifest.xml
我认为最简单的方法就是将其指向您的
x86/AndroidManifest.xml
You can specify this using the manifest
key in your @Config
, eg 您可以使用
@Config
的manifest
键指定此@Config
,例如
@Config(manifest="path-here")
Since you will need this for every test, you might also consider creating a properties file. 由于每次测试都需要这样做,因此您可能还考虑创建一个属性文件。 For more details on this, the docs are here
有关更多详细信息,请参见此处的文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.