• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

jaredsburrows/gradle-spoon-plugin: Gradle plugin that provides a task to run And ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

jaredsburrows/gradle-spoon-plugin

开源软件地址(OpenSource Url):

https://github.com/jaredsburrows/gradle-spoon-plugin

开源编程语言(OpenSource Language):

Groovy 60.1%

开源软件介绍(OpenSource Introduction):

Gradle Spoon Plugin

License Maven Build Twitter

Gradle plugin for Spoon 2+ and Android Gradle Plugin 3+.

Download

Release:

buildscript {
  repositories {
    mavenCentral()
    // For Spoon snapshot, until 2.0.0 is released
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
  }

  dependencies {
    classpath 'com.jaredsburrows:gradle-spoon-plugin:1.6.0'
  }
}

repositories {
  // For Spoon snapshot, until 2.0.0 is released
  maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

apply plugin: 'com.android.application'
apply plugin: 'com.jaredsburrows.spoon'

dependencies {
  // For Spoon snapshot, until 2.0.0 is released
  androidTestCompile 'com.squareup.spoon:spoon-client:2.0.0-SNAPSHOT'
}

Release versions are available in the Sonatype's release repository.

Snapshot:

buildscript {
  repositories {
    maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' }
    // For Spoon snapshot, until 2.0.0 is released
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
  }

  dependencies {
    classpath 'com.jaredsburrows:gradle-spoon-plugin:1.6.1-SNAPSHOT'
  }
}

repositories {
  // For Spoon snapshot, until 2.0.0 is released
  maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

apply plugin: 'com.android.application'
apply plugin: 'com.jaredsburrows.spoon'

dependencies {
  // For Spoon snapshot, until 2.0.0 is released
  androidTestCompile 'com.squareup.spoon:spoon-client:2.0.0-SNAPSHOT'
}

Snapshot versions are available in the Sonatype's snapshots repository.

Library modules:

This plugin allows Spoon to be run on library modules too!

apply plugin: 'com.android.library'
apply plugin: 'com.jaredsburrows.spoon'

dependencies {
  // For Spoon snapshot, until 2.0.0 is released
  androidTestCompile 'com.squareup.spoon:spoon-client:2.0.0-SNAPSHOT'
}

Tasks

Entire project:

  • gradlew spoon{variant}

or per module:

  • gradlew app:spoon{variant}
  • gradlew library:spoon{variant}

Usage

Optional extension:

spoon {
  // Identifying title for this execution. ("Spoon Execution" by default)
  title = "My tests"
  
  // Path to output directory. ("$buildDir/spoon-output" by default)
  baseOutputDir = "spoonTests"

  // Whether or not debug logging is enabled. (false by default)
  debug = true

  // Whether or not animations are enabled. Disable animated gif generation. (false by default)
  noAnimations = true

  // Set ADB timeout. (minutes) (default is 10 mins)
  adbTimeout = 5

  // Add device serials for test execution
  devices = ["emulator-5554", "emulator-5556"]

  // Add device serials for skipping test execution.
  skipDevices = ["emulator-5555"]

  // Extra arguments to pass to instrumentation.
  instrumentationArgs = ["listener:com.foo.Listener,com.foo.Listener2", "classLoader:com.foo.CustomClassLoader"]

  // Test class name to run (fully-qualified).
  className = "com.android.foo.FooClassName"
  
  // Run annotated tests - small, medium, large
  testSize = "large"
  
  // Allow no devices to be connected. (false by default)
  allowNoDevices = true

  // Execute the tests device by device. (false by default)
  sequential = true

  // Grant all runtime permissions during installation on Marshmallow and above devices. (false by default)
  grantAll = true

  // Test method name to run (must also use className)
  methodName = "testMethodName"

  // Code coverage flag. For Spoon to calculate coverage file your app must have the `WRITE_EXTERNAL_STORAGE` permission. (false by default)
  codeCoverage = true

  // Toggle sharding. (false by default)
  shard = true

  // The number of separate shards to create.
  numShards = 10

  // The shardIndex option to specify which shard to run.
  shardIndex = 2
  
  // Run tests in separate instrumentation calls.
  singleInstrumentationCall = true

  // Do not fail build if a test fails, let all the tests run and finish. (false by default)
  ignoreFailures = true

  // Clear app data before each test. (false by default)
  clearAppDataBeforeEachTest = true
}

License

Copyright (C) 2017 Jared Burrows

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap