[
  {
    "path": ".gitignore",
    "content": "# IntelliJ IDEA\n.idea\n*.iml\nclasses\n\n# Gradle\n.gradle\nbuild\nlocal.properties\n\n*~\nuserHome"
  },
  {
    "path": ".travis.yml",
    "content": "language: android\n\njdk:\n  - oraclejdk7\n  - oraclejdk8\n\nandroid:\n  components:\n    - build-tools-22.0.1\n    - android-22\n\nscript:\n  - ./gradlew check --stacktrace\n\nafter_success:\n  - ./scripts/install-snapshot.sh\n\nenv:\n  global:\n    - secure: \"gK+gJBrgA2yVj4EJYSSUp5mtIpgFDaHIzmA1bUa6OFYCZ5YcLEDf9lkIF0yDc5mkfV0zv6IIthklNO/DlElRscaKEUZBCbMwUB6kgikyyCrjxSr6mg9WxUA/GQQlIj0ADyXQHzBeox5U3HC3cOHFo4nqwk6A3W6iJyolbv4AJy4=\"\n    - secure: \"t4fgzcW1ws87dHtLCNNActocVQc1s1vP8EcW7coAn5gJyukyi3pZ8NyElE1Rb1pcO0/Jy4Jjax6YDJ5+uGUX+fpLlf4agBylSklY4zV+uU9DQGocgo0t/QVKUiVSHeWJWULvj8cCc8EG7s93vKYkS97AUnjgLntt0A+TN0oy9Jo=\"\n\nsudo: false\n\ncache:\n  directories:\n    - $HOME/.gradle\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nIf you would like to contribute code you can do so through GitHub by forking\nthe repository and sending a pull request.\n\nWhen submitting code, please make every effort to follow existing conventions\nand style in order to keep the code as readable as possible. Please also make\nsure your code compiles by running `./gradlew clean check`.\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# Robolectric Gradle Plugin\n\n## Deprecated\n\nWith the release of Robolectric 3.0, this plugin is no longer needed to run tests with Gradle. Please refer to http://robolectric.org/getting-started for instructions on how to get started with Gradle and Android Studio.\n"
  },
  {
    "path": "build.gradle",
    "content": "buildscript {\n    repositories {\n        jcenter()\n    }\n\n    dependencies {\n        classpath \"com.bmuschko:gradle-nexus-plugin:2.3.1\"\n    }\n}\n\napply plugin: \"groovy\"\napply plugin: \"com.bmuschko.nexus\"\n\ngroup = \"org.robolectric\"\nversion = \"1.2.0-SNAPSHOT\"\n\nsourceCompatibility = JavaVersion.VERSION_1_6\ntargetCompatibility = JavaVersion.VERSION_1_6\n\ndependencies {\n    repositories {\n        mavenCentral()\n    }\n\n    compile gradleApi()\n    compile \"com.android.tools.build:gradle:1.2.0\"\n\n    testCompile \"junit:junit:4.12\"\n    testCompile \"org.assertj:assertj-core:1.7.1\"\n}\n\nmodifyPom {\n    project {\n        name \"Robolectric Gradle Plugin\"\n        description \"A Gradle plugin which enables Robolectric tests for Android.\"\n        url \"https://github.com/robolectric/robolectric-gradle-plugin\"\n        inceptionYear \"2013\"\n\n        scm {\n            url \"https://github.com/robolectric/robolectric-gradle-plugin\"\n            connection \"scm:git:git://github.com/robolectric/robolectric-gradle-plugin.git\"\n            developerConnection \"scm:git:ssh://git@github.com/robolectric/robolectric-gradle-plugin.git\"\n        }\n\n        licenses {\n            license {\n                name \"The Apache Software License, Version 2.0\"\n                url \"http://www.apache.org/licenses/LICENSE-2.0.txt\"\n                distribution \"repo\"\n            }\n        }\n\n        organization {\n            name \"Robolectric\"\n            url \"http://robolectric.org\"\n        }\n\n        developers {\n            developer {\n                id 'erich'\n                name 'Erich Douglass'\n                email 'erich@pivotallabs.com'\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Fri May 08 07:58:31 CEST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.4-all.zip\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "scripts/install-snapshot.sh",
    "content": "#!/bin/bash\n#\n# Deploy a snapshot build to Sonatype.  Only non-pull requests will be deployed.\n#\n\necho \"Pull request: '${TRAVIS_PULL_REQUEST}' on branch '${TRAVIS_BRANCH}' with JDK '${TRAVIS_JDK_VERSION}'\"\nif [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ] && [ \"${TRAVIS_BRANCH}\" = \"master\" ] && [ \"${TRAVIS_JDK_VERSION}\" = \"oraclejdk8\" ]; then\n\n    ./gradlew -PnexusUsername=${CI_DEPLOY_USERNAME} -PnexusPassword=${CI_DEPLOY_PASSWORD} clean assemble uploadArchives\nfi"
  },
  {
    "path": "src/main/groovy/org/robolectric/gradle/Configuration.groovy",
    "content": "package org.robolectric.gradle\n\nimport com.android.build.gradle.AppPlugin\nimport com.android.build.gradle.LibraryPlugin\nimport com.android.build.gradle.api.BaseVariant\nimport org.gradle.api.DomainObjectCollection\nimport org.gradle.api.Project\n\n/**\n * Class used to obtain information about the project configuration.\n */\nclass Configuration {\n    private final Project project\n    private final boolean hasAppPlugin\n    private final boolean hasLibPlugin\n\n    Configuration(Project project) {\n        this.project = project\n        this.hasAppPlugin = project.plugins.any { p -> p instanceof AppPlugin }\n        this.hasLibPlugin = project.plugins.any { p -> p instanceof LibraryPlugin }\n\n        if (!hasAppPlugin && !hasLibPlugin) {\n            throw new IllegalStateException(\"robolectric-gradle-plugin: The 'com.android.application' or 'com.android.library' plugin is required.\")\n        }\n    }\n\n    /**\n     * Return all variants.\n     *\n     * @return Collection of variants.\n     */\n    DomainObjectCollection<BaseVariant> getVariants() {\n        return hasAppPlugin ? project.android.applicationVariants : project.android.libraryVariants\n    }\n}\n"
  },
  {
    "path": "src/main/groovy/org/robolectric/gradle/RobolectricPlugin.groovy",
    "content": "package org.robolectric.gradle\n\nimport org.gradle.api.Plugin\nimport org.gradle.api.Project\nimport org.gradle.api.tasks.testing.Test\n\n/**\n * Robolectric gradle plugin.\n */\nclass RobolectricPlugin implements Plugin<Project> {\n\n    @Override\n    void apply(Project project) {\n        // Configure the project\n        def configuration = new Configuration(project)\n\n        // Configure the test tasks\n        configuration.variants.all { variant ->\n            def taskName = \"test${variant.name.capitalize()}\"\n            def assets = variant.mergeAssets.outputDir\n            def manifest = variant.outputs.first().processManifest.manifestOutputFile\n            def resources = variant.mergeResources.outputDir\n            def packageName = project.android.defaultConfig.applicationId\n\n            // Set RobolectricTestRunner properties\n            def task = project.tasks.findByName(taskName) as Test\n            task.systemProperty \"android.assets\", assets\n            task.systemProperty \"android.manifest\", manifest\n            task.systemProperty \"android.resources\", resources\n            task.systemProperty \"android.package\", packageName\n\n            project.logger.info(\"Configuring task: ${taskName}\")\n            project.logger.info(\"Robolectric assets: ${assets}\")\n            project.logger.info(\"Robolectric manifest: ${manifest}\")\n            project.logger.info(\"Robolectric resources: ${resources}\")\n            project.logger.info(\"Robolectric package: ${packageName}\")\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/resources/META-INF/gradle-plugins/org.robolectric.properties",
    "content": "implementation-class=org.robolectric.gradle.RobolectricPlugin\n"
  },
  {
    "path": "src/test/groovy/org/robolectric/gradle/ExtendedAndroid.groovy",
    "content": "package org.robolectric.gradle\n\nclass ExtendedAndroid {\n    def String message = 'Hello from TestAndroidPlugin'\n}\n"
  },
  {
    "path": "src/test/groovy/org/robolectric/gradle/ExtendedAndroidLibrary.groovy",
    "content": "package org.robolectric.gradle\n\nclass ExtendedAndroidLibrary {\n    def String message = 'Hello from TestAndroidPlugin'\n}\n"
  },
  {
    "path": "src/test/groovy/org/robolectric/gradle/ExtendedAppPlugin.groovy",
    "content": "package org.robolectric.gradle\n\nimport com.android.build.gradle.AppPlugin\nimport org.gradle.api.Project\nimport org.gradle.internal.reflect.Instantiator\nimport org.gradle.tooling.provider.model.ToolingModelBuilderRegistry\n\nimport javax.inject.Inject\n\nclass ExtendedAppPlugin extends AppPlugin {\n\n    @Inject\n    ExtendedAppPlugin(Instantiator instantiator, ToolingModelBuilderRegistry registry) {\n        super(instantiator, registry)\n    }\n\n    @Override\n    void apply(Project project) {\n        super.apply(project)\n        project.extensions.create(\"extended-android\", ExtendedAndroid)\n    }\n}\n\n"
  },
  {
    "path": "src/test/groovy/org/robolectric/gradle/ExtendedLibraryPlugin.groovy",
    "content": "package org.robolectric.gradle\n\nimport com.android.build.gradle.LibraryPlugin\nimport org.gradle.api.Project\nimport org.gradle.internal.reflect.Instantiator\nimport org.gradle.tooling.provider.model.ToolingModelBuilderRegistry\n\nimport javax.inject.Inject\n\nclass ExtendedLibraryPlugin extends LibraryPlugin {\n\n    @Inject\n    ExtendedLibraryPlugin(Instantiator instantiator, ToolingModelBuilderRegistry registry) {\n        super(instantiator, registry)\n    }\n\n    @Override\n    void apply(Project project) {\n        super.apply(project)\n        project.extensions.create(\"extended-android-library\", ExtendedAndroidLibrary)\n    }\n}\n\n"
  },
  {
    "path": "src/test/groovy/org/robolectric/gradle/RobolectricPluginTest.groovy",
    "content": "package org.robolectric.gradle\n\nimport org.gradle.api.Project\nimport org.gradle.api.Task\nimport org.gradle.api.internal.plugins.PluginApplicationException\nimport org.gradle.testfixtures.ProjectBuilder\nimport org.junit.Test\n\nimport static org.assertj.core.api.Assertions.assertThat\n\nclass RobolectricPluginTest {\n    @Test\n    public void plugin_detectsLibraryPlugin() {\n        final Project project = ProjectBuilder.builder().build()\n        project.apply plugin: \"com.android.library\"\n        project.apply plugin: \"org.robolectric\"\n    }\n\n    @Test\n    public void plugin_detectsExtendedLibraryPlugin() {\n        final Project project = ProjectBuilder.builder().build()\n        project.apply plugin: \"extended-android-library\"\n        project.apply plugin: \"org.robolectric\"\n    }\n\n    @Test(expected = PluginApplicationException.class)\n    public void plugin_failsWithoutAndroidPlugin() {\n        final Project project = ProjectBuilder.builder().build()\n        project.apply plugin: \"org.robolectric\"\n    }\n\n    @Test\n    public void plugin_detectsAppPlugin() {\n        final Project project = ProjectBuilder.builder().build()\n        project.apply plugin: \"com.android.application\"\n        project.apply plugin: \"org.robolectric\"\n    }\n\n    @Test\n    public void plugin_detectsExtendedAppPlugin() {\n        final Project project = ProjectBuilder.builder().build()\n        project.apply plugin: \"extended-android\"\n        project.apply plugin: \"org.robolectric\"\n    }\n\n    @Test\n    public void plugin_configuresTestTasks() {\n        final Project project = createProject()\n        project.evaluate()\n\n        def testDebug = project.tasks.getByName(\"testDebug\")\n        assertThat(getPackage(testDebug)).isEqualTo(\"com.example\")\n        assertThat(getAssetPath(testDebug)).endsWith(\"build/intermediates/assets/debug\")\n        assertThat(getResourcePath(testDebug)).endsWith(\"build/intermediates/res/debug\")\n        assertThat(getManifestPath(testDebug)).endsWith(\"build/intermediates/manifests/full/debug/AndroidManifest.xml\")\n\n        def testRelease = project.tasks.getByName(\"testRelease\")\n        assertThat(getPackage(testRelease)).isEqualTo(\"com.example\")\n        assertThat(getAssetPath(testRelease)).endsWith(\"build/intermediates/assets/release\")\n        assertThat(getResourcePath(testRelease)).endsWith(\"build/intermediates/res/release\")\n        assertThat(getManifestPath(testRelease)).endsWith(\"build/intermediates/manifests/full/release/AndroidManifest.xml\")\n    }\n\n    @Test\n    public void plugin_withFlavors_configuresTestTasks() {\n        final Project project = createProject()\n        project.android {\n            productFlavors {\n                flavor1 {\n                }\n                flavor2 {\n                }\n            }\n        }\n        project.evaluate()\n\n        def testFlavor1Debug = project.tasks.getByName(\"testFlavor1Debug\")\n        assertThat(getPackage(testFlavor1Debug)).isEqualTo(\"com.example\")\n        assertThat(getAssetPath(testFlavor1Debug)).endsWith(\"build/intermediates/assets/flavor1/debug\")\n        assertThat(getResourcePath(testFlavor1Debug)).endsWith(\"build/intermediates/res/flavor1/debug\")\n        assertThat(getManifestPath(testFlavor1Debug)).endsWith(\"build/intermediates/manifests/full/flavor1/debug/AndroidManifest.xml\")\n\n        def testFlavor1Release = project.tasks.getByName(\"testFlavor1Release\")\n        assertThat(getPackage(testFlavor1Release)).isEqualTo(\"com.example\")\n        assertThat(getAssetPath(testFlavor1Release)).endsWith(\"build/intermediates/assets/flavor1/release\")\n        assertThat(getResourcePath(testFlavor1Release)).endsWith(\"build/intermediates/res/flavor1/release\")\n        assertThat(getManifestPath(testFlavor1Release)).endsWith(\"build/intermediates/manifests/full/flavor1/release/AndroidManifest.xml\")\n\n        def testFlavor2Debug = project.tasks.getByName(\"testFlavor2Debug\")\n        assertThat(getPackage(testFlavor2Debug)).isEqualTo(\"com.example\")\n        assertThat(getAssetPath(testFlavor2Debug)).endsWith(\"build/intermediates/assets/flavor2/debug\")\n        assertThat(getResourcePath(testFlavor2Debug)).endsWith(\"build/intermediates/res/flavor2/debug\")\n        assertThat(getManifestPath(testFlavor2Debug)).endsWith(\"build/intermediates/manifests/full/flavor2/debug/AndroidManifest.xml\")\n\n        def testFlavor2Release = project.tasks.getByName(\"testFlavor2Release\")\n        assertThat(getPackage(testFlavor2Release)).isEqualTo(\"com.example\")\n        assertThat(getAssetPath(testFlavor2Release)).endsWith(\"build/intermediates/assets/flavor2/release\")\n        assertThat(getResourcePath(testFlavor2Release)).endsWith(\"build/intermediates/res/flavor2/release\")\n        assertThat(getManifestPath(testFlavor2Release)).endsWith(\"build/intermediates/manifests/full/flavor2/release/AndroidManifest.xml\")\n    }\n\n    @Test\n    public void plugin_withFlavorDimensions_configuresTestTasks() {\n        final Project project = createProject()\n        project.android {\n            flavorDimensions \"a\", \"B\"\n            productFlavors {\n                a1 {\n                    dimension \"a\"\n                }\n                A2 {\n                    dimension \"a\"\n                }\n                B1 {\n                    dimension \"B\"\n                }\n                b2 {\n                    dimension \"B\"\n                }\n            }\n        }\n        project.evaluate()\n\n        def test_a1B1_Debug = project.tasks.getByName(\"testA1B1Debug\")\n        assertThat(getPackage(test_a1B1_Debug)).isEqualTo(\"com.example\")\n        assertThat(getAssetPath(test_a1B1_Debug)).endsWith(\"build/intermediates/assets/a1B1/debug\")\n        assertThat(getResourcePath(test_a1B1_Debug)).endsWith(\"build/intermediates/res/a1B1/debug\")\n        assertThat(getManifestPath(test_a1B1_Debug)).endsWith(\"build/intermediates/manifests/full/a1B1/debug/AndroidManifest.xml\")\n\n        def test_A2b2_Release = project.tasks.getByName(\"testA2B2Release\")\n        assertThat(getPackage(test_A2b2_Release)).isEqualTo(\"com.example\")\n        assertThat(getAssetPath(test_A2b2_Release)).endsWith(\"build/intermediates/assets/A2b2/release\")\n        assertThat(getResourcePath(test_A2b2_Release)).endsWith(\"build/intermediates/res/A2b2/release\")\n        assertThat(getManifestPath(test_A2b2_Release)).endsWith(\"build/intermediates/manifests/full/A2b2/release/AndroidManifest.xml\")\n\n    }\n\n    private static Project createProject() {\n        final Project project = ProjectBuilder.builder().build()\n        project.apply plugin: \"com.android.application\"\n        project.apply plugin: \"org.robolectric\"\n        project.android {\n            compileSdkVersion 22\n            buildToolsVersion \"22.0.1\"\n\n            defaultConfig {\n                applicationId \"com.example\"\n            }\n        }\n        return project\n    }\n\n    private static String getPackage(Task task) {\n        return task.systemProperties.get(\"android.package\")\n    }\n\n    private static String getAssetPath(Task task) {\n        return task.systemProperties.get(\"android.assets\").getPath()\n    }\n\n    private static String getManifestPath(Task task) {\n        return task.systemProperties.get(\"android.manifest\").getPath()\n    }\n\n    private static String getResourcePath(Task task) {\n        return task.systemProperties.get(\"android.resources\").getPath()\n    }\n}\n"
  },
  {
    "path": "src/test/resources/META-INF/gradle-plugins/extended-android-library.properties",
    "content": "implementation-class=org.robolectric.gradle.ExtendedLibraryPlugin\n"
  },
  {
    "path": "src/test/resources/META-INF/gradle-plugins/extended-android.properties",
    "content": "implementation-class=org.robolectric.gradle.ExtendedAppPlugin\n"
  }
]