Skip to content

Commit a9f04f3

Browse files
committed
initial commit
0 parents  commit a9f04f3

33 files changed

+1411
-0
lines changed

.buildscript/deploySnapshot.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
SLUG="jaredsburrows/gradle-spoon-plugin"
4+
BRANCH="master"
5+
6+
set -e
7+
8+
if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then
9+
echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'."
10+
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
11+
echo "Skipping snapshot deployment: was pull request."
12+
elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
13+
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
14+
else
15+
echo "Deploying snapshot..."
16+
./gradlew artifactoryPublish
17+
echo "Snapshot deployed!"
18+
fi

.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
# Change these settings to your own preference
4+
[*.groovy]
5+
indent_style = space
6+
indent_size = 2
7+
8+
# We recommend you to keep these unchanged
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[circle.yml]
18+
indent_style = space
19+
indent_size = 2

.gitattributes

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text eol=lf
3+
*.bat eol=crlf
4+
*.jar binary

.gitignore

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Created by https://www.gitignore.io/api/osx,intellij,android,gradle,java
2+
3+
### OSX ###
4+
.DS_Store
5+
.AppleDouble
6+
.LSOverride
7+
8+
# Files that might appear in the root of a volume
9+
.DocumentRevisions-V100
10+
.fseventsd
11+
.Spotlight-V100
12+
.TemporaryItems
13+
.Trashes
14+
.VolumeIcon.icns
15+
16+
### Intellij ###
17+
.idea/
18+
*.iml
19+
20+
### Android ###
21+
# Built application files
22+
*.apk
23+
*.ap_
24+
25+
# Files for the Dalvik VM
26+
*.dex
27+
28+
# Java class files
29+
*.class
30+
31+
# Gradle files
32+
.gradle/
33+
build/
34+
buildSrc/
35+
out/
36+
37+
# Local configuration file (sdk path, etc)
38+
local.properties
39+
40+
# Proguard folder generated by Eclipse
41+
proguard/
42+
43+
# Log Files
44+
*.log
45+
46+
# Android Studio Navigation editor temp files
47+
.navigation/
48+
49+
# Android Studio captures folder
50+
captures/
51+
52+
# Intellij
53+
*.iml
54+
55+
# Keystore files
56+
*.jks
57+
58+
### Android Patch ###
59+
gen-external-apklibs
60+
61+
62+
### Gradle ###
63+
.gradle
64+
build/
65+
/buildSrc
66+
67+
# Ignore Gradle GUI config
68+
gradle-app.setting
69+
70+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
71+
!gradle-wrapper.jar
72+
73+
# Cache of project
74+
.gradletasknamecache
75+
76+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
77+
# gradle/wrapper/gradle-wrapper.properties
78+
79+
80+
### Java ###
81+
*.class
82+
83+
# Mobile Tools for Java (J2ME)
84+
.mtj.tmp/
85+
86+
# Package Files #
87+
*.jar
88+
*.war
89+
*.ear
90+
91+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
92+
hs_err_pid*

.travis.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
language: java
2+
3+
jdk:
4+
- oraclejdk8
5+
6+
install: true
7+
8+
script:
9+
- ./gradlew clean build jacocoTestReport coveralls --scan --stacktrace
10+
11+
after_success:
12+
- .buildscript/deploySnapshot.sh
13+
14+
branches:
15+
except:
16+
- gh-pages
17+
18+
sudo: true
19+
20+
before_cache:
21+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
22+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
23+
24+
cache:
25+
directories:
26+
- $HOME/.gradle/caches/
27+
- $HOME/.gradle/wrapper/
28+
29+
env:
30+
global:
31+
- secure: "JQgm1Ej3Bor8viCShU3jxkTUVOqeISU9Gz1EE3qBjaIX8IXNMjBtht1bLAVxvIrv6Tt79g3Q+GAivErfB/x7XN/PfJaXHx7R1p6k1RZ6ZTx3hicN0089AZh9cKSDaEMDSmCuKK9808k1z1wtftYYKwG+8/o5CJ5wt8hUEI9uAjZys80bDttxu4N0Z9M4v7fwEgilOdyIRZlQJQUMfUZ9/sy6qCzOUtNyqWwMb6hrUvHrcI9dzbEUnadjyRaEzZzWZlmioe4DtTukvPwMVsQoRXw8ysRuW+upd2yIxz6Zce7GlMkT0WlsXdeLp/sAjjVByXFMeo8r8XoCVORYhj80oYY1KpY2jB7DhLTfVdNiPsKCWu53UvWus4C1q1O6B2biPBh6kcbBuOJ/AC3fL/ueHRL+/SRXcJjljKEVBZkoGkNqa3qmmSTliQ995Agu9m2OZ1C94soWhVzKnyhv1K2ll0n9IMXcC0zoVrkE+CLfBNVdyIF7MaE7iVVZkQyrL/InmEdafpA6kCFEdutxbG2cAToo0qYdx+bVXZc60iBHAzhvYtE1vIBiE3zwjOJL4/I48E8LPPr9EMLguJ9B8gyCxvwzLO+sZzQ9en05aPth1XNodeBGPQtFc+uS7t8fax30LwW2xn0ihInMdUBaeGvid4OhP7KHNoBxViRyR22kO+g="
32+
- secure: "ebVW3EUe3+uWDGuamrgkzlUpBRL3fSlyc1j0YjANhsE6M7WXH6t3eaIUeazoFY+w8ytuVYngflMkex85olzxNDgNRM24UXmez1Ht6N2k8LdPka8cGIpOH9oXw2R+hXeMSnfwIjyOeXDj0QkAe/4HaLOAJjVD42GLcK0fgKwJyF1xJp79eseHQJqFwfTkeVopMkfSLwaOMgAL0xD/zzgL5OxiA/6c7PRTa0V/Yt623GuBGWx2N58XR+kGyYNGecu2rsW3DyNAHsewz4JCnKuuOShA2Se39BFA7c5L+s8bW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EVuarjYaKgLEc="
34+
- secure: "ZA5vrszftf66ppKG5L8mesMRkmsuIkxKWis5dLF/hoETI0SuaJldfbeb01L0xttI028JOXJ++1SmVr3noM2ZuLuINJ8TExPtmhpIf6ilGB5yHQLvhMpkb6oX29aXGTwKm66+HaMnmgLKVzYGd1kGpSLRJ2jgwmfijn1y+kS438z/IaA2nZgClxWsnEU3BG6+aZCYF4ZQSNVx8ymxV8TIROokNBf/hpHISBSrsQ4UV2VhWb5sj4it3/5YbrPcAlSRnbEaGVBztISH+oCqLX5FOydsrF2FSprjqe1Mr2wWkPKuJKBV6wr7c0wNlbushMVlKXA06Vf/QFVGWpj55wG2QhoX99/WMKwCERB9SosGcPpGr8LuPQ+SbcfRhf8vsWvUUNGO5apv1C6Y4rNOIZc+PuqA0OlSs7/gFEoxcNujlAHKwR70C7MHAgeXe+08mD7/SQEEM90svZr79SOVua7GqFcIx32X/abxPsfu7W6GzoeO4i043N3+gGUTwinet84YKHTQMnix+EPB8egTlj/5aFkIeY2ujGquidngybWzAdKLxE6UtKjqGT9Dhl1PdJbTaRICF03WX4qb35V1k3oFQ7wQ70w5HmR8KjbjE0XfX/63XaWoYeyxHWunyAlpvkiqoizjiFtRtPG37vZzqDltVZqPMXObfu7ZY53Ftp6CW/0="

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Gradle Spoon Plugin
2+
3+
[![License](https://img.shields.io/badge/license-apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
4+
[![Build Status](https://travis-ci.org/jaredsburrows/gradle-spoon-plugin.svg?branch=master)](https://travis-ci.org/jaredsburrows/gradle-spoon-plugin)
5+
[![Coverage Status](https://coveralls.io/repos/github/jaredsburrows/gradle-spoon-plugin/badge.svg?branch=master)](https://coveralls.io/github/jaredsburrows/gradle-spoon-plugin?branch=master)
6+
[![Twitter Follow](https://img.shields.io/twitter/follow/jaredsburrows.svg?style=social)](https://twitter.com/jaredsburrows)
7+
8+
Gradle plugin for [Spoon](https://github.com/square/spoon).
9+
10+
## Download
11+
12+
**Release:**
13+
```groovy
14+
buildscript {
15+
repositories {
16+
jcenter()
17+
}
18+
19+
dependencies {
20+
classpath "com.jaredsburrows:gradle-spoon-plugin:0.1.0"
21+
}
22+
}
23+
24+
apply plugin: "com.android.application"
25+
apply plugin: "com.jaredsburrows.spoon"
26+
```
27+
Release versions are available in the JFrog Bintray repository: https://bintray.com/jaredsburrows/maven/gradle-spoon-plugin
28+
29+
**Snapshot:**
30+
```groovy
31+
buildscript {
32+
repositories {
33+
maven { url "https://oss.jfrog.org/artifactory/oss-snapshot-local/" }
34+
}
35+
36+
dependencies {
37+
classpath "com.jaredsburrows:gradle-spoon-plugin:0.1.0-SNAPSHOT"
38+
}
39+
}
40+
41+
apply plugin: "com.android.application"
42+
apply plugin: "com.jaredsburrows.spoon"
43+
```
44+
Snapshot versions are available in the JFrog Artifactory repository: https://oss.jfrog.org/webapp/#/builds/gradle-spoon-plugin
45+
46+
## Tasks
47+
48+
- **`spoon{variant}`**
49+
50+
## Usage
51+
52+
### How to use it
53+
TODO

build.gradle

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id "com.gradle.build-scan" version "1.10.2"
3+
id "com.github.kt3k.coveralls" version "2.8.2"
4+
id "com.jfrog.artifactory" version "4.4.18"
5+
id "com.jfrog.bintray" version "1.8.0"
6+
id "com.github.ben-manes.versions" version "0.17.0"
7+
id "com.gradle.plugin-publish" version "0.9.9"
8+
id "java-gradle-plugin"
9+
id "groovy"
10+
id "maven-publish"
11+
id "jacoco"
12+
}
13+
14+
repositories {
15+
jcenter()
16+
google()
17+
maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // for spoon snapshot
18+
}
19+
20+
apply from: file("gradle/dependencies.gradle")
21+
22+
group = GROUP
23+
version = VERSION_NAME
24+
description = POM_DESCRIPTION
25+
26+
sourceCompatibility = ext.javaVersion
27+
targetCompatibility = ext.javaVersion
28+
29+
dependencies {
30+
implementation localGroovy()
31+
implementation deps.gradle
32+
implementation deps.spoonRunner
33+
34+
testImplementation deps.gradle
35+
testImplementation deps.spockCore, { exclude module: "groovy-all" } // Use localGroovy()
36+
}
37+
38+
// Ordering matters
39+
apply from: file("gradle/scan.gradle")
40+
apply from: file("gradle/compile.gradle")
41+
apply from: file("gradle/plugin.gradle")
42+
apply from: file("gradle/publish.gradle")
43+
apply from: file("gradle/quality.gradle")
44+
apply from: file("gradle/wrapper.gradle")

gradle.properties

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
GROUP=com.jaredsburrows
2+
VERSION_NAME=0.1.0-SNAPSHOT
3+
4+
POM_NAME=Gradle Spoon Plugin
5+
POM_ARTIFACT_ID=gradle-spoon-plugin
6+
POM_DESCRIPTION=Gradle plugin that provides a task to run Android instrumentation tests via Spoon.
7+
POM_PACKAGING=jar
8+
POM_URL=https://github.com/jaredsburrows/gradle-spoon-plugin
9+
10+
POM_ISSUE_SYSTEM=github
11+
POM_ISSUE_URL=https://github.com/jaredsburrows/gradle-spoon-plugin/issues
12+
13+
POM_SCM_URL=https://github.com/jaredsburrows/gradle-spoon-plugin
14+
POM_SCM_CONNECTION=scm:git:git://github.com/jaredsburrows/gradle-spoon-plugin.git
15+
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/jaredsburrows/gradle-spoon-plugin.git
16+
17+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
18+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
19+
POM_LICENCE_DIST=repo
20+
21+
POM_DEVELOPER_ID=jaredsburrows
22+
POM_DEVELOPER_NAME=Jared Burrows
23+
POM_DEVELOPER_EMAIL=jaredsburrows@gmail.com
24+
25+
BINTRAY_GITHUB_REPO=jaredsburrows/gradle-spoon-plugin
26+
PLUGIN_NAME=com.jaredsburrows.spoon
27+
PLUGIN_NAME_CLASS=com.jaredsburrows.spoon.SpoonPlugin

gradle/compile.gradle

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
compileJava {
2+
sourceCompatibility = rootProject.ext.javaVersion
3+
targetCompatibility = rootProject.ext.javaVersion
4+
5+
// Show all warnings except boot classpath
6+
configure(options) {
7+
compilerArgs << "-Xlint:all" // Turn on all warnings
8+
compilerArgs << "-Xlint:-options" // Turn off "missing" bootclasspath warning
9+
compilerArgs << "-Werror" // Turn warnings into errors
10+
compilerArgs << "-Xdiags:verbose" // Turn on verbose errors
11+
encoding = "utf-8"
12+
incremental = true
13+
fork = true
14+
}
15+
}
16+
17+
compileGroovy {
18+
sourceCompatibility = rootProject.ext.javaVersion
19+
targetCompatibility = rootProject.ext.javaVersion
20+
21+
// Show all warnings except boot classpath
22+
configure(options) {
23+
compilerArgs << "-Xlint:all" // Turn on all warnings
24+
compilerArgs << "-Xlint:-options" // Turn off "missing" bootclasspath warning
25+
compilerArgs << "-Werror" // Turn warnings into errors
26+
compilerArgs << "-Xdiags:verbose" // Turn on verbose errors
27+
encoding = "utf-8"
28+
incremental = true
29+
fork = true
30+
}
31+
32+
configure(groovyOptions) {
33+
encoding = "utf-8"
34+
fork = true
35+
}
36+
}
37+
38+
test {
39+
// Turn on logging for all tests, filter to show failures/skips only
40+
testLogging {
41+
exceptionFormat "full"
42+
showCauses true
43+
showExceptions true
44+
showStackTraces true
45+
events "failed", "skipped"
46+
}
47+
48+
def maxWorkerCount = gradle.startParameter.maxWorkerCount
49+
maxParallelForks = (maxWorkerCount < 2) ? 1 : maxWorkerCount / 2
50+
}
51+
52+
javadoc {
53+
title = "${project.name} ${project.version}"
54+
configure(options) {
55+
header = project.name
56+
encoding "UTF-8"
57+
docEncoding "UTF-8"
58+
charSet "UTF-8"
59+
linkSource true
60+
author = true
61+
links("http://docs.oracle.com/javase/8/docs/api/",
62+
"http://docs.oracle.com/javaee/7/api/")
63+
exclude "**/*Test.java"
64+
if (JavaVersion.current().isJava8Compatible()) addStringOption("Xdoclint:none", "-quiet")
65+
}
66+
}
67+
68+
groovydoc {
69+
docTitle = "${project.name} ${project.version}"
70+
header = project.name
71+
link("http://docs.oracle.com/javase/8/docs/api/",
72+
"http://docs.oracle.com/javaee/7/api/",
73+
"http://groovy.codehaus.org/gapi/")
74+
exclude "**/*Spec.java"
75+
}
76+
77+
// Prevent forked processes from stealing focus (on MacOS at least)
78+
tasks.withType(JavaForkOptions) {
79+
// should improve memory on a 64bit JVM
80+
jvmArgs "-XX:+UseCompressedOops"
81+
// should avoid GradleWorkerMain to steal focus
82+
jvmArgs "-Djava.awt.headless=true"
83+
jvmArgs "-Dapple.awt.UIElement=true"
84+
}

gradle/dependencies.gradle

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Variables for entire project
2+
ext {
3+
javaVersion = "1.8"
4+
agpVersion = rootProject.hasProperty("agpVersion") ? rootProject.property("agpVersion") : "3.0.0"
5+
}
6+
7+
// Dependencies
8+
ext.deps = [
9+
// implementation
10+
"gradle" : "com.android.tools.build:gradle:$agpVersion",
11+
"spoonRunner": "com.squareup.spoon:spoon-runner:2.0.0-SNAPSHOT",
12+
13+
// testImplementation
14+
"spockCore" : "org.spockframework:spock-core:1.1-groovy-2.4"
15+
]

0 commit comments

Comments
 (0)