diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-02-11 21:38:42 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-02-11 21:38:42 +0000 |
commit | da88f0488ff3b7ff32477350e20a7e5060929b2b (patch) | |
tree | 1038271eec4b59df5ce68bf5cc992f96bcdcbf91 | |
parent | 48e4f0e301f37c7ae740660cafb79c7771bb7035 (diff) | |
parent | f54d42651ba77cdfe8c999caaee4462060b52678 (diff) | |
download | misc-da88f0488ff3b7ff32477350e20a7e5060929b2b.tar.gz |
Merge "remove unused artifacts from 4.3"
68 files changed, 0 insertions, 1095 deletions
diff --git a/common/robolectric/4.3/Android.bp b/common/robolectric/4.3/Android.bp deleted file mode 100644 index 91b5ad5f..00000000 --- a/common/robolectric/4.3/Android.bp +++ /dev/null @@ -1,19 +0,0 @@ -java_import { - name: "platform-robolectric-4.3-prebuilt", - sdk_version: "current", - jars: [ - "lib/annotations-4.3.jar", - "lib/asm-6.0.jar", - "lib/junit-4.3.jar", - "lib/resources-4.3.jar", - "lib/sandbox-4.3.jar", - "lib/shadowapi-4.3.jar", - "lib/shadows-framework-4.3.jar", - "lib/shadows-httpclient-4.3.jar", - "lib/shadows-multidex-4.3.jar", - "lib/shadows-supportv4-4.3.jar", - "lib/robolectric-4.3.jar", - "lib/utils-4.3.jar", - ], -} - diff --git a/common/robolectric/4.3/PREBUILT/download-libs.gradle b/common/robolectric/4.3/PREBUILT/download-libs.gradle deleted file mode 100644 index a01d9694..00000000 --- a/common/robolectric/4.3/PREBUILT/download-libs.gradle +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Modified from https://gist.github.com/xian/05c4f27da6d4156b9827842217c2cd5c - * Reference: http://robolectric.org/blog/2017/03/01/hermetic-builds/ - */ -defaultTasks 'copyLibs' - -def shadowArtifacts = [ - "org.robolectric:shadows-framework:${robolectricVersion}", - "org.robolectric:shadows-httpclient:${robolectricVersion}", - "org.robolectric:shadows-multidex:${robolectricVersion}", - "org.robolectric:shadows-playservices:${robolectricVersion}", - "org.robolectric:shadows-supportv4:${robolectricVersion}", -] - -apply plugin: 'java' - -repositories { - mavenCentral() - google() -} - -configurations { - sandbox - roboSources -} - -// In this section you declare the dependencies for your production and test code -dependencies { - compile("org.robolectric:robolectric:${robolectricVersion}") { - // we don't need these MavenDependencyResolver in a hermetic build - exclude group: 'org.apache.maven', module: '' - exclude group: 'org.apache.ant', module: '' - } - - compile('com.ximpleware:vtd-xml:2.11') { force = true } - // Force ASM dependency to be 6.0 for JDK9 support - compile('org.ow2.asm:asm:6.0') { force = true } - compile('org.ow2.asm:asm-commons:6.0') { force = true } - compile('org.ow2.asm:asm-util:6.0') { force = true } - - shadowArtifacts.forEach { shadowArtifact -> - compile ("${shadowArtifact}") { - // we don't need these MavenDependencyResolver in a hermetic build - exclude group: 'org.apache.maven', module: '' - exclude group: 'org.apache.ant', module: '' - } - sandbox ("${shadowArtifact}") { - // we don't need these MavenDependencyResolver in a hermetic build - exclude group: 'org.apache.maven', module: '' - exclude group: 'org.apache.ant', module: '' - } - } - - def shadowArtifactsSet = shadowArtifacts.collect {it.toString()} toSet() - configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact ra -> - ModuleVersionIdentifier id = ra.moduleVersion.id - // download only core sources. relax restriction if required - if ("org.robolectric".equals(id.group) && !shadowArtifactsSet.contains(id.toString())) { - roboSources("${id.group}:${id.name}:${id.version}:sources") { - transitive = false - } - } - } -} - - -task copyLibs(type: Copy) { - from configurations.compile - from configurations.roboSources - into "$buildDir/lib" - - doLast { - def f = new File("$buildDir/classpath_jars.mk") - f.delete() - def jars = source.getFiles() - .collect { it.name } - .sort() - .findAll { !it.endsWith("sources.jar") } - .collect { " lib/${it} " } - f << "my_robolectric_runtime_deps := \\\n" << jars.join("\\\n") << "\n" - } -} diff --git a/common/robolectric/4.3/PREBUILT/download-libs.sh b/common/robolectric/4.3/PREBUILT/download-libs.sh deleted file mode 100755 index 98538255..00000000 --- a/common/robolectric/4.3/PREBUILT/download-libs.sh +++ /dev/null @@ -1,78 +0,0 @@ -#! /bin/bash - -set -e - -printusage() { - echo "Usage: ./download-libs.sh <robolectric-version> " >&2 - echo " -f <old-directory-to-copy-from>" >&2 - exit 1 -} - -oldVersion="" -roboVersion="$1" -shift - -while getopts "f:h" opt; do - case "$opt" in - f) - oldVersion="$OPTARG" - ;; - h) - printusage - ;; - esac -done - -if [[ -z $roboVersion ]] || [[ -z $oldVersion ]]; then - printusage -fi - -mkdir -p ../"$roboVersion"/PREBUILT -# Copy the scripts into the versioned directory for record -cp download-libs.sh ../"$roboVersion"/PREBUILT/download-libs.sh -cp download-libs.gradle ../"$roboVersion"/PREBUILT/download-libs.gradle - -cd ../"$roboVersion" -gradle -b PREBUILT/download-libs.gradle \ - -ProbolectricVersion="$roboVersion" \ - -PshadowsVersion="$roboVersion" \ - -PbuildDir="`pwd`" - -COPY_FROM_OLD_VERSION=( - "java-timeout" - "list_failed.sh" - "report-internal.mk" - "robotest-internal.mk" - "robotest.sh" - "run_robotests.mk" - "wrapper.sh" - "wrapper_test.sh" -) - -for file in "${COPY_FROM_OLD_VERSION[@]}"; do - cp -n ../"$oldVersion"/$file ./$file -done - -cat <<EOF > Android.bp -java_import { - name: "platform-robolectric-${roboVersion}-prebuilt", - sdk_version: "current", - jars: [ - "lib/annotations-${roboVersion}.jar", - "lib/asm-6.0.jar", - "lib/junit-${roboVersion}.jar", - "lib/resources-${roboVersion}.jar", - "lib/sandbox-${roboVersion}.jar", - "lib/shadowapi-${roboVersion}.jar", - "lib/shadows-framework-${roboVersion}.jar", - "lib/shadows-httpclient-${roboVersion}.jar", - "lib/shadows-multidex-${roboVersion}.jar", - "lib/shadows-supportv4-${roboVersion}.jar", - "lib/robolectric-${roboVersion}.jar", - "lib/utils-${roboVersion}.jar", - ], -} - -EOF - -set +e diff --git a/common/robolectric/4.3/classpath_jars.mk b/common/robolectric/4.3/classpath_jars.mk deleted file mode 100644 index 3dbba5d5..00000000 --- a/common/robolectric/4.3/classpath_jars.mk +++ /dev/null @@ -1,47 +0,0 @@ -my_robolectric_runtime_deps := \ - lib/accessibility-test-framework-2.1.jar \ - lib/animal-sniffer-annotations-1.17.jar \ - lib/annotation-1.0.0.jar \ - lib/annotations-4.3.jar \ - lib/asm-6.0.jar \ - lib/asm-commons-6.0.jar \ - lib/asm-tree-6.0.jar \ - lib/asm-util-6.0.jar \ - lib/auto-common-0.8.jar \ - lib/auto-service-1.0-rc4.jar \ - lib/bcprov-jdk15on-1.52.jar \ - lib/checker-qual-2.5.2.jar \ - lib/commons-codec-1.3.jar \ - lib/commons-logging-1.1.1.jar \ - lib/error_prone_annotations-2.2.0.jar \ - lib/failureaccess-1.0.1.jar \ - lib/guava-27.0.1-jre.jar \ - lib/hamcrest-core-1.3.jar \ - lib/hamcrest-library-1.3.jar \ - lib/httpclient-4.0.3.jar \ - lib/httpcore-4.0.1.jar \ - lib/icu4j-53.1.jar \ - lib/j2objc-annotations-1.1.jar \ - lib/javax.annotation-api-1.3.2.jar \ - lib/javax.inject-1.jar \ - lib/jsr305-3.0.2.jar \ - lib/junit-4.3.jar \ - lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar \ - lib/monitor-1.2.0.aar \ - lib/pluginapi-4.3.jar \ - lib/plugins-maven-dependency-resolver-4.3.jar \ - lib/protobuf-java-2.6.1.jar \ - lib/resources-4.3.jar \ - lib/robolectric-4.3.jar \ - lib/sandbox-4.3.jar \ - lib/shadowapi-4.3.jar \ - lib/shadows-framework-4.3.jar \ - lib/shadows-httpclient-4.3.jar \ - lib/shadows-multidex-4.3.jar \ - lib/shadows-playservices-4.3.jar \ - lib/shadows-supportv4-4.3.jar \ - lib/sqlite4java-0.282.jar \ - lib/support-annotations-28.0.0.jar \ - lib/utils-4.3.jar \ - lib/utils-reflector-4.3.jar \ - lib/vtd-xml-2.11.jar diff --git a/common/robolectric/4.3/java-timeout b/common/robolectric/4.3/java-timeout deleted file mode 100755 index 921fc801..00000000 --- a/common/robolectric/4.3/java-timeout +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -# -# Script for running java with a timeout. -# -# The timeout in seconds must be the first argument. The rest of the arguments -# are passed to the java binary itself. -# -# For example: -# java-timeout 120 -cp classes.jar org.junit.runner.JUnitCore -# runs: -# java -cp classes.jar org.junit.runner.JUnitCore -# with a timeout of 2 minutes. - -set -euo pipefail - -# Prints a message and terminates the process. -function fatal() { - echo "FATAL: $*" - exit 113 -} - -# Function that is invoked if java is terminated due to timeout. -# It take the process ID of the java command as an argument if it has already -# been started, or the empty string if not. It should very rarely receive the -# empty string as the pid, but it is possible. -function on_timeout() { - echo 'FATAL: command timed out' - - local pid="${1-}" - shift || fatal '[on_timeout] missing argument: pid' - test $# = 0 || fatal '[on_timeout] too many arguments' - - if [ "$pid" != '' ]; then - # It is possible that the process already terminated, but there is not much - # we can do about that. - kill -TERM -- "-$pid" # Kill the entire process group. - fi -} - -# Executes java with the given argument, waiting for a termination signal from -# runalarm which this script is running under. The arguments are passed to the -# java binary itself. -function execute() { - # Trap SIGTERM, which is what we will receive if runalarm interrupts us. - local pid # Set below after we run the process. - trap 'on_timeout $pid' SIGTERM - # Starts java within a new process group and saves it process ID before - # blocking waiting for it to complete. 'setsid' starts the process within a - # new process group, which means that it will not be killed when this shell - # command is killed. This is needed so that the signal handler in the trap - # command above to be invoked before the java command is terminated (and will - # in fact have to terminate it itself). - setsid -w java "$@" & pid="$!"; wait "$pid" -} - -# Runs java with a timeout. The first argument is either the timeout in seconds -# or the string 'execute', which is used internally to execute the command under -# runalarm. -function main() { - local timeout_secs="${1-}" - shift || fatal '[main]: missing argument: timeout_secs' - # The reset of the arguments are meant for the java binary itself. - - if [[ $timeout_secs = '0' ]]; then - # Run without any timeout. - java "$@" - elif [[ $timeout_secs = 'execute' ]]; then - # This means we actually have to execute the command. - execute "$@" - elif (( timeout_secs < 30 )); then - # We want to have a timeout of at least 30 seconds, so that we are - # guaranteed to be able to start the java command in the subshell. This also - # catches non-numeric arguments. - fatal 'Must specify a timeout of at least 30 seconds.' - else - # Wrap the command with the standard timeout(1) if available. - # "runalarm" is a Google timeout clone, and Mac users who've installed - # GNU coreutils have timeout available as "gtimeout". - if type timeout > /dev/null 2>&1 ; then - timeout "${timeout_secs}" "$0" 'execute' "$@" - elif type runalarm > /dev/null 2>&1 ; then - runalarm -t "$timeout_secs" "$0" 'execute' "$@" - elif type gtimeout > /dev/null 2>&1 ; then - gtimeout "${timeout_secs}s" "$0" 'execute' "$@" - else - # No way to set a timeout available, just execute directly. - echo "Warning: unable to enforce timeout." 1>&2 - java "$@" - fi - fi -} - - -main "$@" diff --git a/common/robolectric/4.3/lib/accessibility-test-framework-2.1.jar b/common/robolectric/4.3/lib/accessibility-test-framework-2.1.jar Binary files differdeleted file mode 100644 index 1cd83a3d..00000000 --- a/common/robolectric/4.3/lib/accessibility-test-framework-2.1.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/animal-sniffer-annotations-1.17.jar b/common/robolectric/4.3/lib/animal-sniffer-annotations-1.17.jar Binary files differdeleted file mode 100644 index 6ec7a603..00000000 --- a/common/robolectric/4.3/lib/animal-sniffer-annotations-1.17.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/annotation-1.0.0.jar b/common/robolectric/4.3/lib/annotation-1.0.0.jar Binary files differdeleted file mode 100644 index 124f128d..00000000 --- a/common/robolectric/4.3/lib/annotation-1.0.0.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/annotations-4.3-sources.jar b/common/robolectric/4.3/lib/annotations-4.3-sources.jar Binary files differdeleted file mode 100644 index 4f7b2ab8..00000000 --- a/common/robolectric/4.3/lib/annotations-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/annotations-4.3.jar b/common/robolectric/4.3/lib/annotations-4.3.jar Binary files differdeleted file mode 100644 index f99f818f..00000000 --- a/common/robolectric/4.3/lib/annotations-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/asm-6.0.jar b/common/robolectric/4.3/lib/asm-6.0.jar Binary files differdeleted file mode 100644 index cf2de272..00000000 --- a/common/robolectric/4.3/lib/asm-6.0.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/asm-commons-6.0.jar b/common/robolectric/4.3/lib/asm-commons-6.0.jar Binary files differdeleted file mode 100644 index 33ba0c46..00000000 --- a/common/robolectric/4.3/lib/asm-commons-6.0.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/asm-tree-6.0.jar b/common/robolectric/4.3/lib/asm-tree-6.0.jar Binary files differdeleted file mode 100644 index 2aa9815c..00000000 --- a/common/robolectric/4.3/lib/asm-tree-6.0.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/asm-util-6.0.jar b/common/robolectric/4.3/lib/asm-util-6.0.jar Binary files differdeleted file mode 100644 index 9f9671cf..00000000 --- a/common/robolectric/4.3/lib/asm-util-6.0.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/auto-common-0.8.jar b/common/robolectric/4.3/lib/auto-common-0.8.jar Binary files differdeleted file mode 100644 index af67a4d7..00000000 --- a/common/robolectric/4.3/lib/auto-common-0.8.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/auto-service-1.0-rc4.jar b/common/robolectric/4.3/lib/auto-service-1.0-rc4.jar Binary files differdeleted file mode 100644 index c61b4c05..00000000 --- a/common/robolectric/4.3/lib/auto-service-1.0-rc4.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/bcprov-jdk15on-1.52.jar b/common/robolectric/4.3/lib/bcprov-jdk15on-1.52.jar Binary files differdeleted file mode 100644 index 6c54dd90..00000000 --- a/common/robolectric/4.3/lib/bcprov-jdk15on-1.52.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/checker-qual-2.5.2.jar b/common/robolectric/4.3/lib/checker-qual-2.5.2.jar Binary files differdeleted file mode 100644 index ae4e7f1f..00000000 --- a/common/robolectric/4.3/lib/checker-qual-2.5.2.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/commons-codec-1.3.jar b/common/robolectric/4.3/lib/commons-codec-1.3.jar Binary files differdeleted file mode 100644 index 957b6752..00000000 --- a/common/robolectric/4.3/lib/commons-codec-1.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/commons-logging-1.1.1.jar b/common/robolectric/4.3/lib/commons-logging-1.1.1.jar Binary files differdeleted file mode 100644 index 1deef144..00000000 --- a/common/robolectric/4.3/lib/commons-logging-1.1.1.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/error_prone_annotations-2.2.0.jar b/common/robolectric/4.3/lib/error_prone_annotations-2.2.0.jar Binary files differdeleted file mode 100644 index c8e27b53..00000000 --- a/common/robolectric/4.3/lib/error_prone_annotations-2.2.0.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/failureaccess-1.0.1.jar b/common/robolectric/4.3/lib/failureaccess-1.0.1.jar Binary files differdeleted file mode 100644 index 9b56dc75..00000000 --- a/common/robolectric/4.3/lib/failureaccess-1.0.1.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/guava-27.0.1-jre.jar b/common/robolectric/4.3/lib/guava-27.0.1-jre.jar Binary files differdeleted file mode 100644 index f164ce72..00000000 --- a/common/robolectric/4.3/lib/guava-27.0.1-jre.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/hamcrest-core-1.3.jar b/common/robolectric/4.3/lib/hamcrest-core-1.3.jar Binary files differdeleted file mode 100644 index 9d5fe16e..00000000 --- a/common/robolectric/4.3/lib/hamcrest-core-1.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/hamcrest-library-1.3.jar b/common/robolectric/4.3/lib/hamcrest-library-1.3.jar Binary files differdeleted file mode 100644 index 9eac80d7..00000000 --- a/common/robolectric/4.3/lib/hamcrest-library-1.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/httpclient-4.0.3.jar b/common/robolectric/4.3/lib/httpclient-4.0.3.jar Binary files differdeleted file mode 100644 index 16e349a4..00000000 --- a/common/robolectric/4.3/lib/httpclient-4.0.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/httpcore-4.0.1.jar b/common/robolectric/4.3/lib/httpcore-4.0.1.jar Binary files differdeleted file mode 100644 index 4aef35e2..00000000 --- a/common/robolectric/4.3/lib/httpcore-4.0.1.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/icu4j-53.1.jar b/common/robolectric/4.3/lib/icu4j-53.1.jar Binary files differdeleted file mode 100644 index 2c3ff8bb..00000000 --- a/common/robolectric/4.3/lib/icu4j-53.1.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/j2objc-annotations-1.1.jar b/common/robolectric/4.3/lib/j2objc-annotations-1.1.jar Binary files differdeleted file mode 100644 index 4b6f1274..00000000 --- a/common/robolectric/4.3/lib/j2objc-annotations-1.1.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/javax.annotation-api-1.3.2.jar b/common/robolectric/4.3/lib/javax.annotation-api-1.3.2.jar Binary files differdeleted file mode 100644 index a8a470a7..00000000 --- a/common/robolectric/4.3/lib/javax.annotation-api-1.3.2.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/javax.inject-1.jar b/common/robolectric/4.3/lib/javax.inject-1.jar Binary files differdeleted file mode 100644 index b2a9d0bf..00000000 --- a/common/robolectric/4.3/lib/javax.inject-1.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/jsr305-3.0.2.jar b/common/robolectric/4.3/lib/jsr305-3.0.2.jar Binary files differdeleted file mode 100644 index 59222d9c..00000000 --- a/common/robolectric/4.3/lib/jsr305-3.0.2.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/junit-4.3-sources.jar b/common/robolectric/4.3/lib/junit-4.3-sources.jar Binary files differdeleted file mode 100644 index 30db9bf2..00000000 --- a/common/robolectric/4.3/lib/junit-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/junit-4.3.jar b/common/robolectric/4.3/lib/junit-4.3.jar Binary files differdeleted file mode 100644 index 07cef638..00000000 --- a/common/robolectric/4.3/lib/junit-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar b/common/robolectric/4.3/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar Binary files differdeleted file mode 100644 index 45832c05..00000000 --- a/common/robolectric/4.3/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/monitor-1.2.0.aar b/common/robolectric/4.3/lib/monitor-1.2.0.aar Binary files differdeleted file mode 100644 index 0c5fb665..00000000 --- a/common/robolectric/4.3/lib/monitor-1.2.0.aar +++ /dev/null diff --git a/common/robolectric/4.3/lib/pluginapi-4.3-sources.jar b/common/robolectric/4.3/lib/pluginapi-4.3-sources.jar Binary files differdeleted file mode 100644 index e1475273..00000000 --- a/common/robolectric/4.3/lib/pluginapi-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/pluginapi-4.3.jar b/common/robolectric/4.3/lib/pluginapi-4.3.jar Binary files differdeleted file mode 100644 index a6c1310d..00000000 --- a/common/robolectric/4.3/lib/pluginapi-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/plugins-maven-dependency-resolver-4.3-sources.jar b/common/robolectric/4.3/lib/plugins-maven-dependency-resolver-4.3-sources.jar Binary files differdeleted file mode 100644 index 4ff64e08..00000000 --- a/common/robolectric/4.3/lib/plugins-maven-dependency-resolver-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/plugins-maven-dependency-resolver-4.3.jar b/common/robolectric/4.3/lib/plugins-maven-dependency-resolver-4.3.jar Binary files differdeleted file mode 100644 index ad108e2a..00000000 --- a/common/robolectric/4.3/lib/plugins-maven-dependency-resolver-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/protobuf-java-2.6.1.jar b/common/robolectric/4.3/lib/protobuf-java-2.6.1.jar Binary files differdeleted file mode 100644 index 0fcd8089..00000000 --- a/common/robolectric/4.3/lib/protobuf-java-2.6.1.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/resources-4.3-sources.jar b/common/robolectric/4.3/lib/resources-4.3-sources.jar Binary files differdeleted file mode 100644 index 47e2359e..00000000 --- a/common/robolectric/4.3/lib/resources-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/resources-4.3.jar b/common/robolectric/4.3/lib/resources-4.3.jar Binary files differdeleted file mode 100644 index ab912dc3..00000000 --- a/common/robolectric/4.3/lib/resources-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/robolectric-4.3-sources.jar b/common/robolectric/4.3/lib/robolectric-4.3-sources.jar Binary files differdeleted file mode 100644 index 4e3f6439..00000000 --- a/common/robolectric/4.3/lib/robolectric-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/robolectric-4.3.jar b/common/robolectric/4.3/lib/robolectric-4.3.jar Binary files differdeleted file mode 100644 index e3ab64ec..00000000 --- a/common/robolectric/4.3/lib/robolectric-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/sandbox-4.3-sources.jar b/common/robolectric/4.3/lib/sandbox-4.3-sources.jar Binary files differdeleted file mode 100644 index 33d42d1d..00000000 --- a/common/robolectric/4.3/lib/sandbox-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/sandbox-4.3.jar b/common/robolectric/4.3/lib/sandbox-4.3.jar Binary files differdeleted file mode 100644 index 554cf834..00000000 --- a/common/robolectric/4.3/lib/sandbox-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/shadowapi-4.3-sources.jar b/common/robolectric/4.3/lib/shadowapi-4.3-sources.jar Binary files differdeleted file mode 100644 index 188a297c..00000000 --- a/common/robolectric/4.3/lib/shadowapi-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/shadowapi-4.3.jar b/common/robolectric/4.3/lib/shadowapi-4.3.jar Binary files differdeleted file mode 100644 index 77214a45..00000000 --- a/common/robolectric/4.3/lib/shadowapi-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/shadows-framework-4.3.jar b/common/robolectric/4.3/lib/shadows-framework-4.3.jar Binary files differdeleted file mode 100644 index a7d71131..00000000 --- a/common/robolectric/4.3/lib/shadows-framework-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/shadows-httpclient-4.3.jar b/common/robolectric/4.3/lib/shadows-httpclient-4.3.jar Binary files differdeleted file mode 100644 index fd19f465..00000000 --- a/common/robolectric/4.3/lib/shadows-httpclient-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/shadows-multidex-4.3.jar b/common/robolectric/4.3/lib/shadows-multidex-4.3.jar Binary files differdeleted file mode 100644 index 7cc8a168..00000000 --- a/common/robolectric/4.3/lib/shadows-multidex-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/shadows-playservices-4.3.jar b/common/robolectric/4.3/lib/shadows-playservices-4.3.jar Binary files differdeleted file mode 100644 index 75a4f160..00000000 --- a/common/robolectric/4.3/lib/shadows-playservices-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/shadows-supportv4-4.3.jar b/common/robolectric/4.3/lib/shadows-supportv4-4.3.jar Binary files differdeleted file mode 100644 index 31b30757..00000000 --- a/common/robolectric/4.3/lib/shadows-supportv4-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/sqlite4java-0.282.jar b/common/robolectric/4.3/lib/sqlite4java-0.282.jar Binary files differdeleted file mode 100644 index 686098fe..00000000 --- a/common/robolectric/4.3/lib/sqlite4java-0.282.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/support-annotations-28.0.0.jar b/common/robolectric/4.3/lib/support-annotations-28.0.0.jar Binary files differdeleted file mode 100644 index c063f2b9..00000000 --- a/common/robolectric/4.3/lib/support-annotations-28.0.0.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/utils-4.3-sources.jar b/common/robolectric/4.3/lib/utils-4.3-sources.jar Binary files differdeleted file mode 100644 index e1d26524..00000000 --- a/common/robolectric/4.3/lib/utils-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/utils-4.3.jar b/common/robolectric/4.3/lib/utils-4.3.jar Binary files differdeleted file mode 100644 index 24aa61e0..00000000 --- a/common/robolectric/4.3/lib/utils-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/utils-reflector-4.3-sources.jar b/common/robolectric/4.3/lib/utils-reflector-4.3-sources.jar Binary files differdeleted file mode 100644 index d0e6fb9d..00000000 --- a/common/robolectric/4.3/lib/utils-reflector-4.3-sources.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/utils-reflector-4.3.jar b/common/robolectric/4.3/lib/utils-reflector-4.3.jar Binary files differdeleted file mode 100644 index 80591f9c..00000000 --- a/common/robolectric/4.3/lib/utils-reflector-4.3.jar +++ /dev/null diff --git a/common/robolectric/4.3/lib/vtd-xml-2.11.jar b/common/robolectric/4.3/lib/vtd-xml-2.11.jar Binary files differdeleted file mode 100644 index ecf0e2f8..00000000 --- a/common/robolectric/4.3/lib/vtd-xml-2.11.jar +++ /dev/null diff --git a/common/robolectric/4.3/list_failed.sh b/common/robolectric/4.3/list_failed.sh deleted file mode 100755 index 1000ae1c..00000000 --- a/common/robolectric/4.3/list_failed.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# -# This script lists the tests which are failing in the output of Robolectric -# tests. -# TODO: Remove this script and move the functionality into a custom JUnit runner. - -# Matches the line specifying which test has failed and matches the test name -# and class name as the first and second matching group, respectively. -readonly FAILED_TEST_RE='^[1-9][0-9]*)\s\(\w\+\)(\(\(\w\|.\)\+\))$' - -# Fails with a message. -function fatal() { - echo 1>&2 "FATAL: $@" - exit 113 -} - -function main() { - test $# = 0 || fatal "Too many arguments: $@" - - sed -e '1,/^There \(was 1 failure\|were [0-9]* failures\):$/d' | - grep "$FAILED_TEST_RE" | - sed -e "s/$FAILED_TEST_RE/\2.\1/" || - true -} - -set -e -set -o pipefail -main "$@" diff --git a/common/robolectric/4.3/report-internal.mk b/common/robolectric/4.3/report-internal.mk deleted file mode 100644 index 49896327..00000000 --- a/common/robolectric/4.3/report-internal.mk +++ /dev/null @@ -1,49 +0,0 @@ -# Defines a target named $(my_target) for generating a coverage report. - -my_report_dir := $(my_coverage_dir)/reports -my_coverage_output := $(my_report_dir)/coverage.xml - -# Private variables. -$(my_coverage_output): PRIVATE_MODULE := $(LOCAL_MODULE) -$(my_coverage_output): PRIVATE_COVERAGE_FILE := $(my_coverage_file) -$(my_coverage_output): PRIVATE_COVERAGE_SRCS_JARS := $(my_coverage_srcs_jars) -$(my_coverage_output): PRIVATE_INSTRUMENT_SOURCE_DIRS := $(my_instrument_source_dirs) -$(my_coverage_output): PRIVATE_COVERAGE_REPORT_CLASS := $(my_coverage_report_class) -$(my_coverage_output): PRIVATE_COVERAGE_REPORT_JAR := $(my_coverage_report_jar) -$(my_coverage_output): PRIVATE_REPORT_DIR := $(my_report_dir) - -# Generate the coverage report. -$(my_coverage_output): $(my_collect_file) $(my_coverage_report_jar) - $(hide) rm -rf $(PRIVATE_REPORT_DIR) - $(hide) mkdir -p $(PRIVATE_REPORT_DIR) - $(hide) $(JAVA) \ - -cp $(PRIVATE_COVERAGE_REPORT_JAR) \ - $(PRIVATE_COVERAGE_REPORT_CLASS) \ - -classpath $(strip $(call normalize-path-list, $(PRIVATE_COVERAGE_SRCS_JARS))) \ - --exec-file $(PRIVATE_COVERAGE_FILE) \ - --name $(PRIVATE_MODULE) \ - --report-dir $(PRIVATE_REPORT_DIR)/ \ - --srcs $(strip $(call normalize-path-list, $(PRIVATE_INSTRUMENT_SOURCE_DIRS))) \ - >$(PRIVATE_REPORT_DIR)/reporter.txt 2>&1 - @echo "Coverage report: file://"$(realpath $(PRIVATE_REPORT_DIR))"/index.html" - - -# Generate a ZIP file of the coverage report. -my_coverage_output_zip := $(my_coverage_dir)/report-html.zip - -$(my_coverage_output_zip): PRIVATE_REPORT_DIR := $(my_report_dir) -$(my_coverage_output_zip): $(my_coverage_output) - $(hide) cd $(PRIVATE_REPORT_DIR) && zip --quiet -r $(PWD)/$@ . - -# Add coverage report zip to dist files. -$(call dist-for-goals, $(my_report_target), \ - $(my_coverage_output_zip):robotests-coverage/$(LOCAL_MODULE)/robolectric-html-coverage.zip \ - $(my_coverage_output):robotests-coverage/$(LOCAL_MODULE)/robolectric-coverage.xml) - -# Running the coverage will always generate the report. -$(my_target): $(my_coverage_output) - -# Reset local variables. -my_coverage_output := -my_coverage_output_zip := -my_report_dir := diff --git a/common/robolectric/4.3/robotest-internal.mk b/common/robolectric/4.3/robotest-internal.mk deleted file mode 100644 index f8e4470a..00000000 --- a/common/robolectric/4.3/robotest-internal.mk +++ /dev/null @@ -1,97 +0,0 @@ -# Defines a target named $(my_target) for running robolectric tests. - -# Running the tests is done in two stages: we first generate the test output to -# $(my_target_output), which is also added to the dist list, and store the -# return value of running the tests in $(my_target_retval). After that we -# process the output and return value as part of $(my_target). This is needed -# to make sure that we can install the test output even if the tests actually -# fail. - -# Files in which to store the output and return value of the tests. -my_target_xml := $(intermediates)/$(my_filename_stem)-output.xml -my_target_output := $(intermediates)/$(my_filename_stem)-output.txt -my_target_retval := $(intermediates)/$(my_filename_stem)-retval.txt - -# We should always re-run the tests, even if nothing has changed. -# So until the build system has a dedicated "no cache" option, claim -# to write a file that is never produced. -my_target_nocache := $(intermediates)/$(my_filename_stem)-nocache - -# Private variables. -$(my_target_output): PRIVATE_MODULE := $(LOCAL_MODULE) -$(my_target_output): PRIVATE_TESTS := $(my_tests) -$(my_target_output): PRIVATE_JARS := $(my_jars) -$(my_target_output): PRIVATE_JAVA_ARGS := $(my_java_args) -$(my_target_output): PRIVATE_ROBOLECTRIC_PATH := $(my_robolectric_path) -$(my_target_output): PRIVATE_ROBOLECTRIC_SCRIPT_PATH := $(my_robolectric_script_path) -$(my_target_output): PRIVATE_TARGET_MESSAGE := $(my_target_message) -$(my_target_output): PRIVATE_TARGET_OUTPUT := $(my_target_output) -$(my_target_output): PRIVATE_TARGET_RETVAL := $(my_target_retval) -$(my_target_output): PRIVATE_TARGET_NOCACHE := $(my_target_nocache) -$(my_target_output): PRIVATE_TIMEOUT := $(my_timeout) -# Pin java binary to 8 or 9, the highest robolectric 3.6.1 and ASM 6.0 support: -$(my_target_output): PRIVATE_JAVA_PATH := $(if $(my_use_java8),$(ANDROID_JAVA8_HOME)/bin:,$(ANDROID_JAVA9_HOME)/bin:) -$(my_target_output): PRIVATE_XML_OUTPUT_FILE := $(my_target_xml) -$(my_target_output): .KATI_IMPLICIT_OUTPUTS := $(my_target_xml) $(my_target_retval) $(my_target_nocache) -# Runs the Robolectric tests and saves the output and return value. -$(my_target_output): $(my_jars) - @echo "host Robolectric: $(PRIVATE_MODULE)" - # Run `touch` to always create the output XML file, so the build doesn't break even if the - # runner failed to create the XML output - $(hide) touch "$(PRIVATE_XML_OUTPUT_FILE)" - $(hide) rm -f "$(PRIVATE_TARGET_NOCACHE)" - $(hide) \ - PRIVATE_INTERMEDIATES="$(dir $@)" \ - PRIVATE_JARS="$(PRIVATE_JARS)" \ - PRIVATE_JAVA_ARGS="$(PRIVATE_JAVA_ARGS)" \ - PRIVATE_ROBOLECTRIC_PATH="$(PRIVATE_ROBOLECTRIC_PATH)" \ - PRIVATE_ROBOLECTRIC_SCRIPT_PATH="$(PRIVATE_ROBOLECTRIC_SCRIPT_PATH)" \ - PRIVATE_RUN_INDIVIDUALLY="$(ROBOTEST_RUN_INDIVIDUALLY)" \ - PRIVATE_TARGET_MESSAGE="$(PRIVATE_TARGET_MESSAGE)" \ - PRIVATE_TIMEOUT="$(PRIVATE_TIMEOUT)" \ - PRIVATE_TESTS="$(PRIVATE_TESTS)" \ - XML_OUTPUT_FILE="$(PRIVATE_XML_OUTPUT_FILE)" \ - TEST_WORKSPACE="$(PRIVATE_MODULE)" \ - PATH=$(PRIVATE_JAVA_PATH)$${PATH} \ - $(PRIVATE_ROBOLECTRIC_SCRIPT_PATH)/wrapper.sh \ - "$(PRIVATE_MODULE)" \ - "$(PRIVATE_TARGET_OUTPUT)" \ - "$(PRIVATE_TARGET_RETVAL)" \ - wrap \ - $(PRIVATE_ROBOLECTRIC_SCRIPT_PATH)/robotest.sh - -# Private variables. -$(my_target): PRIVATE_MODULE := $(LOCAL_MODULE) -$(my_target): PRIVATE_TARGET_OUTPUT := $(my_target_output) -$(my_target): PRIVATE_TARGET_RETVAL := $(my_target_retval) -$(my_target): PRIVATE_FAILURE_FATAL := $(my_failure_fatal) -$(my_target): PRIVATE_ROBOLECTRIC_SCRIPT_PATH := $(my_robolectric_script_path) -# Process the output and the return value of the tests. This will fail if the -# return value is non-zero. -$(my_target): $(my_target_output) $(my_target_xml) - $(hide) \ - result=0; \ - $(PRIVATE_ROBOLECTRIC_SCRIPT_PATH)/wrapper.sh \ - "$(PRIVATE_MODULE)" \ - "$(PRIVATE_TARGET_OUTPUT)" \ - "$(PRIVATE_TARGET_RETVAL)" \ - eval \ - || result=$$?; \ - if [ "$(strip $(PRIVATE_FAILURE_FATAL))" = true ]; then \ - exit "$$result"; \ - fi - $(hide) touch $@ - -# Add the output of the tests to the dist list, so that we will include it even -# if the tests fail. -$(call dist-for-goals, $(my_phony_target), \ - $(my_target_output):robotests/$(LOCAL_MODULE)-$(notdir $(my_target_output)) \ - $(my_target_xml):robotests/$(LOCAL_MODULE)-$(notdir $(my_target_xml))) - -# Clean up local variables. -my_target_output := -my_target_retval := -my_target_xml := -my_target_nocache := -my_filename_stem := -my_use_java8 := diff --git a/common/robolectric/4.3/robotest.sh b/common/robolectric/4.3/robotest.sh deleted file mode 100755 index 160b533d..00000000 --- a/common/robolectric/4.3/robotest.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash -# -# Runs robolectric tests. - -set -euo pipefail - -# Terminate with a fatal error. -function fatal() { - echo "Fatal: $*" - exit 113 -} - -# Ensures that the given variable is set. -function validate_var() { - local name="$1"; shift || fatal "Missing argument: name" - test $# = 0 || fatal "Too many arguments" - - eval [[ -n \${${name}+dummy} ]] || { - echo "Variable not set: $name"; - return 1; - } -} - -# Ensures that all the required variables are set. -function validate_vars() { - test $# = 0 || fatal "Too many arguments" - - validate_var 'PRIVATE_INTERMEDIATES' - validate_var 'PRIVATE_JARS' - validate_var 'PRIVATE_JAVA_ARGS' - validate_var 'PRIVATE_ROBOLECTRIC_PATH' - validate_var 'PRIVATE_ROBOLECTRIC_SCRIPT_PATH' - validate_var 'PRIVATE_RUN_INDIVIDUALLY' - validate_var 'PRIVATE_TARGET_MESSAGE' - validate_var 'PRIVATE_TESTS' - validate_var 'PRIVATE_TIMEOUT' - - validate_var 'XML_OUTPUT_FILE' - validate_var 'TEST_WORKSPACE' -} - -# Remove leading and trailing spaces around the given argument. -function strip() { - local value="$1"; shift || fatal "Missing argument: value" - test $# = 0 || fatal "Too many arguments" - - echo "$value" | sed -e 's/^ *//' -e 's/ *$//' -} - -# Normalizes a list of paths and turns it into a colon-separated list. -function normalize-path-list() { - echo "$@" | sed -e 's/^ *//' -e 's/ *$//' -e 's/ */ /g' -e 's/ /:/g' -} - -function junit() { - # This adds the lib folder to the cp. - local classpath="$(strip "$(normalize-path-list "${PRIVATE_JARS}")")" - local command=( - "${PRIVATE_ROBOLECTRIC_SCRIPT_PATH}/java-timeout" - "${PRIVATE_TIMEOUT}" - ${PRIVATE_JAVA_ARGS} - -Drobolectric.dependency.dir="${PRIVATE_ROBOLECTRIC_PATH}" - -Drobolectric.offline=true - -Drobolectric.logging=stdout - -cp "$classpath" - com.android.junitxml.JUnitXmlRunner - ) - echo "${command[@]}" "$@" - "${command[@]}" "$@" -} - -function runtests() { - local tests="$1"; shift || fatal "Missing argument: tests" - test $# = 0 || fatal "Too many arguments" - - if [[ "$(strip "${PRIVATE_RUN_INDIVIDUALLY}")" = 'true' ]]; then - local result=0 - for test in ${tests}; do - echo "-------------------------------------------------------------------" - echo "Running $test:" - junit "${test}" - done - return "$result" - else - echo "-------------------------------------------------------------------" - echo "Running $tests:" - junit $tests # Contains a space-separated list of tests. - fi -} - -# Run the robolectric tests -function run() { - test $# = 0 || fatal "Too many arguments" - - [ "${PRIVATE_TARGET_MESSAGE}" == '' ] || echo "${PRIVATE_TARGET_MESSAGE}" - local tests="${PRIVATE_TESTS}" - if [ "$tests" = '' ]; then - # Somehow there are no tests to run. Assume this is failure. - echo "No tests to run." - exit 1 - fi - local output="${PRIVATE_INTERMEDIATES}/output.out" - local failed="${PRIVATE_INTERMEDIATES}/failed.out" - local result=0 - runtests "${tests}" >"$output" 2>&1 || result="$?" - echo "$output" - cat "$output" - if [ "$result" = 0 ]; then - return "$result" - fi - "${PRIVATE_ROBOLECTRIC_SCRIPT_PATH}/list_failed.sh" <"$output" >"$failed" - return "$result" -} - -function main() { - test $# = 0 || fatal "Too many arguments" - - validate_vars - run -} - -main "$@" diff --git a/common/robolectric/4.3/run_robotests.mk b/common/robolectric/4.3/run_robotests.mk deleted file mode 100644 index 7f2207ee..00000000 --- a/common/robolectric/4.3/run_robotests.mk +++ /dev/null @@ -1,231 +0,0 @@ -# Rules for running robolectric tests. -# -# Uses the following variables: -# -# LOCAL_JAVA_LIBRARIES -# LOCAL_STATIC_JAVA_LIBRARIES -# LOCAL_ROBOTEST_FAILURE_FATAL -# LOCAL_ROBOTEST_TIMEOUT -# LOCAL_TEST_PACKAGE -# LOCAL_ROBOTEST_FILES -# ROBOTEST_FAILURE_FATAL -# ROBOTEST_FILTER -# ROBOTEST_RUN_INDIVIDUALLY -# -# -# If ROBOTEST_FAILURE_FATAL is set to true then failing tests will cause a -# build failure. Otherwise failures will be logged but ignored by make. -# -# If ROBOTEST_FILTER is set to a regex then only tests matching that pattern -# will be run. This currently only works at the class level. -# -# TODO: Switch to a JUnit runner which can support method-level test -# filtering and use that rather than grep to implement ROBOTEST_FILTER. -# -# If ROBOTEST_RUN_INDIVIDUALLY is set to true, each test class will be run by a -# different JVM, preventing any interaction between different tests. This is -# significantly slower than running all tests within the same JVM, but prevents -# unwanted interactions. -# -# Tests classes are found by looking for *Test.java files in -# LOCAL_PATH recursively. - -################################################ -# General settings, independent of the module. # -################################################ - -### Used for running tests. - -# Where to find Robolectric. -my_robolectric_script_path := $(call my-dir) -# Explicitly define the jars and their classpath ordering. -include $(my_robolectric_script_path)/classpath_jars.mk -my_robolectric_jars := \ - $(addprefix $(my_robolectric_script_path)/,$(my_robolectric_runtime_deps)) \ - $(call java-lib-files,junit) - -my_collect_target := $(LOCAL_MODULE)-coverage -my_report_target := $(LOCAL_MODULE)-jacoco -.PHONY: $(my_collect_target) $(my_report_target) -# Whether or not to ignore the result of running the robotests. -# LOCAL_ROBOTEST_FAILURE_FATAL will take precedence over ROBOTEST_FAILURE_FATAL, -# if present. -my_failure_fatal := $(if $(LOCAL_ROBOTEST_FAILURE_FATAL)$(ROBOTEST_FAILURE_FATAL),true,false) -# The timeout for the command. A value of '0' means no timeout. The default is -# 10 minutes. -my_timeout := $(if $(LOCAL_ROBOTEST_TIMEOUT),$(LOCAL_ROBOTEST_TIMEOUT),600) -# Command to filter the list of test classes. -# If not specified, defaults to including all the tests. -my_test_filter_command := $(if $(ROBOTEST_FILTER),grep -E "$(ROBOTEST_FILTER)",cat) - -# The directory containing the sources. -my_instrument_makefile_dir := $(dir $(ALL_MODULES.$(LOCAL_TEST_PACKAGE).MAKEFILE)) -my_instrument_source_dirs := $(if $(LOCAL_INSTRUMENT_SOURCE_DIRS),\ - $(LOCAL_INSTRUMENT_SOURCE_DIRS),\ - $(my_instrument_makefile_dir)src $(my_instrument_makefile_dir)java) - -########################## -# Used by base_rules.mk. # -########################## - -LOCAL_MODULE_CLASS := ROBOLECTRIC -# This is actually a phony target that is never built. -LOCAL_BUILT_MODULE_STEM := test.fake -# Since it is not built, it cannot be installed. But we will define our own -# dist files, depending on which of the specific targets is invoked. -LOCAL_UNINSTALLABLE_MODULE := true -# Do not build it for checkbuild or mma -LOCAL_DONT_CHECK_MODULE := true - -include $(BUILD_SYSTEM)/base_rules.mk - - -############################# -# Module specific settings. # -############################# - -### Used for running tests. - -# The list of test classes. Robolectric requires an explicit list of tests to -# run, which is compiled from the Java files ending in "Test" within the -# directory from which this module is invoked. -ifeq ($(strip $(LOCAL_ROBOTEST_FILES)),) - LOCAL_ROBOTEST_FILES := $(call find-files-in-subdirs,$(LOCAL_PATH)/src,*Test.java,.) -endif -# Convert the paths into package names by removing .java extension and replacing "/" with "." -my_tests := $(subst /,.,$(basename $(LOCAL_ROBOTEST_FILES))) -my_tests := $(sort $(shell echo '$(my_tests)' | tr ' ' '\n' | $(my_test_filter_command))) -# The source jars containing the tests. -my_srcs_jars := \ - $(foreach lib, \ - $(LOCAL_JAVA_LIBRARIES) $(LOCAL_STATIC_JAVA_LIBRARIES), \ - $(call intermediates-dir-for,JAVA_LIBRARIES,$(lib),,COMMON)/classes-pre-proguard.jar) \ - $(foreach lib, \ - $(LOCAL_TEST_PACKAGE), \ - $(call intermediates-dir-for,APPS,$(lib),,COMMON)/classes-pre-proguard.jar) -# The jars needed to run the tests. -my_jars := \ - $(my_robolectric_jars) \ - $(call resolve-prebuilt-sdk-jar-path,$(LOCAL_SDK_VERSION)) \ - $(call java-lib-files,junitxml) \ - $(my_srcs_jars) - - - -# Run tests. -my_phony_target := $(LOCAL_MODULE) -my_target := $(LOCAL_BUILT_MODULE) -my_filename_stem := test - -android_all_lib_path := $(my_robolectric_script_path)/../android-all -my_robolectric_path := $(intermediates.COMMON)/android-all -android_all_jars := $(call find-files-in-subdirs,$(android_all_lib_path),*.jar,.) -copy_android_all_jars := $(foreach j,$(android_all_jars),\ - $(android_all_lib_path)/$(j):$(my_robolectric_path)/$(j)) -$(my_robolectric_path): $(call copy-many-files,$(copy_android_all_jars)) -$(my_target): $(my_robolectric_path) - -# Setting the DEBUG_ROBOLECTRIC environment variable will print additional logging from -# Robolectric and also make it wait for a debugger to be connected. -# For Android Studio / IntelliJ the debugger can be connected via the "remote" configuration: -# https://www.jetbrains.com/help/idea/2016.2/run-debug-configuration-remote.html -# From command line the debugger can be connected via -# jdb -attach localhost:5005 -ifdef DEBUG_ROBOLECTRIC - # The arguments to the JVM needed to debug the tests. - # - server: wait for connection rather than connecting to a debugger - # - transport: how to accept debugger connections (sockets) - # - address: the port on which to accept debugger connections - # - timeout: how long (in ms) to wait for a debugger to connect - # - suspend: do not start running any code until the debugger connects - my_java_args := \ - -Drobolectric.logging.enabled=true \ - -Xdebug -agentlib:jdwp=server=y,transport=dt_socket,address=localhost:5005,suspend=y - - # Remove the timeout so Robolectric doesn't get killed while debugging - my_timeout := 0 -endif - -include $(my_robolectric_script_path)/robotest-internal.mk -# clean local variables -my_java_args := -my_phony_target := -my_target := - -# Target for running robolectric tests using jacoco -my_phony_target := $(my_report_target) -my_target := $(LOCAL_BUILT_MODULE)-coverage -my_collect_file := $(my_target) -my_filename_stem := coverage -$(my_collect_target): $(my_target) -$(my_target): $(call java-lib-files,jvm-jacoco-agent,true) $(my_robolectric_path) - -my_coverage_dir := $(intermediates)/coverage -my_coverage_file := $(my_coverage_dir)/jacoco.exec - -# List of packages to exclude jacoco from running -my_jacoco_excludes := \ - org.robolectric.* \ - org.mockito.* \ - org.junit.* \ - org.objectweb.* \ - com.thoughtworks.xstream.* -# The Jacoco agent JAR. -my_jacoco_agent_jar := $(call java-lib-files,jvm-jacoco-agent,true) -# Using Jacoco with Robolectric is broken in 0.7.3 <= version < 0.7.6. -# In 0.7.6 or above, the parameter "inclnolocationclasses" is needed. -# See https://github.com/jacoco/jacoco/pull/288 for more -# In JDK9, if "inclnolocationclasses" is used, we also need to specify -# exclclassloader=jdk.internal.reflect.DelegatingClassLoader -# https://github.com/jacoco/jacoco/issues/16 -my_jacoco_agent_args = \ - destfile=$(my_coverage_file) \ - excludes=$(call normalize-path-list, $(my_jacoco_excludes)) \ - inclnolocationclasses=true \ - exclclassloader=jdk.internal.reflect.DelegatingClassLoader \ - append=false -my_java_args := \ - -javaagent:$(my_jacoco_agent_jar)=$(call normalize-comma-list, $(my_jacoco_agent_args)) -include $(my_robolectric_script_path)/robotest-internal.mk -# Clear temporary variables -my_failure_fatal := -my_jacoco_agent_jar := -my_jacoco_agent_args := -my_jacoco_excludes := -my_java_args := -my_phony_target := -my_robolectric_jars := -my_target := -my_tests := -my_filename_stem := - -# Target for generating code coverage reports using jacoco.exec -my_target := $(LOCAL_BUILT_MODULE)-jacoco -$(my_report_target): $(my_target) - -# The JAR file containing the report generation tool. -my_coverage_report_class := com.google.android.jacoco.reporter.ReportGenerator -my_coverage_report_jar := $(call java-lib-files,jvm-jacoco-reporter,true) -my_coverage_srcs_jars := $(my_srcs_jars) -my_coverage_report_dist_file := $(my_report_target)-html.zip - -## jacoco code coverage reports -include $(my_robolectric_script_path)/report-internal.mk -# Clear temporary variables -my_coverage_dir := -my_coverage_file := -my_coverage_report_class := -my_coverage_report_dist_file := -my_coverage_report_jar := -my_coverage_srcs_jars := -my_robolectric_script_path := -my_robolectric_path := -my_srcs_jars := -my_target := -my_collect_file := - -# Clear local variables specific to this build. -LOCAL_ROBOTEST_FAILURE_FATAL := -LOCAL_ROBOTEST_TIMEOUT := -LOCAL_ROBOTEST_FILES := -LOCAL_INSTRUMENT_SOURCE_DIRS := diff --git a/common/robolectric/4.3/wrapper.sh b/common/robolectric/4.3/wrapper.sh deleted file mode 100755 index 8d742460..00000000 --- a/common/robolectric/4.3/wrapper.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash -# -# A simple script to wrap the execution of a command so that it stores its -# output and return value into a file and then process it to later on. -# -# This is meant to be used in a makefile, specifically to allow for the output -# of a command to be stored in a file and added to the dist list, even if the -# command actually failed. -# -# For example, your makefile might include: -# -# my_target := lint -# my_target_output := $(OUT_DIR)/lint-output.txt -# my_target_retval := $(OUT_DIR)/lint-retval.txt -# -# $(my_target_output) $(my_target_retval): PRIVATE_MODULE := $(my_target) -# $(my_target_output) $(my_target_retval): PRIVATE_OUTPUT := $(my_target_output) -# $(my_target_output) $(my_target_retval): PRIVATE_RETVAL := $(my_target_retval) -# $(my_target_output) $(my_target_retval): -# $(PATH)/wrapper.sh \ -# $(PRIVATE_MODULE) \ -# $(PRIVATE_OUTPUT) \ -# $(PRIVATE_RETVAL) \ -# wrap \ -# $(PATH)/run-list.sh $(LOCAL_PATH)/src -# -# $(my_target): PRIVATE_MODULE := $(my_target) -# $(my_target): PRIVATE_OUTPUT := $(my_target_output) -# $(my_target): PRIVATE_RETVAL := $(my_target_retval) -# $(my_target): $(my_target_output) $(my_target_retval) -# $(PATH)/wrapper.sh \ -# $(PRIVATE_MODULE) \ -# $(PRIVATE_OUTPUT) \ -# $(PRIVATE_RETVAL) \ -# eval - -set -euo pipefail - -# Terminate with a fatal error. -function fatal() { - echo "Fatal: $*" - exit 113 -} - -function main() { - local module="${1-}"; shift || fatal "missing argument: module" - local output="${1-}"; shift || fatal "missing argument: output" - local retval="${1-}"; shift || fatal "missing argument: retval" - local action="${1-}"; shift || fatal "missing argument: action" - # The rest of the arguments are the command to run. - - if [ "$action" = 'wrap' ]; then - # Run the command specified by the rest of arguments ("$@") and save output - # and return value. - echo 0 >"${retval}" - "$@" >"${output}" 2>&1 || echo "$?" >"${retval}" - - # Wrapping itself is always successful. - return - elif [ "$action" = 'eval' ]; then - local result="$(cat "${retval}")" - if [ "$result" = 0 ]; then - # If successful only print the last few lines. - tail -n 5 "$output" | sed -e "s/^/${module}: /" - else - # Print the entire output on failure. - cat "$output" | sed -e "s/^/${module}: /" - fi - # Evaluating returns the stored return value. - return "$result" - else - fatal "invalid action: $action" - fi -} - -main "$@" diff --git a/common/robolectric/4.3/wrapper_test.sh b/common/robolectric/4.3/wrapper_test.sh deleted file mode 100755 index 42a04c52..00000000 --- a/common/robolectric/4.3/wrapper_test.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/bash -# -# Tests for wrapper.sh. - -set -euo pipefail - -# The location of the script under test. -readonly WRAPPER="$(realpath "$(dirname "$0")/wrapper.sh")" -# The name of the tests to run. Each test correspond to a function in this file -# whose name is the name of the test prefixed by 'test'. -readonly TEST_NAMES=( - SuccessfulCase - FailedCase - FailedSignalCase -) - -# Fails with an error message. -function fatal() { - echo 1>&2 "FATAL: $@" - exit 113 -} - -function withTestFiles() { - ( - echo '1' - echo '2' - echo '3' - echo '4' - echo '5' - echo '6' - echo '7' - ) >testfile - ( - echo 'module: 1' - echo 'module: 2' - echo 'module: 3' - echo 'module: 4' - echo 'module: 5' - echo 'module: 6' - echo 'module: 7' - ) >testfileWithModule - ( - echo 'module: 3' - echo 'module: 4' - echo 'module: 5' - echo 'module: 6' - echo 'module: 7' - ) >testfileWithModuleTruncated -} - -function expectNoWrapOutput() { - if [ "$(cat output-wrap)" != '' ]; then - echo 'Wrap should not generate any output' - diff testfile output || true - return 1 - fi -} - -function expectSavedOutput() { - if ! diff testfile output; then - echo 'Should have saved the correct output' - diff testfile output || true - return 1 - fi -} - -function expectFullOutputWithModule() { - if ! diff testfileWithModule output-eval; then - echo 'Should have printed the full output' - diff testfileWithModule output || true - return 1 - fi -} - -function expectTruncatedOutputWithModule() { - if ! diff testfileWithModuleTruncated output-eval; then - echo 'Should have printed the truncated output' - diff testfileWithModuleTruncated output || true - return 1 - fi -} - -function whenWrap() { - "$WRAPPER" module "$PWD/output" "$PWD/retval" 'wrap' "$@" \ - 2>/dev/null \ - >output-wrap -} - -function whenEval() { - "$WRAPPER" module "$PWD/output" "$PWD/retval" 'eval' "$@" \ - >output-eval 2>&1 -} - -function testSuccessfulCase() { - withTestFiles - ( - echo '#!/bin/bash' - echo - echo 'cat testfile' - ) >script.sh - chmod 755 script.sh - whenWrap "$PWD/script.sh" - expectNoWrapOutput - if ! whenEval; then - echo 'Should have run successfully' - return 1 - fi - expectSavedOutput - expectTruncatedOutputWithModule -} - -function testFailedCase() { - withTestFiles - ( - echo '#!/bin/bash' - echo - echo 'cat testfile' - echo 'exit 1' - ) >script.sh - chmod 755 script.sh - whenWrap "$PWD/script.sh" - expectNoWrapOutput - if whenEval; then - echo 'Should have failed to run' - return 1 - fi - expectSavedOutput - expectFullOutputWithModule -} -function testFailedSignalCase() { - withTestFiles - ( - echo '#!/bin/bash' - echo - echo 'cat testfile' - echo 'kill -TERM $$' - echo 'echo Should not be printed' - ) >script.sh - chmod 755 script.sh - whenWrap "$PWD/script.sh" - expectNoWrapOutput - if whenEval; then - echo 'Should have failed to run' - return 1 - fi - expectSavedOutput - expectFullOutputWithModule -} - - -function main() { - local result=0 - local tmp="$(mktemp -d)" - for test_name in "${TEST_NAMES[@]}"; do - mkdir -p "$tmp/$test_name" - cd "$tmp/$test_name" - echo -n "Running $test_name..." - test"$test_name" >log || { - echo "FAILED"; - sed -e "s/^/$test_name: /" <log - rm log - result=1; - continue; - } - echo "PASSED" - rm log - done - return "$result" -} - - -main "$@" |