[
  {
    "path": ".gitignore",
    "content": "### Gradle ###\n.gradle\nbuild/\ngradle-app.setting\n!gradle-wrapper.jar\n\n### Intellij ###\n\n*.iml\n.idea/\n*.ipr\n*.iws\nout/\n\n### Eclipse ###\n.settings/\n.metadata\n.gradle\nbin/\n.classpath\n.project\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: groovy\nsudo: false\ndist: trusty\nbefore_cache:\n  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock\n  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/\ncache:\n  directories:\n    - $HOME/.gradle/caches/\n    - $HOME/.gradle/wrapper/\nenv:\n  - PLUGIN_BUILD_DIR=$TRAVIS_BUILD_DIR/gradle-lombok-plugin\nbefore_install:\n  - jdk_switcher use openjdk8\n  - cd $PLUGIN_BUILD_DIR\nscript:\n  - ./gradlew check\n  - $TRAVIS_BUILD_DIR/examples/.travis-run-examples.sh\n  - jdk_switcher use openjdk8\nafter_success:\n  - bash <(curl -s https://codecov.io/bash)\n  - ./.travis-publishOnRelease.sh\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nPlease feel free to contribute using pull requests.\nAll contributions must be licensed under the [Apache License 2.0](LICENSE) or compatible.\n\n## Testing IDEs locally\n\nAll features should be covered by unit and integration tests.\nStill, since we don't have automated IDE tests it might be necessary to test your contribution\nmanually for IDE compatibility.\n\nPerform the following Gradle command to publish the plugin to your local Maven repository:\n\n```\n./gradlew publishToMavenLocal\n```\n\nA simple sample build.gradle using that will look like:\n\n```\nbuildscript {\n    repositories {\n        mavenLocal()\n    }\n    dependencies {\n        classpath 'io.franzbecker:gradle-lombok:+'\n    }\n}\n\napply plugin: 'java'\napply plugin: 'io.franzbecker.gradle-lombok'\n```\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 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\n"
  },
  {
    "path": "README.md",
    "content": "# gradle-lombok\n[![License](http://img.shields.io/badge/license-Apache_2.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0.html)\n[![Build Status](https://app.travis-ci.com/franzbecker/gradle-lombok.svg?branch=master)](https://app.travis-ci.com/franzbecker/gradle-lombok)\n[![codecov.io](http://codecov.io/github/franzbecker/gradle-lombok/coverage.svg?branch=master)](http://codecov.io/github/franzbecker/gradle-lombok?branch=master)\n\n\nA Gradle plugin for project [Lombok](https://projectlombok.org) support.\n\n__Maintenance mode.__ Only critical bugs will be fixed and there won't be any more feature from my side. \nPlease feel free to continue contributing and open PRs, I will still review them in a timely manner.\n\n# Usage\nThe plugin is included in the [central plugin repository](https://plugins.gradle.org/plugin/io.franzbecker.gradle-lombok/5.0.0). \n\nA minimal `build.gradle` looks like this:\n\n    plugins {\n        id 'io.franzbecker.gradle-lombok' version '5.0.0'\n        id 'java'\n    }\n    \n    repositories {\n        jcenter() // or Maven central, required for Lombok dependency\n    }\n\nAfter applying the plugin, the Lombok annotations can be used directly in any Java code and the Lombok Eclipse installer can be called via `gradlew installLombok`. The Lombok version can be configured using the following syntax:\n\n    lombok { // optional: values below are the defaults\n        version = \"1.18.12\"\n        sha256 = \"49381508ecb02b3c173368436ef71b24c0d4418ad260e6cc98becbcf4b345406\"\n    }\n\nIf the verifcation of the integrity shall be skipped, the `sha256` value needs to be set to null or an empty string:\n\n    lombok {\n        sha256 = \"\" // skip verifyLombok task\n    }\n\nSome examples can be found in the [examples](https://github.com/franzbecker/gradle-lombok/tree/master/examples) folder.\n\n\n# Motivation\n\nWhen using Lombok in your Gradle project, you should consider using this plugin because\n\n* it adds the Lombok dependency to the classpath\n* it simplifies the Eclipse IDE installation\n* it offers support for delomboking\n\n## Adding the Lombok dependency\n\nThis plugin adds the Lombok dependency to `compileOnly` and `testCompileOnly`. Starting with Gradle 4.6 also `annotationProcessor` and `testAnnotationProcessor`.\nNote that for using Gradle prior to version 2.12 please use this plugin in version \"1.11\" which is the last version that supports Gradle < 2.12.\n\n## Simplifying Eclipse IDE installation\n\nThe project Lombok website states:\n> NOTE: You'll still need to download lombok, or doubleclick on the lombok.jar file downloaded by maven / ivy / gradle, to install lombok into your eclipse installation.\n \nWhen using Lombok in teams with no automated Eclipse provisioning this is quite a pain. Every developer has to retrieve the JAR in the right version, verify its integrity (some won't) and call `java -jar lombok.jar`.\n\nThis plugin adds a task called `installLombok` to your Gradle build that uses the dependency that has already been added to the compile-only scope, verifies its integrity using SHA-256 and finally invokes the main class of the JAR. This greatly simplifies the installation process for each developer and makes sure that the same version is used across the team.\n\n## Delombok support\n\nThe plugin offers basic support for delomboking. The `DelombokTask` is a simple `JavaExec` task that calls `delombok` on Lombok's main class and simplifies the setup of such a task in the build process. It is not a ready to use task.\n\nExamples can be found at:\n\n[examples/delombok-gradle-groovy/build.gradle](examples/delombok-gradle-groovy/build.gradle) and<br/>\n[examples/delombok-gradle-kotlin/build.gradle.kts](examples/delombok-gradle-kotlin/build.gradle.kts)\n"
  },
  {
    "path": "examples/.travis-run-examples.sh",
    "content": "#!/bin/bash\n\nfunction cleanup {\n  cd $PLUGIN_BUILD_DIR\n}\ntrap cleanup EXIT\n\n# Install JDK 11\ncd $TRAVIS_BUILD_DIR\nwget -q https://github.com/sormuras/bach/raw/master/install-jdk.sh && chmod +x install-jdk.sh\nJAVA_HOME=~/jdk-11 && ./install-jdk.sh --feature 11 --target $JAVA_HOME && PATH=$JAVA_HOME/bin:$PATH\n\n# Run the examples\ncd examples\n./gradlew build\n"
  },
  {
    "path": "examples/README.md",
    "content": "# Examples\n\nThis folder contains examples on how to use Lombok with this Gradle plugin.\n\n## hello-world\n\nSimple project demonstrating `@Data`, `@SneakyThrows` and `val`.\n\nRun it with:\n\n    ./gradlew :hello-world:build\n\n## delombok-gradle-groovy\n\nDemonstrates how the delombok task can be used to generate JavaDoc with Groovy as the Gradle script language.\n\nRun it with:\n\n    ./gradlew :delombok-gradle-groovy:javadoc\n\nAnd open up [Greeting.html](delombok-gradle-groovy/build/docs/javadoc/com/example/Greeting.html) in your browser.\n\n## delombok-gradle-kotlin\n\nDemonstrates how the delombok task can be used to generate JavaDoc with Kotlin as the Gradle script language.\n\nRun it with:\n\n    ./gradlew :delombok-gradle-kotlin:javadoc\n\nAnd open up [Greeting.html](delombok-gradle-kotlin/build/docs/javadoc/com/example/Greeting.html) in your browser.\n"
  },
  {
    "path": "examples/build.gradle",
    "content": "buildscript {\n    repositories {\n        maven {\n            url 'https://plugins.gradle.org/m2/'\n        }\n    }\n    dependencies {\n        classpath 'io.franzbecker:gradle-lombok:2.0'\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\nsubprojects {\n    apply plugin: 'java'\n    apply plugin: 'io.franzbecker.gradle-lombok'\n\n    dependencies {\n        testCompile 'org.assertj:assertj-core:3.11.1'\n        testCompile 'org.junit.jupiter:junit-jupiter-api:5.3.2'\n        testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.2'\n        testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.3.2'\n    }\n\n    test {\n        useJUnitPlatform()\n        testLogging {\n            events \"passed\", \"skipped\", \"failed\"\n        }\n    }\n}\n\n"
  },
  {
    "path": "examples/delombok-gradle-groovy/build.gradle",
    "content": "import io.franzbecker.gradle.lombok.task.DelombokTask\n\ntask delombok(type: DelombokTask, dependsOn: compileJava) {\n    ext.outputDir = file(\"$buildDir/delombok\")\n    outputs.dir(outputDir)\n    sourceSets.main.java.srcDirs.each {\n        inputs.dir(it)\n        args(it, \"-d\", outputDir)\n    }\n    doFirst {\n        outputDir.deleteDir()\n    }\n}\n\njavadoc {\n    dependsOn delombok\n    source = delombok.outputDir\n    failOnError = false\n}\n"
  },
  {
    "path": "examples/delombok-gradle-groovy/src/main/java/com/example/Greeting.java",
    "content": "package com.example;\n\nimport lombok.Data;\n\n@Data\npublic class Greeting {\n\n    private String message;\n}\n"
  },
  {
    "path": "examples/delombok-gradle-kotlin/build.gradle.kts",
    "content": "import io.franzbecker.gradle.lombok.task.DelombokTask\n\ntasks {\n\n    val delombok by registering(DelombokTask::class) {\n        dependsOn(compileJava)\n        val outputDir by extra { file(\"$buildDir/delombok\") }\n        outputs.dir(outputDir)\n        sourceSets[\"main\"].java.srcDirs.forEach {\n            inputs.dir(it)\n            args(it, \"-d\", outputDir)\n        }\n        doFirst {\n            outputDir.delete()\n        }\n    }\n\n    javadoc {\n        dependsOn(delombok)\n        val outputDir: File by delombok.get().extra\n        source = fileTree(outputDir)\n        isFailOnError = false\n    }\n\n}\n"
  },
  {
    "path": "examples/delombok-gradle-kotlin/src/main/java/com/example/Greeting.java",
    "content": "package com.example;\n\nimport lombok.Data;\n\n@Data\npublic class Greeting {\n\n    private String message;\n}\n"
  },
  {
    "path": "examples/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.1.1-all.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "examples/gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\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\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\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='\"-Xmx64m\"'\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\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\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\" -a \"$nonstop\" = \"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    JAVACMD=`cygpath --unix \"$JAVACMD\"`\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# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "examples/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\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%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "examples/hello-world/src/main/java/com/example/Greeting.java",
    "content": "package com.example;\n\nimport lombok.Data;\n\n@Data\npublic class Greeting {\n\n    private String message;\n\n}\n"
  },
  {
    "path": "examples/hello-world/src/main/java/com/example/HelloWorld.java",
    "content": "package com.example;\n\nimport lombok.val;\n\npublic class HelloWorld {\n\n    public static void main(String[] args) {\n        val greeting = new Greeting();\n        greeting.setMessage(\"Hello world!\");\n        System.out.println(greeting.getMessage());\n    }\n}\n"
  },
  {
    "path": "examples/hello-world/src/main/java/com/example/SneakyHelloWorld.java",
    "content": "package com.example;\n\nimport lombok.SneakyThrows;\n\npublic class SneakyHelloWorld {\n\n    @SneakyThrows()\n    public byte[] throwingStuff() {\n        return \"test\".getBytes(\"unsupported\");\n    }\n\n}\n"
  },
  {
    "path": "examples/hello-world/src/test/java/com/example/GreetingTest.java",
    "content": "package com.example;\n\nimport org.junit.jupiter.api.Test;\n\nimport static org.assertj.core.api.Assertions.assertThat;\n\nclass GreetingTest {\n\n    @Test\n    void canSetMessage() {\n        // given\n        Greeting greeting = new Greeting();\n\n        // when\n        greeting.setMessage(\"test\");\n\n        // then\n        assertThat(greeting.getMessage()).isEqualTo(\"test\");\n    }\n}"
  },
  {
    "path": "examples/hello-world/src/test/java/com/example/SneakyHelloWorldTest.java",
    "content": "package com.example;\n\nimport lombok.val;\nimport org.junit.jupiter.api.Test;\n\nimport java.io.UnsupportedEncodingException;\n\nimport static org.assertj.core.api.Assertions.assertThatExceptionOfType;\n\nclass SneakyHelloWorldTest {\n\n    @Test\n    void throwsException() {\n        // given\n        val sneaky = new SneakyHelloWorld();\n\n        // when + then\n        assertThatExceptionOfType(UnsupportedEncodingException.class)\n            .isThrownBy(() -> sneaky.throwingStuff());\n    }\n}\n"
  },
  {
    "path": "examples/settings.gradle",
    "content": "// this defines a composite build - you won't need this in your project\nincludeBuild '../gradle-lombok-plugin'\n\nrootProject.name = 'examples'\n\ninclude 'hello-world'\ninclude 'delombok-gradle-groovy'\ninclude 'delombok-gradle-kotlin'\n"
  },
  {
    "path": "gradle-lombok-plugin/.travis-publishOnRelease.sh",
    "content": "#!/bin/bash\n# Execute only on tag builds where the tag starts with 'v'\n\nif [[ -n \"$TRAVIS_TAG\" && \"$TRAVIS_TAG\" == v* ]]; then\n    echo \"Publishing version: $TRAVIS_TAG\"\n    echo \"gradle.publish.key=$GRADLE_PUBLISH_KEY\" >> gradle.properties\n    echo \"gradle.publish.secret=$GRADLE_PUBLISH_SECRET\" >> gradle.properties\n    ./gradlew publishPlugins\nfi"
  },
  {
    "path": "gradle-lombok-plugin/build.gradle",
    "content": "plugins {\n    id 'com.gradle.plugin-publish' version '0.11.0'\n    id 'net.researchgate.release' version '2.8.1'\n    id 'pl.droidsonroids.jacoco.testkit' version '1.0.3' // required until https://github.com/gradle/gradle/issues/1465 is resolved\n    id 'java-gradle-plugin'\n    id 'groovy'\n    id 'maven'\n    id 'jacoco'\n    id 'maven-publish'\n}\n\ngroup 'io.franzbecker'\n\nsourceCompatibility = 1.8\ntargetCompatibility = 1.8\n\nrepositories {\n    jcenter()\n}\n\ndependencies {\n    testCompile 'junit:junit:4.12'\n    testCompile gradleTestKit()\n    testCompile 'com.netflix.nebula:nebula-test:6.1.2'\n}\n\ntask sourcesJar(type: Jar, dependsOn: classes) {\n    classifier 'sources'\n    from sourceSets.main.allSource\n}\n\nartifacts {\n    archives sourcesJar\n}\n\njacoco {\n    toolVersion = \"0.8.3\"\n}\n\njacocoTestReport {\n    reports {\n        xml.enabled = true\n        html.enabled = true\n    }\n}\n\ncheck.dependsOn jacocoTestReport\n\ngradlePlugin {\n    plugins {\n        lombokPlugin {\n            id = 'io.franzbecker.gradle-lombok'\n            displayName = 'Gradle Lombok plugin'\n            description = 'A gradle plugin that simplifies the usage of the Lombok annotation processor.'\n            implementationClass = 'io.franzbecker.gradle.lombok.LombokPlugin'\n        }\n    }\n}\n\npluginBundle {\n    website = 'https://github.com/franzbecker/gradle-lombok'\n    vcsUrl = 'https://github.com/franzbecker/gradle-lombok.git'\n    tags = ['gradle', 'lombok']\n\n    plugins {\n        lombokPlugin {\n            id = 'io.franzbecker.gradle-lombok'\n        }\n    }\n\n    mavenCoordinates {\n        groupId = 'io.franzbecker'\n        artifactId = 'gradle-lombok'\n    }\n}\n\ntask updateReadmeVersion {\n    doLast {\n        def versionPattern = /\\d+.\\d+(.\\d+)?/\n        def encoding = 'UTF-8'\n        File file = new File(\"../README.md\")\n\n        // String replacements - Readme isn't long enough to justify advanced code ;)\n        String text = file.getText(encoding)\n        text = text.replaceAll(\"gradle-lombok' version '${versionPattern}'\", \"gradle-lombok' version '${project.version}'\")\n        text = text.replaceAll(\"gradle-lombok/${versionPattern}\", \"gradle-lombok/${project.version}\")\n\n        file.setText(text, encoding)\n    }\n}\nupdateReadmeVersion.shouldRunAfter tasks.getByName('confirmReleaseVersion')\n\n/*\n * Configure release plugin.\n * Remove tasks \"updateVersion\" and \"commitNewVersion\" as we don't want the new SNAPSHOT\n * version commit on the master branch.\n */\ntasks.release.tasks -= [\"updateVersion\", \"commitNewVersion\"]\nrelease {\n    preTagCommitMessage = '[release] '\n    tagCommitMessage = '[release] '\n    tagTemplate = 'v${version}'\n}\ntasks.getByName('preTagCommit').dependsOn updateReadmeVersion\n\npublishing {\n    publications {\n        mavenJava(MavenPublication) {\n            from components.java\n        }\n    }\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.1.1-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "gradle-lombok-plugin/gradle.properties",
    "content": "version=5.0.0\n"
  },
  {
    "path": "gradle-lombok-plugin/gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\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\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\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='\"-Xmx64m\"'\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\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\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\" -a \"$nonstop\" = \"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    JAVACMD=`cygpath --unix \"$JAVACMD\"`\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# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradle-lombok-plugin/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\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%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "gradle-lombok-plugin/settings.gradle",
    "content": "rootProject.name = 'gradle-lombok'\n"
  },
  {
    "path": "gradle-lombok-plugin/src/main/groovy/io/franzbecker/gradle/lombok/LombokPlugin.groovy",
    "content": "package io.franzbecker.gradle.lombok\n\nimport io.franzbecker.gradle.lombok.task.InstallLombokTask\nimport io.franzbecker.gradle.lombok.task.VerifyLombokTask\nimport org.gradle.api.Plugin\nimport org.gradle.api.Project\nimport org.gradle.api.plugins.JavaPlugin\nimport org.gradle.util.GradleVersion\n\nimport static org.gradle.api.plugins.JavaPlugin.*\n\n/**\n * Plugin for project Lombok support.\n *\n * The main responsibility is to add Lombok as a \"provided\" dependency which is\n * only required during compilation and should not leave any trace on the resulting artifact.\n *\n * Furthermore, this plugin provides support for easy installation of Lombok into the IDE.\n * For this purpose, it verifies the JAR it adds as dependency (using its SHA-256 hash) and\n * the invokes it in order to call the default Lombok UI.\n *\n * @see <a href=\"https://projectlombok.org\">https://projectlombok.org</a>\n */\nclass LombokPlugin implements Plugin<Project> {\n\n    static final String NAME = \"io.franzbecker.gradle-lombok\"\n    static final String LOMBOK_CONFIGURATION_NAME = COMPILE_ONLY_CONFIGURATION_NAME\n    static final String VERIFY_LOMBOK_CLASSPATH_CONFIGURATION_NAME = COMPILE_CLASSPATH_CONFIGURATION_NAME\n\n    @Override\n    void apply(Project project) {\n        project.extensions.create(LombokPluginExtension.NAME, LombokPluginExtension)\n\n        project.plugins.withType(JavaPlugin) {\n            project.afterEvaluate {\n                addLombokDependency(project)\n            }\n            configureTasks(project)\n        }\n    }\n\n    private void addLombokDependency(Project project) {\n        addLombokDependency(project, COMPILE_ONLY_CONFIGURATION_NAME)\n        addLombokDependency(project, TEST_COMPILE_ONLY_CONFIGURATION_NAME)\n\n        boolean atLeastGradle4_6 = GradleVersion.version(project.gradle.gradleVersion) >= GradleVersion.version('4.6')\n        if (atLeastGradle4_6) {\n            addLombokDependency(project, ANNOTATION_PROCESSOR_CONFIGURATION_NAME)\n            addLombokDependency(project, TEST_ANNOTATION_PROCESSOR_CONFIGURATION_NAME)\n        }\n    }\n\n    private void addLombokDependency(Project project, String configurationName) {\n        project.dependencies.add(\n                configurationName,\n                \"org.projectlombok:lombok:${project.lombok.version}\",\n                { transitive = false }\n        )\n    }\n\n    /**\n     * Adds {@link VerifyLombokTask} and {@link InstallLombokTask} and lets installLombok\n     * depend on verifyLombok.\n     */\n    private void configureTasks(Project project) {\n        def extension = project.extensions.findByType(LombokPluginExtension)\n\n        // Add VerifyLombokTask\n        def verifyLombok = project.task(type: VerifyLombokTask, VerifyLombokTask.NAME)\n        verifyLombok.outputs.upToDateWhen { !extension.sha256 }\n\n        // Add InstallLombokTask\n        project.task(type: InstallLombokTask, InstallLombokTask.NAME).with {\n            outputs.upToDateWhen { false }\n            dependsOn verifyLombok\n            group = \"IDE\"\n        }\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/main/groovy/io/franzbecker/gradle/lombok/LombokPluginExtension.groovy",
    "content": "package io.franzbecker.gradle.lombok\n\n/**\n * Configuration for the plugin.\n */\nclass LombokPluginExtension {\n\n    static final String NAME = \"lombok\"\n    static final String DEFAULT_VERSION = \"1.18.12\"\n    static final String DEFAULT_VERSION_HASH = \"49381508ecb02b3c173368436ef71b24c0d4418ad260e6cc98becbcf4b345406\"\n\n    /** The version of Lombok to use. */\n    String version = DEFAULT_VERSION\n\n    /** The SHA-256 hash of the JAR. */\n    String sha256 = DEFAULT_VERSION_HASH\n\n    /** The main class to call when invoking {@linkplain InstallLombokTask#NAME}. */\n    String main = \"lombok.launch.Main\"\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/main/groovy/io/franzbecker/gradle/lombok/task/DelombokTask.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\n\n\nimport io.franzbecker.gradle.lombok.LombokPluginExtension\nimport org.gradle.api.Task\nimport org.gradle.api.plugins.JavaPlugin\nimport org.gradle.api.tasks.Input\nimport org.gradle.api.tasks.JavaExec\n\n/**\n * Task type for delomboking. Not added to the project by default,\n * has to be instantiated and configured in the using gradle build.\n */\nclass DelombokTask extends JavaExec {\n\n    @Input\n    String compileConfigurationName = JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME\n\n    DelombokTask() {\n        super()\n        args \"delombok\"\n    }\n\n    @Override\n    Task configure(Closure closure) {\n        setMain(project.extensions.findByType(LombokPluginExtension).main)\n        return super.configure(closure)\n    }\n\n    @Override\n    void exec() {\n        classpath(project.configurations.getByName(compileConfigurationName))\n        super.exec()\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/main/groovy/io/franzbecker/gradle/lombok/task/InstallLombokTask.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\nimport io.franzbecker.gradle.lombok.LombokPlugin\nimport io.franzbecker.gradle.lombok.LombokPluginExtension\nimport org.gradle.api.Task\nimport org.gradle.api.tasks.JavaExec\n\n/**\n * Invokes the Lombok UI so that the user can install it into the IDE.\n */\nclass InstallLombokTask extends JavaExec {\n\n    static final String NAME = \"installLombok\"\n\n    @Override\n    Task configure(Closure closure) {\n        setMain(project.extensions.findByType(LombokPluginExtension).main)\n        return super.configure(closure)\n    }\n\n    @Override\n    void exec() {\n        // Configure JavaExec\n        setIgnoreExitValue(true)\n        setClasspath(project.configurations.getByName(LombokPlugin.LOMBOK_CONFIGURATION_NAME))\n        super.exec()\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/main/groovy/io/franzbecker/gradle/lombok/task/VerifyLombokTask.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\n\nimport io.franzbecker.gradle.lombok.LombokPlugin\nimport io.franzbecker.gradle.lombok.LombokPluginExtension\nimport io.franzbecker.gradle.lombok.util.HashUtil\nimport org.gradle.api.DefaultTask\nimport org.gradle.api.artifacts.Configuration\nimport org.gradle.api.resources.ResourceException\nimport org.gradle.api.tasks.Internal\nimport org.gradle.api.tasks.TaskAction\n\n/**\n * Task that verifies the integrity of the Lombok dependency.\n */\nclass VerifyLombokTask extends DefaultTask {\n\n    static final String NAME = \"verifyLombok\"\n\n    @Internal\n    HashUtil hashUtil = new HashUtil()\n\n    @TaskAction\n    void verifyLombok() {\n        // Retrieve extension and configuration\n        def extension = project.extensions.findByType(LombokPluginExtension)\n        def configuration = project.configurations.getByName(LombokPlugin.VERIFY_LOMBOK_CLASSPATH_CONFIGURATION_NAME)\n        verifyLombok(extension, configuration)\n    }\n\n    protected verifyLombok(LombokPluginExtension extension, Configuration configuration) {\n        if (extension.sha256) {\n            // Lookup JAR and verify it\n            def lombokJar = getLombokJar(extension.version, configuration)\n            verifyIntegrity(extension.sha256, lombokJar)\n        } else {\n            logger.info(\"Skipping verification of Lombok since SHA-256 was not configured.\")\n        }\n    }\n\n    /**\n     * Retrieves the JAR from the dependencies.\n     *\n     * @throws org.gradle.api.resources.ResourceException if the JAR cannot be resolved\n     */\n    protected File getLombokJar(String lombokVersion, Configuration configuration) {\n        // Retrieve file\n        def lombokFileName = \"lombok-${lombokVersion}.jar\"\n        logger.debug(\"Searching for '${lombokFileName}' in dependencies of configuration '${configuration.name}'.\")\n        def lombokJar = configuration.files.find { File file -> file.name == lombokFileName }\n        if (!lombokJar) {\n            throw new ResourceException(\"Could not find '${lombokFileName}' in dependencies of configuration '${configuration.name}'.\")\n        }\n        logger.debug(\"Found '${lombokJar}'.\")\n        return lombokJar\n    }\n\n    /**\n     * Verifies the hash code of the passed file as configured.\n     */\n    protected void verifyIntegrity(String expectedSha256, File lombokJar) {\n        def actualSha256 = hashUtil.calculateSha256(lombokJar)\n        if (expectedSha256 != actualSha256) {\n            def message = \"\"\"\\\n                Verification of Lombok JAR failed!\n\n                Local JAR file:    ${lombokJar}\n\n                Expected checksum: ${expectedSha256}\n                  Actual checksum: ${actualSha256}\n            \"\"\".stripIndent()\n            throw new ResourceException(message)\n        }\n        logger.debug(\"Calculates matching hash '${actualSha256}' for '${lombokJar}'.\")\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/main/java/io/franzbecker/gradle/lombok/util/HashUtil.java",
    "content": "package io.franzbecker.gradle.lombok.util;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.RandomAccessFile;\nimport java.nio.MappedByteBuffer;\nimport java.nio.channels.FileChannel;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\n\n/**\n * Calculate SHA-256 hash for a given file.\n * <p>\n * Gradle supports only an internal API for this (@link{org.gradle.internal.hash.HashUtil}).\n */\npublic class HashUtil {\n\n    /**\n     * Calculates the SHA-256 to a given file.\n     *\n     * @param file the file\n     * @return the SHA-256\n     */\n    public String calculateSha256(File file) {\n        try (RandomAccessFile inputStream = new RandomAccessFile(file, \"r\"); FileChannel channel = inputStream.getChannel()) {\n            // Calculate SHA-256\n            MessageDigest sha256 = MessageDigest.getInstance(\"SHA-256\");\n            MappedByteBuffer buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());\n            sha256.update(buffer);\n\n            // Convert to String\n            byte digest[] = sha256.digest();\n            StringBuilder result = new StringBuilder();\n            for (int i = 0; i < digest.length; i++) {\n                String hex = Integer.toHexString(0xff & digest[i]);\n                if (hex.length() == 1) {\n                    result.append('0');\n                }\n                result.append(hex);\n            }\n\n            return result.toString();\n        } catch (NoSuchAlgorithmException | IOException e) {\n            throw new RuntimeException(\"Could not calculate SHA-256 hash of file: \" + file, e);\n        }\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/main/resources/META-INF/gradle-plugins/io.franzbecker.gradle-lombok.properties",
    "content": "implementation-class=io.franzbecker.gradle.lombok.LombokPlugin"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/AbstractIntegrationTest.groovy",
    "content": "package io.franzbecker.gradle.lombok\n\nimport org.gradle.testkit.runner.BuildResult\nimport org.gradle.testkit.runner.GradleRunner\nimport org.gradle.testkit.runner.TaskOutcome\nimport org.junit.Rule\nimport org.junit.rules.TemporaryFolder\nimport spock.lang.Specification\n\n/**\n * Abstract base class for integration tests.\n */\nabstract class AbstractIntegrationTest extends Specification {\n\n    @Rule\n    TemporaryFolder testProjectDir\n    File projectDir\n    File buildFile\n    File propertiesFile\n\n    def setup() {\n        projectDir = testProjectDir.root\n        buildFile = createFile('build.gradle')\n        writeDefaultBuildFileContents()\n        propertiesFile = createFile('gradle.properties')\n        configureJacoco()\n    }\n\n    protected void writeDefaultBuildFileContents() {\n        buildFile <<  \"\"\"\\\n            plugins {\n                id 'java'\n                id '${LombokPlugin.NAME}'\n            }\n            repositories {\n                jcenter()\n            }\n        \"\"\".stripIndent()\n    }\n\n    /** see https://github.com/koral--/jacoco-gradle-testkit-plugin */\n    private void configureJacoco() {\n        propertiesFile << this.class.classLoader.getResourceAsStream('testkit-gradle.properties')\n    }\n\n    protected GradleRunner createGradleRunner() {\n        def runner = GradleRunner.create()\n                .withPluginClasspath()\n                .withProjectDir(projectDir)\n        return runner\n    }\n\n    BuildResult runBuild(String... arguments) {\n        def runner = createGradleRunner()\n        return runner.withArguments(arguments).build()\n    }\n\n    BuildResult runBuildAndFail(String... arguments) {\n        def runner = createGradleRunner()\n        return runner.withArguments(arguments).buildAndFail()\n    }\n\n    BuildResult runTaskAndFail(String task) {\n        def result = runBuildAndFail(task)\n        def buildTask = result.getTasks().first()\n        assert buildTask.path == \":$task\"\n        assert buildTask.outcome == TaskOutcome.FAILED\n        return result\n    }\n\n    File createFile(String path) {\n        File file = new File(projectDir, path)\n        file.getParentFile().mkdirs()\n        file.createNewFile()\n        return file\n    }\n\n    protected void createSimpleTestCase() {\n        createSimpleTestCase(\"testCompile\")\n    }\n\n    protected void createSimpleTestCase(String testConfigurationName) {\n        // build configuration supporting JUnit\n        buildFile << \"\"\"\n            dependencies {\n                ${testConfigurationName} 'junit:junit:4.12'\n            }\n        \"\"\".stripIndent()\n\n        // source code to compile and test\n        createJavaSource()\n        createTestSource()\n    }\n\n    private void createJavaSource() {\n        def file = createFile(\"src/main/java/com/example/HelloWorld.java\")\n        file << \"\"\"\\\n            package com.example;\n\n            import lombok.Data;\n\n            @Data\n            public class HelloWorld {\n\n                private String id;\n\n            }\n        \"\"\".stripIndent()\n    }\n\n    private void createTestSource() {\n        def file = createFile(\"src/test/java/com/example/HelloWorldTest.java\")\n        file << \"\"\"\\\n            package com.example;\n\n            import java.util.UUID;\n            import org.junit.Test;\n            import org.junit.Assert;\n\n            public class HelloWorldTest {\n\n                @Test\n                public void testHelloWorld() {\n                    // Given\n                    HelloWorld obj = new HelloWorld();\n                    String id = UUID.randomUUID().toString();\n\n                    // When\n                    obj.setId(id);\n\n                    // Then\n                    Assert.assertEquals(id, obj.getId());\n                }\n\n            }\n        \"\"\".stripIndent()\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/CompatibilityIntegrationTest.groovy",
    "content": "package io.franzbecker.gradle.lombok\n\nimport org.gradle.testkit.runner.GradleRunner\nimport spock.lang.Unroll\n\n@Unroll\nclass CompatibilityIntegrationTest extends AbstractIntegrationTest {\n\n    String theGradleVersion\n\n    @Override\n    protected GradleRunner createGradleRunner() {\n        def runner = super.createGradleRunner()\n        return runner.withGradleVersion(theGradleVersion)\n    }\n\n    def \"Gradle #gradleVersion - can compile and test @Data annotation\"() {\n        given:\n        theGradleVersion = gradleVersion\n        createSimpleTestCase(testConfigurationName)\n\n        when: \"calling gradle test\"\n        runBuild('test')\n\n        then: \"build is successful and both class file exist\"\n        noExceptionThrown()\n        new File(projectDir, \"$classesPath/main/com/example/HelloWorld.class\").exists()\n        new File(projectDir, \"$classesPath/test/com/example/HelloWorldTest.class\").exists()\n\n        where:\n        gradleVersion || classesPath          || testConfigurationName\n        '2.12'        || 'build/classes'      || 'testCompile'\n        '2.14.1'      || 'build/classes'      || 'testCompile'\n        '3.5'         || 'build/classes'      || 'testCompile'\n        '4.2.1'       || 'build/classes/java' || 'testCompile'\n        '4.7'         || 'build/classes/java' || 'testCompile'\n        '5.4'         || 'build/classes/java' || 'testCompile'\n        '6.4'         || 'build/classes/java' || 'testCompile'\n        '6.4'         || 'build/classes/java' || 'testImplementation'\n        '7.0'         || 'build/classes/java' || 'testImplementation'\n    }\n\n    def \"Gradle #gradleVersion - can run verifyLombok\"() {\n        given:\n        theGradleVersion = gradleVersion\n        createSimpleTestCase(testConfigurationName)\n\n        when: \"calling gradle verifyLombok\"\n        runBuild('verifyLombok')\n\n        then: \"no exception is thrown\"\n        noExceptionThrown()\n\n        where:\n        gradleVersion || classesPath          || testConfigurationName\n        '2.12'        || 'build/classes'      || 'testCompile'\n        '2.14.1'      || 'build/classes'      || 'testCompile'\n        '3.5'         || 'build/classes'      || 'testCompile'\n        '4.2.1'       || 'build/classes/java' || 'testCompile'\n        '4.7'         || 'build/classes/java' || 'testCompile'\n        '5.4'         || 'build/classes/java' || 'testCompile'\n        '6.4'         || 'build/classes/java' || 'testCompile'\n        '7.0'         || 'build/classes/java' || 'testImplementation'\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/LombokPluginIntegrationTest.groovy",
    "content": "package io.franzbecker.gradle.lombok\n\nimport groovy.util.slurpersupport.GPathResult\n\n/**\n * Integration tests for {@link LombokPlugin}.\n */\nclass LombokPluginIntegrationTest extends AbstractIntegrationTest {\n\n    /**\n     * Creates a Java class with a method annotated with @SneakyThrows and tests if the\n     * annotation is applied properly.\n     */\n    def \"Can compile and test code with @SneakyThrows annotation.\"() {\n        given: \"a valid build configuration\"\n        buildFile << \"\"\"\n            dependencies {\n                testCompile 'junit:junit:4.12'\n            }\n        \"\"\".stripIndent()\n\n        and: \"source code with @SneakyThrows to compile and test\"\n        createSneakyThrowsJavaSource()\n        createSneakyThrowsTestCode()\n\n        when: \"calling gradle test\"\n        runBuild('test')\n\n        then: \"build is successful and both class file exist\"\n        noExceptionThrown()\n        new File(projectDir, \"build/classes/java/main/com/example/SneakyHelloWorld.class\").exists()\n        new File(projectDir, \"build/classes/java/test/com/example/SneakyHelloWorldTest.class\").exists()\n    }\n\n    def \"Can compile test code with Lombok depenceny\"() {\n        given:\n        buildFile << \"\"\"\n            dependencies {\n                testCompile 'junit:junit:4.12'\n            }\n        \"\"\".stripIndent()\n\n        and:\n        createTestCodeWithLombokDependency()\n\n        when:\n        runBuild('test')\n\n        then:\n        noExceptionThrown()\n        new File(projectDir, \"build/classes/java/test/com/example/SneakyHelloWorldTest.class\").exists()\n    }\n\n    def \"Works with the java-library plugin\"() {\n        given:\n        buildFile.text = buildFile.text.replace(\"id 'java'\", \"id 'java-library'\")\n        createSimpleTestCase()\n\n        when:\n        runBuild('test')\n\n        then:\n        noExceptionThrown()\n        new File(projectDir, \"build/classes/java/main/com/example/HelloWorld.class\").exists()\n        new File(projectDir, \"build/classes/java/test/com/example/HelloWorldTest.class\").exists()\n    }\n\n    def \"Dependency does not occur in generated POM using the 'maven' plugin\"() {\n        given: \"a valid build configuration\"\n        buildFile << \"\"\"\n            apply plugin: 'maven'\n\n            dependencies {\n                testCompile 'junit:junit:4.12'\n            }\n        \"\"\".stripIndent()\n\n        when: \"calling gradle install\"\n        runBuild('install')\n\n        then: \"Parse POM and retrieve <dependencies> object\"\n        def parsedXml = findAndParsePom(\"build/poms/pom-default.xml\")\n        def dependencies = parsedXml.dependencies\n        assert dependencies.size() == 1\n        assert dependencies.dependency.find { it.artifactId.text() == 'junit' }\n        assert !dependencies.dependency.find { it.artifactId.text() == 'lombok' }\n    }\n\n    def \"Dependency does not occur in generated POM using the 'maven-publish' plugin\"() {\n        given:\n        buildFile << '''\n            apply plugin: 'maven-publish'\n            \n            dependencies {\n                compile 'javax.inject:javax.inject:1'\n            }\n            \n            publishing {\n                publications {\n                    mavenJava(MavenPublication) {\n                        from components.java\n                    }\n                }   \n            }\n            \n            model {\n                tasks.generatePomFileForMavenJavaPublication {\n                    destination = file(\"$buildDir/generated-pom.xml\")\n                }\n            }\n        '''.stripIndent()\n\n        when:\n        runBuild('generatePomFileForMavenJavaPublication')\n\n        then:\n        def parsedXml = findAndParsePom(\"build/generated-pom.xml\")\n        def dependencies = parsedXml.dependencies\n        assert dependencies.size() == 1\n        assert dependencies.dependency.find { it.artifactId.text() == 'javax.inject' }\n        assert !dependencies.dependency.find { it.artifactId.text() == 'lombok' }\n    }\n\n    private GPathResult findAndParsePom(String path) {\n        def pom = new File(projectDir, path)\n        assert pom.exists()\n        return new XmlSlurper().parseText(pom.text)\n    }\n\n    /**\n     * Verifies that the Lombok dependency is on the Eclipse classpath.\n     */\n    def \"Lombok dependency is on Eclipse classpath\"() {\n        given:\n        buildFile << \"\"\"\n            apply plugin: 'eclipse'\n        \"\"\".stripIndent()\n\n        when:\n        runBuild('eclipse')\n\n        then: \"verify that the .classpath file exists\"\n        def dotClasspath = new File(projectDir, \".classpath\")\n        dotClasspath.exists()\n\n        and: \"verify the lombok JAR is included\"\n        def classpath = new XmlSlurper().parse(dotClasspath)\n        def lombokEntry = classpath.classpathentry.find { node ->\n            node.@kind == \"lib\" && node.@path.text().contains(\"lombok-${LombokPluginExtension.DEFAULT_VERSION}.jar\")\n        }\n        assert lombokEntry\n    }\n\n    /**\n     * Verifies that the Lombok dependency is on the IntelliJ classpath.\n     */\n    def \"Lombok dependency is on IntelliJ classpath\"() {\n        given:\n        buildFile << \"\"\"\n            apply plugin: 'idea'\n        \"\"\".stripIndent()\n\n        when:\n        runBuild('idea')\n\n        then: \"verify that the .iml file exists\"\n        File imlFile = getImlFile()\n\n        and: \"verify the lombok JAR is included\"\n        def module = new XmlSlurper().parse(imlFile)\n        def provided = module.component.orderEntry.find { it.@type == \"module-library\" }\n        assert provided\n        def lombokEntry = provided.library.CLASSES.root.find {\n            it.@url.text().contains(\"lombok-${LombokPluginExtension.DEFAULT_VERSION}.jar\")\n        }\n        assert lombokEntry\n    }\n\n    private File getImlFile() {\n        FilenameFilter filter = { dir, name -> name.endsWith(\".iml\") }\n        File[] imlFiles = projectDir.listFiles(filter)\n        assert imlFiles.size() == 1\n        return imlFiles[0]\n    }\n\n    private void createSneakyThrowsJavaSource() {\n        def file = createFile(\"src/main/java/com/example/SneakyHelloWorld.java\")\n        file << \"\"\"\n            package com.example;\n\n            import lombok.SneakyThrows;\n            import java.io.UnsupportedEncodingException; // checked exception\n\n            public class SneakyHelloWorld {\n\n                @SneakyThrows(UnsupportedEncodingException.class)\n                public byte[] throwingStuff() {\n                    return \"test\".getBytes(\"unsupported\");\n                }\n\n            }\n        \"\"\".stripIndent()\n    }\n\n    private void createSneakyThrowsTestCode() {\n        def file = createFile(\"src/test/java/com/example/SneakyHelloWorldTest.java\")\n        file << \"\"\"\n            package com.example;\n\n            import org.junit.Assert;\n            import org.junit.Test;\n            import java.io.UnsupportedEncodingException;\n\n            public class SneakyHelloWorldTest {\n\n                @Test(expected = UnsupportedEncodingException.class)\n                public void testThrowingStuff() {\n                    SneakyHelloWorld instance = new SneakyHelloWorld();\n                    instance.throwingStuff();\n                }\n\n            }\n\n        \"\"\".stripIndent()\n    }\n\n    private void createTestCodeWithLombokDependency() {\n        def file = createFile(\"src/test/java/com/example/SneakyHelloWorldTest.java\")\n        file << '''\n            package com.example;\n\n            import org.junit.Assert;\n            import org.junit.Test;\n            import lombok.SneakyThrows;\n            import java.io.UnsupportedEncodingException;\n\n            public class SneakyHelloWorldTest {\n\n                @Test(expected = UnsupportedEncodingException.class)\n                @SneakyThrows\n                public void testThrowingStuff() {\n                    \"test\".getBytes(\"unsupported\");\n                }\n\n            }\n        '''.stripIndent()\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/LombokPluginSpec.groovy",
    "content": "package io.franzbecker.gradle.lombok\n\nimport io.franzbecker.gradle.lombok.task.InstallLombokTask\nimport io.franzbecker.gradle.lombok.task.VerifyLombokTask\nimport nebula.test.PluginProjectSpec\n\n/**\n * Unit tests for {@link LombokPlugin}.\n */\nclass LombokPluginSpec extends PluginProjectSpec {\n\n    @Override\n    String getPluginName() {\n        return LombokPlugin.NAME\n    }\n\n    private def applyJavaAndLombok() {\n        project.apply plugin: \"java\"\n        project.apply plugin: pluginName\n    }\n\n    def \"Does not create new tasks if Java plugin is not applied\"() {\n        given:\n        def beforeTaskMap = project.tasks.getAsMap().collect()\n\n        when:\n        project.apply plugin: pluginName\n\n        then:\n        def afterTaskMap = project.tasks.getAsMap().collect()\n        assert afterTaskMap == beforeTaskMap\n    }\n\n    def \"Does not add Lombok configuration if Java plugin is not applied\"() {\n        when:\n        project.apply plugin: pluginName\n\n        then:\n        assert !project.configurations.findByName(LombokPlugin.LOMBOK_CONFIGURATION_NAME)\n    }\n\n    def \"Add Lombok configuration if Java plugin is applied\"() {\n        when:\n        applyJavaAndLombok()\n\n        then:\n        assert project.configurations.findByName(LombokPlugin.LOMBOK_CONFIGURATION_NAME)\n    }\n\n    def \"Lombok dependency is added\"() {\n        when:\n        applyJavaAndLombok()\n        project.evaluate()\n\n        then:\n        def lombokConfiguration = project.configurations.findByName(LombokPlugin.LOMBOK_CONFIGURATION_NAME)\n        def dependency = lombokConfiguration.getDependencies().first()\n        dependency.group == \"org.projectlombok\"\n        dependency.name == \"lombok\"\n    }\n\n    def \"Added dependencies are not transitive\"() {\n        when:\n        applyJavaAndLombok()\n        project.evaluate()\n\n        then:\n        def lombokConfiguration = project.configurations.findByName(LombokPlugin.LOMBOK_CONFIGURATION_NAME)\n        lombokConfiguration.getDependencies().each {\n            assert !it.isTransitive()\n        }\n    }\n\n    def \"Add tasks if Java plugin is applied and installLombok depends on verifyLombok\"() {\n        when:\n        applyJavaAndLombok()\n\n        then:\n        VerifyLombokTask verifyLombok = project.tasks[VerifyLombokTask.NAME]\n        InstallLombokTask installLombok = project.tasks[InstallLombokTask.NAME]\n        verifyLombok in installLombok.getDependsOn()\n        installLombok.group == \"IDE\"\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/task/AbstractJavaExecTaskSpec.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\n\nimport io.franzbecker.gradle.lombok.LombokPlugin\nimport org.gradle.api.Project\nimport org.gradle.api.artifacts.Configuration\nimport org.gradle.api.tasks.JavaExec\nimport org.gradle.process.internal.JavaExecAction\nimport org.gradle.testfixtures.ProjectBuilder\nimport spock.lang.Specification\n\n/**\n * Base class for unit testing tasks of type JavaExec.\n */\nabstract class AbstractJavaExecTaskSpec extends Specification {\n\n    Project project\n\n    void setup() {\n        project = ProjectBuilder.builder().build()\n        project.apply plugin: 'java'\n        project.apply plugin: LombokPlugin.NAME\n    }\n\n    /**\n     * Sets the private field \"javaExecHandleBuilder\" of the passed task\n     * to a mock and returns that mock.\n     *\n     * @param task the task\n     * @return the mock\n     */\n    JavaExecAction mockJavaExecAction(JavaExec task) {\n        JavaExecAction execAction = Mock()\n        def field = JavaExec.getDeclaredField(\"javaExecHandleBuilder\")\n        field.accessible = true\n        field.set(task, execAction)\n        return execAction\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/task/DelombokTaskIntegrationTest.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\n\nimport io.franzbecker.gradle.lombok.AbstractIntegrationTest\n\n/**\n * Integration tests for {@link DelombokTask}.\n */\nclass DelombokTaskIntegrationTest extends AbstractIntegrationTest {\n\n    def \"Calling delombok with --help throws no exception.\"() {\n        given:\n        buildFile << \"\"\"\n            import io.franzbecker.gradle.lombok.task.DelombokTask\n\n            task delombokHelp(type: DelombokTask) {\n                args \"--help\"\n            }\n        \"\"\".stripIndent()\n\n        when:\n        runBuild(\"delombokHelp\")\n\n        then:\n        noExceptionThrown()\n    }\n\n    def \"Delombok on directory produced proper output\"() {\n        given:\n        createSourceForDelombok()\n\n        and:\n        buildFile << \"\"\"\n            dependencies {\n                implementation 'org.slf4j:slf4j-api:1.7.12'\n            }\n\n            ${delombokTask()}\n        \"\"\".stripIndent()\n\n        when:\n        runBuild(\"delombok\")\n\n        then:\n        File file = new File(projectDir, \"build/delombok/com/example/HelloWorld.java\")\n        file.exists()\n        String contents = file.text\n        !contents.contains(\"import lombok.Data\")\n        contents.contains(\"// Generated by delombok\")\n        contents.contains(\"public String getId() {\")\n    }\n\n    def \"Delombok classpath can be extended\"() {\n        given:\n        def testFile = createFile(\"src/main/java/com/example/Example.java\")\n        testFile << \"\"\"\n            package com.example;\n\n            import com.google.common.annotations.VisibleForTesting;\n\n            public class Example {\n            \n                @VisibleForTesting\n                protected void doSomething() {\n                }\n                \n            }\n        \"\"\".stripIndent()\n\n        and:\n        buildFile << \"\"\"\n            dependencies {\n// TODO this doesn't make sense any more\n                compileOnly \"com.google.guava:guava:20.0\" // 20.0 for Java 7 support\n            }\n\n            ${delombokTask(\"classpath += project.configurations.compileOnly\")}\n        \"\"\"\n\n        when:\n        runBuild(\"delombok\")\n\n        then:\n        File file = new File(projectDir, \"build/delombok/com/example/Example.java\")\n        file.exists()\n    }\n\n    private void createSourceForDelombok() {\n        def file = createFile(\"src/main/java/com/example/HelloWorld.java\")\n        file << \"\"\"\n            package com.example;\n\n            import lombok.Data;\n            import org.slf4j.Logger;\n            import org.slf4j.LoggerFactory;\n\n            @Data\n            public class HelloWorld {\n\n                private static final Logger logger = LoggerFactory.getLogger(HelloWorld.class);\n\n                private String id;\n\n            }\n        \"\"\".stripIndent()\n    }\n\n    private String delombokTask(String additionalConfig = \"\") {\n        return \"\"\"\n            import io.franzbecker.gradle.lombok.task.DelombokTask\n\n            task delombok(type: DelombokTask, dependsOn: compileJava) {\n                ext.outputDir = file(\"\\$buildDir/delombok\")\n                            \n                outputs.dir(outputDir)\n                sourceSets.main.java.srcDirs.each { \n                    inputs.dir(it)\n                    args(it, \"-d\", outputDir)\n                }\n\n                $additionalConfig\n\n                // Redirect the output of the process\n                standardOutput = new ByteArrayOutputStream()\n                errorOutput = new ByteArrayOutputStream()\n                doLast {\n                    // Fail the build if there was any error output\n                    if (!errorOutput.toString().isEmpty()) {\n                        throw new GradleException(errorOutput.toString())\n                    }\n                }\n            }\n        \"\"\"\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/task/DelombokTaskSpec.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\n\nimport org.gradle.api.plugins.JavaPlugin\n\n/**\n * Unit tests for {@link DelombokTask}.\n */\nclass DelombokTaskSpec extends AbstractJavaExecTaskSpec {\n\n    def \"delombok calls JavaExec\"() {\n        given: \"a newly created DelombokTask\"\n        def task = project.task(type: DelombokTask, \"delombok\")\n        def execAction = mockJavaExecAction(task)\n        def expectedClasspath = project.configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME)\n\n        when: \"task executes\"\n        task.configure {}\n        task.exec()\n\n        then: \"Delombok main is called\"\n        1 * execAction.setMain('lombok.launch.Main')\n        1 * execAction.classpath(expectedClasspath)\n        1 * execAction.execute()\n    }\n\n    def \"delombok argument is set\"() {\n        when:\n        def task = project.task(type: DelombokTask, \"delombok\")\n\n        then:\n        \"delombok\" in task.args\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/task/InstallLombokTaskSpec.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\n\nimport io.franzbecker.gradle.lombok.LombokPlugin\n\n/**\n * Unit tests for {@link InstallLombokTask}.\n */\nclass InstallLombokTaskSpec extends AbstractJavaExecTaskSpec {\n\n    def \"installLombok calls JavaExec properly\"() {\n        given:\n        InstallLombokTask task = project.tasks.getByName(InstallLombokTask.NAME)\n        def execAction = mockJavaExecAction(task)\n        def expectedClasspath = project.configurations.getByName(LombokPlugin.LOMBOK_CONFIGURATION_NAME)\n\n        when:\n        task.configure {}\n        task.exec()\n\n        then:\n        1 * execAction.setMain('lombok.launch.Main')\n        1 * execAction.setIgnoreExitValue(true)\n        1 * execAction.setClasspath(expectedClasspath)\n        1 * execAction.execute()\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/task/VerifyLombokTaskIntegrationTest.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\n\nimport io.franzbecker.gradle.lombok.AbstractIntegrationTest\nimport org.gradle.testkit.runner.TaskOutcome\n\n/**\n * Integration tests for {@link VerifyLombokTask}.\n */\nclass VerifyLombokTaskIntegrationTest extends AbstractIntegrationTest {\n\n    def \"Task succeeds if hash is valid\"() {\n        given: \"a properly configured hash\"\n        buildFile << \"\"\"\n            lombok {\n                version = \"1.16.4\"\n                sha256 = \"3ca225ce3917eac8bf4b7d2186845df4e70dcdede356dca8537b6d78a535c91e\"\n            }\n        \"\"\".stripIndent()\n\n        when: \"invoking the task\"\n        runBuild(VerifyLombokTask.NAME)\n\n        then: \"task succeeded without exception\"\n        noExceptionThrown()\n    }\n\n    def \"Task succeeds with the default configuration\"() {\n        when: \"invoking the task\"\n        runBuild(VerifyLombokTask.NAME)\n\n        then: \"task succeeded without exception\"\n        noExceptionThrown()\n    }\n\n    def \"Task succeeds with non-default Lombok version\"() {\n        given: \"a properly configured hash\"\n        buildFile << \"\"\"\n            lombok {\n                version = \"1.16.6\"\n                sha256 = \"e0a471be03e1e6b02bf019480cec7a3ac9801702bf7bf62f15d077ad4df8dd5d\"\n            }\n        \"\"\".stripIndent()\n\n        when: \"invoking the task\"\n        runBuild(VerifyLombokTask.NAME)\n\n        then: \"task succeeded without exception\"\n        noExceptionThrown()\n    }\n\n    def \"Task fails if hash is invalid\"() {\n        given: \"a badly configured hash\"\n        buildFile << \"\"\"\n            lombok {\n                version = \"1.16.4\"\n                sha256 = \"wrongHash\"\n            }\n        \"\"\".stripIndent()\n\n        when: \"invoking the task\"\n        def result = runTaskAndFail(VerifyLombokTask.NAME)\n\n        then: \"expect a failure\"\n        result.output.contains(\"Expected checksum: wrongHash\")\n    }\n\n    def \"Task succeeds if hash is null\"() {\n        given: \"an unset hash\"\n        buildFile << \"\"\"\n            lombok {\n                version = \"1.16.4\"\n                sha256 = null\n            }\n        \"\"\".stripIndent()\n\n        when: \"invoking the task\"\n        runBuild(VerifyLombokTask.NAME)\n\n        then: \"task succeeded without exception\"\n        noExceptionThrown()\n    }\n\n    def \"Task succeeds if hash is empty\"() {\n        given: \"an unset hash\"\n        buildFile << \"\"\"\n            lombok {\n                version = \"1.16.4\"\n                sha256 = \"\"\n            }\n        \"\"\".stripIndent()\n\n        when: \"invoking the task\"\n        runBuild(VerifyLombokTask.NAME)\n\n        then: \"task succeeded without exception\"\n        noExceptionThrown()\n    }\n\n    def \"Task is up-to-date when hash is empty\"() {\n        given: \"an unset hash\"\n        buildFile << \"\"\"\n            lombok {\n                version = \"1.16.4\"\n                sha256 = \"\"\n            }\n        \"\"\".stripIndent()\n\n        when: \"invoking the task two times\"\n        // there is no build history on the first run, so it is never up-to-date\n        runBuild(VerifyLombokTask.NAME)\n        def result = runBuild(VerifyLombokTask.NAME)\n\n        then: \"second run was up-to-date\"\n        result.tasks(TaskOutcome.UP_TO_DATE).first().path == \":$VerifyLombokTask.NAME\"\n    }\n\n    def \"Task is never up-to-date when hash is set\"() {\n        given: \"a properly configured hash\"\n        buildFile << \"\"\"\n            lombok {\n                version = \"1.16.4\"\n                sha256 = \"3ca225ce3917eac8bf4b7d2186845df4e70dcdede356dca8537b6d78a535c91e\"\n            }\n        \"\"\".stripIndent()\n\n        when: \"invoking the task multiple times\"\n        def result1 = runBuild(VerifyLombokTask.NAME)\n        def result2 = runBuild(VerifyLombokTask.NAME)\n\n        then: \"both runs were not up-to-date\"\n        result1.tasks(TaskOutcome.UP_TO_DATE).empty\n        result2.tasks(TaskOutcome.UP_TO_DATE).empty\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/task/VerifyLombokTaskSpec.groovy",
    "content": "package io.franzbecker.gradle.lombok.task\n\nimport io.franzbecker.gradle.lombok.LombokPlugin\nimport io.franzbecker.gradle.lombok.LombokPluginExtension\nimport io.franzbecker.gradle.lombok.util.HashUtilSpec\nimport org.gradle.api.GradleException\nimport org.gradle.api.Project\nimport org.gradle.api.artifacts.Configuration\nimport org.gradle.testfixtures.ProjectBuilder\nimport spock.lang.Specification\n\n/**\n * Unit tests for {@link VerifyLombokTask}.\n */\nclass VerifyLombokTaskSpec extends Specification {\n\n    VerifyLombokTask task\n    Configuration configuration = Mock()\n\n    /**\n     * Perform a minimal project setup that lets us retrieve the task.\n     */\n    void setup() {\n        Project project = ProjectBuilder.builder().build()\n        project.apply plugin: 'java'\n        project.apply plugin: LombokPlugin.NAME\n        task = project.tasks.getByName(VerifyLombokTask.NAME)\n        configuration.iterator() >> Mock(Iterator)\n        configuration.getName() >> LombokPlugin.VERIFY_LOMBOK_CLASSPATH_CONFIGURATION_NAME\n    }\n\n    def \"Fails if Lombok JAR is not found\"() {\n        given:\n        def version = \"1.16.4\"\n\n        when:\n        task.getLombokJar(version, configuration)\n\n        then:\n        GradleException e = thrown()\n        e.message == \"Could not find 'lombok-${version}.jar' in dependencies of configuration 'compileClasspath'.\"\n    }\n\n    def \"Does not fail if file integrity is fulfilled\"() {\n        given:\n        def file = new File(getClass().getClassLoader().getResource(\"dummy.txt\").path)\n        assert file.exists()\n\n        when:\n        task.verifyIntegrity(HashUtilSpec.DUMMY_TXT_HASH, file)\n\n        then:\n        noExceptionThrown()\n    }\n\n    def \"Fails if file integrity is not fulfilled\"() {\n        given:\n        def file = new File(getClass().getClassLoader().getResource(\"dummy.txt\").path)\n        assert file.exists()\n\n        when:\n        task.verifyIntegrity(\"wrongHash\", file)\n\n        then:\n        GradleException e = thrown()\n        e.message.contains(\"Expected checksum: wrongHash\")\n        e.message.contains(\"Actual checksum: ${HashUtilSpec.DUMMY_TXT_HASH}\")\n    }\n\n    def \"Skips the check if no hash has been configured\"() {\n        given:\n        def extension = new LombokPluginExtension()\n        extension.sha256 = ''\n\n        when:\n        task.verifyLombok(extension, configuration)\n\n        then:\n        noExceptionThrown()\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/groovy/io/franzbecker/gradle/lombok/util/HashUtilSpec.groovy",
    "content": "package io.franzbecker.gradle.lombok.util\n\nimport spock.lang.Specification\n/**\n * Simple test for {@link HashUtil}.\n */\nclass HashUtilSpec extends Specification {\n\n    static final DUMMY_TXT_HASH = \"c626d18d337f2937a83bf82581e8b22796f345736f94a2ed60b0294b4705c203\"\n\n    HashUtil hashUtil = new HashUtil()\n\n    def \"Calculates dummy.txt hash correctly\"() {\n        given:\n        def file = new File(getClass().getClassLoader().getResource(\"dummy.txt\").path)\n        assert file.exists()\n\n        when:\n        def hash = hashUtil.calculateSha256(file)\n\n        then:\n        hash == DUMMY_TXT_HASH\n    }\n\n    def \"Throws RuntimeException if file is not found\"() {\n        given:\n        def file = new File(\"unknown\")\n        assert !file.exists()\n\n        when:\n        hashUtil.calculateSha256(file)\n\n        then:\n        thrown(RuntimeException)\n    }\n\n}\n"
  },
  {
    "path": "gradle-lombok-plugin/src/test/resources/dummy.txt",
    "content": "This is a file with a known SHA-256 hash."
  },
  {
    "path": "gradle-lombok-plugin/update-lombok.sh",
    "content": "#!/bin/bash\n\nwget https://projectlombok.org/downloads/lombok.jar\n\nversion=$( java -jar lombok.jar --version | sed -n 's/v\\([0-9\\.]*\\).*/\\1/p' )\nhash=$( shasum -a 256 lombok.jar | cut -d ' ' -f 1 )\necho \"Updating to Lombok $version with hash: $hash\"\n\nsed -i '' -e \"s/\\(DEFAULT_VERSION = \\\"\\)[0-9\\.]*/\\1$version/g\" src/main/groovy/io/franzbecker/gradle/lombok/LombokPluginExtension.groovy\nsed -i '' -e \"s/\\(DEFAULT_VERSION_HASH = \\\"\\)[^\\\"]*/\\1$hash/g\" src/main/groovy/io/franzbecker/gradle/lombok/LombokPluginExtension.groovy\nsed -i '' -e \"s/\\(version = \\\"\\)[0-9\\.]*/\\1$version/g\" ../README.md\nsed -i '' -e \"s/\\(sha256 = \\\"\\)[^\\\"][^\\\"]*/\\1$hash/g\" ../README.md\n\ngit add src/main/groovy/io/franzbecker/gradle/lombok/LombokPluginExtension.groovy\ngit add ../README.md\n\ngit commit -m \"Update the default Lombok version to $version\"\nrm lombok.jar\n"
  }
]