{"action":"created","issue":{"url":"https://api.github.com/repos/palantir/gradle-processors/issues/97","repository_url":"https://api.github.com/repos/palantir/gradle-processors","labels_url":"https://api.github.com/repos/palantir/gradle-processors/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/palantir/gradle-processors/issues/97/comments","events_url":"https://api.github.com/repos/palantir/gradle-processors/issues/97/events","html_url":"https://github.com/palantir/gradle-processors/pull/97","id":379552602,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5OTcxMjQ4","number":97,"title":"[improvement] Configure annotation processor classpath explicitly in IDEA","user":{"login":"dansanduleac","id":222827,"node_id":"MDQ6VXNlcjIyMjgyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/222827?v=4","gravatar_id":"","url":"https://api.github.com/users/dansanduleac","html_url":"https://github.com/dansanduleac","followers_url":"https://api.github.com/users/dansanduleac/followers","following_url":"https://api.github.com/users/dansanduleac/following{/other_user}","gists_url":"https://api.github.com/users/dansanduleac/gists{/gist_id}","starred_url":"https://api.github.com/users/dansanduleac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dansanduleac/subscriptions","organizations_url":"https://api.github.com/users/dansanduleac/orgs","repos_url":"https://api.github.com/users/dansanduleac/repos","events_url":"https://api.github.com/users/dansanduleac/events{/privacy}","received_events_url":"https://api.github.com/users/dansanduleac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-11T19:06:52Z","updated_at":"2018-11-12T12:44:00Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/palantir/gradle-processors/pulls/97","html_url":"https://github.com/palantir/gradle-processors/pull/97","diff_url":"https://github.com/palantir/gradle-processors/pull/97.diff","patch_url":"https://github.com/palantir/gradle-processors/pull/97.patch"},"body":"## Before this PR\r\n\r\nCurrently, we configure a global \"profile\" for annotation processors in IDEA.\r\nThis profile instructs IDEA to pick up annotation processors from the classpath. At the same time, we manually add all dependencies from the `processor` configuration to the PROVIDED scope in IDEA.\r\n\r\nThis becomes problematic when an annotation processor brings in a different version of a library that already exists on your classpath. Now you get duplicates and behaviour is unexpected as it's not obvious which one will be used during compilation.\r\n\r\nAdditionally, this leaks all annotation processor dependencies (which are supposed to be implementation details as far as the rest of the program is concerned) onto your PROVIDED scope, so you could accidentally use a class that's not actually in your runtime configuration.\r\n\r\n## After this PR\r\n\r\nThe IDEA project is configured with one profile per gradle project, which is assigned to the corresponding IDEA module, and each project's complete set of annotation processors (configuration `allProcessors`) are enumerated in this profile.\r\n\r\nFurthermore, we don't make IDEA's PROVIDED scope extend `allProcessors` anymore.\r\nThis means that processors added to gradle 4.6+'s `annotationProcessor` configuration (and equivalents for source sets other than `main`) don't leak onto your PROVIDED scope anymore.\r\n\r\nHowever, we still add dependencies from the original `processor` configuration to PROVIDED in an effort to keep backwards compatibility.\r\n\r\nExample diff for gradle-sls-packaging:\r\n\r\n```diff\r\n-   <profile default=\"true\" name=\"Default\" enabled=\"true\">\r\n+   <profile name=\":gradle-sls-packaging\" enabled=\"true\">\r\n        <sourceOutputDir name=\"generated_src\"/>\r\n        <sourceTestOutputDir name=\"generated_testSrc\"/>\r\n        <outputRelativeToContentRoot value=\"true\"/>\r\n-       <processorPath useClasspath=\"true\"/>\r\n+       <processorPath useClasspath=\"false\">\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/org.immutables/value/2.7.1/7879e75c53074fd8cbbe014bfa5e8689f8c565ae/value-2.7.1.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.palantir.baseline/baseline-error-prone/0.37.4/5b2e810d8335af8a105bda5ebf546ae0684dbefa/baseline-error-prone-0.37.4.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_core/2.3.2/d5d121a23bcd48df2fe42dc3f1424cd05872993/error_prone_core-2.3.2.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_check_api/2.3.2/7415438c00adec8ba707689ec4168c8484d8403b/error_prone_check_api-2.3.2.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotation/2.3.2/7c554c59dd2ea8c4e9e36b3308f8bf92db83e70c/error_prone_annotation-2.3.2.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_type_annotations/2.3.2/e79e88b9051888c8ea806f49c86fa7e3e3728180/error_prone_type_annotations-2.3.2.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.github.stephenc.jcip/jcip-annotations/1.0-1/ef31541dd28ae2cefdd17c7ebf352d93e9058c63/jcip-annotations-1.0-1.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/org.pcollections/pcollections/2.1.2/15925fd6c32a29fe3f40a048d238c5ca58cb8362/pcollections-2.1.2.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.auto/auto-common/0.10/c8f153ebe04a17183480ab4016098055fb474364/auto-common-0.10.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/23.6.1-jre/c18ab06b4b7646be581211ad59be1b6e1ea4c278/guava-23.6.1-jre.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jFormatString/3.0.0/d3995f9be450813bc2ccee8f0774c1a3033a0f30/jFormatString-3.0.0.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/org.checkerframework/dataflow/2.5.3/edf284e0838290d661b22483ecf648065e7ec440/dataflow-2.5.3.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.3.2/d1a0c5032570e0f64be6b4d9c90cdeb103129029/error_prone_annotations-2.3.2.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protobuf-java/3.4.0/b32aba0cbe737a4ca953f71688725972e3ee927c/protobuf-java-3.4.0.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.googlecode.java-diff-utils/diffutils/1.3.0/7e060dd5b19431e6d198e91ff670644372f60fbd/diffutils-1.3.0.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.github.kevinstern/software-and-algorithms/1.0/5e77666b72c6c5dd583c36148d17fc47f944dfb5/software-and-algorithms-1.0.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-compat-qual/2.0.0/fc89b03860d11d6213d0154a62bcd1c2f69b9efa/checker-compat-qual-2.0.0.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/com.google.j2objc/j2objc-annotations/1.1/ed28ded51a8b1c6b112568def5f4b455e6809019/j2objc-annotations-1.1.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/org.codehaus.mojo/animal-sniffer-annotations/1.14/775b7e22fb10026eed3f86e8dc556dfafe35f2d5/animal-sniffer-annotations-1.14.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/org.checkerframework/javacutil/2.5.3/c545ca6fc7a57e3bc65d46e8e9438376f0db35ea/javacutil-2.5.3.jar\"/>\r\n+           <entry name=\"/Users/dsanduleac/.gradle/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.5.3/4fe154d21bd734fe8c94ada37cdc41a9a6d61776/checker-qual-2.5.3.jar\"/>\r\n+       </processorPath>\r\n+       <module name=\"gradle-sls-packaging\"/>\r\n    </profile>\r\n```"},"comment":{"url":"https://api.github.com/repos/palantir/gradle-processors/issues/comments/437866054","html_url":"https://github.com/palantir/gradle-processors/pull/97#issuecomment-437866054","issue_url":"https://api.github.com/repos/palantir/gradle-processors/issues/97","id":437866054,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzg2NjA1NA==","user":{"login":"iamdanfox","id":3473798,"node_id":"MDQ6VXNlcjM0NzM3OTg=","avatar_url":"https://avatars1.githubusercontent.com/u/3473798?v=4","gravatar_id":"","url":"https://api.github.com/users/iamdanfox","html_url":"https://github.com/iamdanfox","followers_url":"https://api.github.com/users/iamdanfox/followers","following_url":"https://api.github.com/users/iamdanfox/following{/other_user}","gists_url":"https://api.github.com/users/iamdanfox/gists{/gist_id}","starred_url":"https://api.github.com/users/iamdanfox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamdanfox/subscriptions","organizations_url":"https://api.github.com/users/iamdanfox/orgs","repos_url":"https://api.github.com/users/iamdanfox/repos","events_url":"https://api.github.com/users/iamdanfox/events{/privacy}","received_events_url":"https://api.github.com/users/iamdanfox/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T12:44:00Z","updated_at":"2018-11-12T12:44:00Z","author_association":"CONTRIBUTOR","body":"If we can make sure that baseline-error-prone doesn't end up in the provided scope then I'd be super in favour of this!"}}
{"actor":{"display_login":"iamdanfox"}}