{"action":"created","comment":{"url":"https://api.github.com/repos/gradle/gradle/pulls/comments/137667353","pull_request_review_id":61366273,"id":137667353,"diff_hunk":"@@ -0,0 +1,60 @@\n+/*\n+ * Copyright 2017 the original author or authors.\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+package org.gradle.api.plugins.quality\n+\n+import org.gradle.integtests.fixtures.AbstractIntegrationSpec\n+import org.gradle.util.TestPrecondition\n+\n+class PmdPluginIncrementalAnalysisIntegrationTest extends AbstractIntegrationSpec {\n+    def setup() {\n+        buildFile << \"\"\"\n+            apply plugin: \"java\"\n+            apply plugin: \"pmd\"\n+\n+            ${mavenCentralRepository()}\n+\n+            ${!TestPrecondition.FIX_TO_WORK_ON_JAVA9.fulfilled ? \"sourceCompatibility = 1.6\" : \"\"}\n+        \"\"\".stripIndent()\n+    }\n+\n+    def \"incremental analysis cache file is not generated by default\"() {\n+        goodCode()\n+\n+        expect:\n+        succeeds(\"check\")\n+        !file(\"build/pmd-cache\").exists()\n+    }\n+\n+    def \"incremental analysis can be enabled\"() {\n+        goodCode()\n+        buildFile << '''\n+        pmd {\n+            incrementalAnalysis = true\n+        }\n+'''\n+\n+        expect:\n+        succeeds(\"check\")\n+        file(\"build/pmd-cache/pmdMain.cache\").exists()\n+    }\n+","path":"subprojects/code-quality/src/integTest/groovy/org/gradle/api/plugins/quality/PmdPluginIncrementalAnalysisIntegrationTest.groovy","position":53,"original_position":53,"commit_id":"d62fc0d82088cf51ad334e06e08505e59d2f4cd7","original_commit_id":"d62fc0d82088cf51ad334e06e08505e59d2f4cd7","user":{"login":"jsotuyod","id":802626,"avatar_url":"https://avatars3.githubusercontent.com/u/802626?v=4","gravatar_id":"","url":"https://api.github.com/users/jsotuyod","html_url":"https://github.com/jsotuyod","followers_url":"https://api.github.com/users/jsotuyod/followers","following_url":"https://api.github.com/users/jsotuyod/following{/other_user}","gists_url":"https://api.github.com/users/jsotuyod/gists{/gist_id}","starred_url":"https://api.github.com/users/jsotuyod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsotuyod/subscriptions","organizations_url":"https://api.github.com/users/jsotuyod/orgs","repos_url":"https://api.github.com/users/jsotuyod/repos","events_url":"https://api.github.com/users/jsotuyod/events{/privacy}","received_events_url":"https://api.github.com/users/jsotuyod/received_events","type":"User","site_admin":false},"body":"> Is there a way to tell if PMD actually did incremental analysis (logging statements, particular output files, etc)?\r\n\r\nYes there is. If enabled, PMD will use incremental analysis unless it finds any reason to invalidate the cache. When it does, it logs a message in the format `\"Analysis cache invalidated, ${reason}\"`.\r\n\r\nFor instance:\r\n[`\"Analysis cache invalidated, rulesets changed.\"`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java#L83)\r\n[`\"Analysis cache invalidated, classpath changed.\"`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java#L96)\r\n[`\"Analysis cache invalidated, PMD version changed.\"`](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java#L74)\r\n\r\nOther reasons (ie: corrupted file, file permissions, etc.) currently don't follow this convention, but in retrospective it would be interesting to do so.\r\n\r\nhttps://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cache/FileAnalysisCache.java#L77-L79 ","created_at":"2017-09-07T22:07:43Z","updated_at":"2017-09-07T22:07:43Z","html_url":"https://github.com/gradle/gradle/pull/2223#discussion_r137667353","pull_request_url":"https://api.github.com/repos/gradle/gradle/pulls/2223","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gradle/gradle/pulls/comments/137667353"},"html":{"href":"https://github.com/gradle/gradle/pull/2223#discussion_r137667353"},"pull_request":{"href":"https://api.github.com/repos/gradle/gradle/pulls/2223"}},"in_reply_to_id":137661937},"pull_request":{"url":"https://api.github.com/repos/gradle/gradle/pulls/2223","id":123372880,"html_url":"https://github.com/gradle/gradle/pull/2223","diff_url":"https://github.com/gradle/gradle/pull/2223.diff","patch_url":"https://github.com/gradle/gradle/pull/2223.patch","issue_url":"https://api.github.com/repos/gradle/gradle/issues/2223","number":2223,"state":"closed","locked":false,"title":"Support PMD's analysis cache","user":{"login":"jsotuyod","id":802626,"avatar_url":"https://avatars3.githubusercontent.com/u/802626?v=4","gravatar_id":"","url":"https://api.github.com/users/jsotuyod","html_url":"https://github.com/jsotuyod","followers_url":"https://api.github.com/users/jsotuyod/followers","following_url":"https://api.github.com/users/jsotuyod/following{/other_user}","gists_url":"https://api.github.com/users/jsotuyod/gists{/gist_id}","starred_url":"https://api.github.com/users/jsotuyod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsotuyod/subscriptions","organizations_url":"https://api.github.com/users/jsotuyod/orgs","repos_url":"https://api.github.com/users/jsotuyod/repos","events_url":"https://api.github.com/users/jsotuyod/events{/privacy}","received_events_url":"https://api.github.com/users/jsotuyod/received_events","type":"User","site_admin":false},"body":" - Also bump the default version to latest (5.8.1)\r\n\r\n### Context\r\n\r\nEver since PMD 5.6.0, it supports an analysis cache, which allows it to completely skip analysis of files not modified since the last run, while keeping reports complete, with all issues, in all supported formats.\r\n\r\nThe impact of this feature on analysis performance is significant.\r\n\r\nThe analysis cache can be shared among different tools (ie: gradle and IDE plugins), so being able to set it's location is important.\r\n\r\nFor more details, check:\r\n\r\nhttps://pmd.github.io/pmd-5.7.0/overview/changelog-old.html#Incremental_Analysis\r\n\r\n### Contributor Checklist\r\n- [x] [Review Contribution Guidelines](https://github.com/gradle/gradle/blob/master/.github/CONTRIBUTING.md)\r\n- [x] [Sign Gradle CLA](http://gradle.org/contributor-license-agreement/)\r\n- [x] No Design Spec, only 1 public API changed\r\n- [x] Provide integration tests (under `<subproject>/src/integTest`) to verify changes from a user perspective\r\n- [x] Provide unit tests (under `<subproject>/src/test`) to verify logic\r\n- [x] Update User Guide, DSL Reference, and Javadoc for public-facing changes\r\n- [x] Ensure that tests pass locally: `./gradlew quickCheck <impacted-subproject>:check`\r\n\r\n### Gradle Core Team Checklist\r\n- [ ] Verify design and implementation \r\n- [ ] Verify test coverage and CI build status\r\n- [ ] Verify documentation including proper use of `@since` and `@Incubating` annotations for all public APIs\r\n- [ ] Recognize contributor in release notes\r\n","created_at":"2017-05-31T21:27:49Z","updated_at":"2017-09-07T22:07:43Z","closed_at":"2017-09-04T09:45:41Z","merged_at":"2017-09-04T09:45:41Z","merge_commit_sha":"f7a4bf852eec0e02393fc51e3cf2b0a12b9cb3e1","assignee":{"login":"blindpirate","id":12689835,"avatar_url":"https://avatars3.githubusercontent.com/u/12689835?v=4","gravatar_id":"","url":"https://api.github.com/users/blindpirate","html_url":"https://github.com/blindpirate","followers_url":"https://api.github.com/users/blindpirate/followers","following_url":"https://api.github.com/users/blindpirate/following{/other_user}","gists_url":"https://api.github.com/users/blindpirate/gists{/gist_id}","starred_url":"https://api.github.com/users/blindpirate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blindpirate/subscriptions","organizations_url":"https://api.github.com/users/blindpirate/orgs","repos_url":"https://api.github.com/users/blindpirate/repos","events_url":"https://api.github.com/users/blindpirate/events{/privacy}","received_events_url":"https://api.github.com/users/blindpirate/received_events","type":"User","site_admin":false},"assignees":[{"login":"blindpirate","id":12689835,"avatar_url":"https://avatars3.githubusercontent.com/u/12689835?v=4","gravatar_id":"","url":"https://api.github.com/users/blindpirate","html_url":"https://github.com/blindpirate","followers_url":"https://api.github.com/users/blindpirate/followers","following_url":"https://api.github.com/users/blindpirate/following{/other_user}","gists_url":"https://api.github.com/users/blindpirate/gists{/gist_id}","starred_url":"https://api.github.com/users/blindpirate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blindpirate/subscriptions","organizations_url":"https://api.github.com/users/blindpirate/orgs","repos_url":"https://api.github.com/users/blindpirate/repos","events_url":"https://api.github.com/users/blindpirate/events{/privacy}","received_events_url":"https://api.github.com/users/blindpirate/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/gradle/gradle/milestones/38","html_url":"https://github.com/gradle/gradle/milestone/38","labels_url":"https://api.github.com/repos/gradle/gradle/milestones/38/labels","id":2658317,"number":38,"title":"4.3 RC1","description":"","creator":{"login":"eriwen","id":51534,"avatar_url":"https://avatars2.githubusercontent.com/u/51534?v=4","gravatar_id":"","url":"https://api.github.com/users/eriwen","html_url":"https://github.com/eriwen","followers_url":"https://api.github.com/users/eriwen/followers","following_url":"https://api.github.com/users/eriwen/following{/other_user}","gists_url":"https://api.github.com/users/eriwen/gists{/gist_id}","starred_url":"https://api.github.com/users/eriwen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eriwen/subscriptions","organizations_url":"https://api.github.com/users/eriwen/orgs","repos_url":"https://api.github.com/users/eriwen/repos","events_url":"https://api.github.com/users/eriwen/events{/privacy}","received_events_url":"https://api.github.com/users/eriwen/received_events","type":"User","site_admin":false},"open_issues":25,"closed_issues":11,"state":"open","created_at":"2017-07-24T14:19:39Z","updated_at":"2017-09-07T17:31:39Z","due_on":"2017-10-16T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/gradle/gradle/pulls/2223/commits","review_comments_url":"https://api.github.com/repos/gradle/gradle/pulls/2223/comments","review_comment_url":"https://api.github.com/repos/gradle/gradle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/2223/comments","statuses_url":"https://api.github.com/repos/gradle/gradle/statuses/d62fc0d82088cf51ad334e06e08505e59d2f4cd7","head":{"label":"Monits:upgrade-pmd","ref":"upgrade-pmd","sha":"d62fc0d82088cf51ad334e06e08505e59d2f4cd7","user":{"login":"Monits","id":802619,"avatar_url":"https://avatars0.githubusercontent.com/u/802619?v=4","gravatar_id":"","url":"https://api.github.com/users/Monits","html_url":"https://github.com/Monits","followers_url":"https://api.github.com/users/Monits/followers","following_url":"https://api.github.com/users/Monits/following{/other_user}","gists_url":"https://api.github.com/users/Monits/gists{/gist_id}","starred_url":"https://api.github.com/users/Monits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Monits/subscriptions","organizations_url":"https://api.github.com/users/Monits/orgs","repos_url":"https://api.github.com/users/Monits/repos","events_url":"https://api.github.com/users/Monits/events{/privacy}","received_events_url":"https://api.github.com/users/Monits/received_events","type":"Organization","site_admin":false},"repo":{"id":39396144,"name":"gradle","full_name":"Monits/gradle","owner":{"login":"Monits","id":802619,"avatar_url":"https://avatars0.githubusercontent.com/u/802619?v=4","gravatar_id":"","url":"https://api.github.com/users/Monits","html_url":"https://github.com/Monits","followers_url":"https://api.github.com/users/Monits/followers","following_url":"https://api.github.com/users/Monits/following{/other_user}","gists_url":"https://api.github.com/users/Monits/gists{/gist_id}","starred_url":"https://api.github.com/users/Monits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Monits/subscriptions","organizations_url":"https://api.github.com/users/Monits/orgs","repos_url":"https://api.github.com/users/Monits/repos","events_url":"https://api.github.com/users/Monits/events{/privacy}","received_events_url":"https://api.github.com/users/Monits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Monits/gradle","description":"A powerful build system for the JVM","fork":true,"url":"https://api.github.com/repos/Monits/gradle","forks_url":"https://api.github.com/repos/Monits/gradle/forks","keys_url":"https://api.github.com/repos/Monits/gradle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Monits/gradle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Monits/gradle/teams","hooks_url":"https://api.github.com/repos/Monits/gradle/hooks","issue_events_url":"https://api.github.com/repos/Monits/gradle/issues/events{/number}","events_url":"https://api.github.com/repos/Monits/gradle/events","assignees_url":"https://api.github.com/repos/Monits/gradle/assignees{/user}","branches_url":"https://api.github.com/repos/Monits/gradle/branches{/branch}","tags_url":"https://api.github.com/repos/Monits/gradle/tags","blobs_url":"https://api.github.com/repos/Monits/gradle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Monits/gradle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Monits/gradle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Monits/gradle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Monits/gradle/statuses/{sha}","languages_url":"https://api.github.com/repos/Monits/gradle/languages","stargazers_url":"https://api.github.com/repos/Monits/gradle/stargazers","contributors_url":"https://api.github.com/repos/Monits/gradle/contributors","subscribers_url":"https://api.github.com/repos/Monits/gradle/subscribers","subscription_url":"https://api.github.com/repos/Monits/gradle/subscription","commits_url":"https://api.github.com/repos/Monits/gradle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Monits/gradle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Monits/gradle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Monits/gradle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Monits/gradle/contents/{+path}","compare_url":"https://api.github.com/repos/Monits/gradle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Monits/gradle/merges","archive_url":"https://api.github.com/repos/Monits/gradle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Monits/gradle/downloads","issues_url":"https://api.github.com/repos/Monits/gradle/issues{/number}","pulls_url":"https://api.github.com/repos/Monits/gradle/pulls{/number}","milestones_url":"https://api.github.com/repos/Monits/gradle/milestones{/number}","notifications_url":"https://api.github.com/repos/Monits/gradle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Monits/gradle/labels{/name}","releases_url":"https://api.github.com/repos/Monits/gradle/releases{/id}","deployments_url":"https://api.github.com/repos/Monits/gradle/deployments","created_at":"2015-07-20T16:46:52Z","updated_at":"2016-04-28T16:24:08Z","pushed_at":"2017-09-04T13:03:23Z","git_url":"git://github.com/Monits/gradle.git","ssh_url":"git@github.com:Monits/gradle.git","clone_url":"https://github.com/Monits/gradle.git","svn_url":"https://github.com/Monits/gradle","homepage":"www.gradle.org","size":169361,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gradle:master","ref":"master","sha":"9e76a4b93e77b754e864fce52f452ed7041c03b8","user":{"login":"gradle","id":124156,"avatar_url":"https://avatars2.githubusercontent.com/u/124156?v=4","gravatar_id":"","url":"https://api.github.com/users/gradle","html_url":"https://github.com/gradle","followers_url":"https://api.github.com/users/gradle/followers","following_url":"https://api.github.com/users/gradle/following{/other_user}","gists_url":"https://api.github.com/users/gradle/gists{/gist_id}","starred_url":"https://api.github.com/users/gradle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gradle/subscriptions","organizations_url":"https://api.github.com/users/gradle/orgs","repos_url":"https://api.github.com/users/gradle/repos","events_url":"https://api.github.com/users/gradle/events{/privacy}","received_events_url":"https://api.github.com/users/gradle/received_events","type":"Organization","site_admin":false},"repo":{"id":302322,"name":"gradle","full_name":"gradle/gradle","owner":{"login":"gradle","id":124156,"avatar_url":"https://avatars2.githubusercontent.com/u/124156?v=4","gravatar_id":"","url":"https://api.github.com/users/gradle","html_url":"https://github.com/gradle","followers_url":"https://api.github.com/users/gradle/followers","following_url":"https://api.github.com/users/gradle/following{/other_user}","gists_url":"https://api.github.com/users/gradle/gists{/gist_id}","starred_url":"https://api.github.com/users/gradle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gradle/subscriptions","organizations_url":"https://api.github.com/users/gradle/orgs","repos_url":"https://api.github.com/users/gradle/repos","events_url":"https://api.github.com/users/gradle/events{/privacy}","received_events_url":"https://api.github.com/users/gradle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gradle/gradle","description":"Adaptable, fast automation for all","fork":false,"url":"https://api.github.com/repos/gradle/gradle","forks_url":"https://api.github.com/repos/gradle/gradle/forks","keys_url":"https://api.github.com/repos/gradle/gradle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gradle/gradle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gradle/gradle/teams","hooks_url":"https://api.github.com/repos/gradle/gradle/hooks","issue_events_url":"https://api.github.com/repos/gradle/gradle/issues/events{/number}","events_url":"https://api.github.com/repos/gradle/gradle/events","assignees_url":"https://api.github.com/repos/gradle/gradle/assignees{/user}","branches_url":"https://api.github.com/repos/gradle/gradle/branches{/branch}","tags_url":"https://api.github.com/repos/gradle/gradle/tags","blobs_url":"https://api.github.com/repos/gradle/gradle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gradle/gradle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gradle/gradle/git/refs{/sha}","trees_url":"https://api.github.com/repos/gradle/gradle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gradle/gradle/statuses/{sha}","languages_url":"https://api.github.com/repos/gradle/gradle/languages","stargazers_url":"https://api.github.com/repos/gradle/gradle/stargazers","contributors_url":"https://api.github.com/repos/gradle/gradle/contributors","subscribers_url":"https://api.github.com/repos/gradle/gradle/subscribers","subscription_url":"https://api.github.com/repos/gradle/gradle/subscription","commits_url":"https://api.github.com/repos/gradle/gradle/commits{/sha}","git_commits_url":"https://api.github.com/repos/gradle/gradle/git/commits{/sha}","comments_url":"https://api.github.com/repos/gradle/gradle/comments{/number}","issue_comment_url":"https://api.github.com/repos/gradle/gradle/issues/comments{/number}","contents_url":"https://api.github.com/repos/gradle/gradle/contents/{+path}","compare_url":"https://api.github.com/repos/gradle/gradle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gradle/gradle/merges","archive_url":"https://api.github.com/repos/gradle/gradle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gradle/gradle/downloads","issues_url":"https://api.github.com/repos/gradle/gradle/issues{/number}","pulls_url":"https://api.github.com/repos/gradle/gradle/pulls{/number}","milestones_url":"https://api.github.com/repos/gradle/gradle/milestones{/number}","notifications_url":"https://api.github.com/repos/gradle/gradle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gradle/gradle/labels{/name}","releases_url":"https://api.github.com/repos/gradle/gradle/releases{/id}","deployments_url":"https://api.github.com/repos/gradle/gradle/deployments","created_at":"2009-09-09T18:27:19Z","updated_at":"2017-09-07T19:31:24Z","pushed_at":"2017-09-07T21:26:05Z","git_url":"git://github.com/gradle/gradle.git","ssh_url":"git@github.com:gradle/gradle.git","clone_url":"https://github.com/gradle/gradle.git","svn_url":"https://github.com/gradle/gradle","homepage":"https://gradle.org","size":178713,"stargazers_count":5397,"watchers_count":5397,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":1861,"mirror_url":null,"open_issues_count":733,"forks":1861,"open_issues":733,"watchers":5397,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gradle/gradle/pulls/2223"},"html":{"href":"https://github.com/gradle/gradle/pull/2223"},"issue":{"href":"https://api.github.com/repos/gradle/gradle/issues/2223"},"comments":{"href":"https://api.github.com/repos/gradle/gradle/issues/2223/comments"},"review_comments":{"href":"https://api.github.com/repos/gradle/gradle/pulls/2223/comments"},"review_comment":{"href":"https://api.github.com/repos/gradle/gradle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gradle/gradle/pulls/2223/commits"},"statuses":{"href":"https://api.github.com/repos/gradle/gradle/statuses/d62fc0d82088cf51ad334e06e08505e59d2f4cd7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jsotuyod"}}