在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):kageiit/gradle-robojava-plugin开源软件地址(OpenSource Url):https://github.com/kageiit/gradle-robojava-plugin开源编程语言(OpenSource Language):Groovy 78.5%开源软件介绍(OpenSource Introduction):gradle-robojava-plugin![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-gradle--robojava--plugin-brightgreen.svg?style=flat =18y) Robojava is a Gradle plugin that allows simple integration of Robolectric into Android Studio. This plugin works by creating a stub java project. This allows extending it with powerful plugins that are compatible with gradle java projects, but not with gradle android projects, like Gradle Cobertura Plugin for example. UsageAssuming your project structure is a Multi Project Gradle Build, add the following to your root buildscript's dependencies section: buildscript {
dependencies {
classpath 'com.kageiit:robojava-plugin:1.+'
}
} Then create a stub project at the same level as your android project with a evaluationDependsOn(':myapp')
ext.androidProject = 'myapp' // name of the android project
ext.variant = 'freeDebug' // add the test variant flavor (remove if you do not have use flavors). See example project.
apply plugin: 'cobertura' // add if you want code coverage. See example project.
apply plugin: 'com.kageiit.robojava' The include 'myapp', 'tdd' You may need to also use a custom test runner (may not be required for library projects). Add the sourceSets.androidTest.java.srcDirs += 'build/generated-sources' This will allow you to configure your custom test runner easily, as the plugin generates code for obtaining the directory paths to the manifest, resources, assets etc. See the included example. The final structure may look something like this: This plugin was created mainly to address the problem of not being able to configure Android project tests easily for the IDE and TDD etc. You can now simply do the following:
CompatibilityThis plugin was tested against versions
Known Issues
License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论