[GitHub] [lucene-solr] dweiss commented on a change in pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

2020-09-03 Thread GitBox


dweiss commented on a change in pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#discussion_r483402573



##
File path: build.gradle
##
@@ -127,6 +128,9 @@ apply from: file('gradle/ide/intellij-idea.gradle')
 apply from: file('gradle/ide/eclipse.gradle')
 
 // Validation tasks
+apply from: file('gradle/hacks/findbugs.gradle')

Review comment:
   I think the problem may be in clashing JARs - errorprone annotations are 
imported in a different place of the build (Erick worked on this), without any 
static analysis. I can take a look but later.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

2020-09-03 Thread GitBox


dweiss commented on a change in pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#discussion_r483402784



##
File path: gradle/validation/error-prone.gradle
##
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+allprojects { prj ->
+plugins.withId("java", {
+prj.apply plugin: 'net.ltgt.errorprone'
+plugins.withType(JavaPlugin) {

Review comment:
   you only need one - plugins.withId or plugins.withType. It's the same 
thing here.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1816: LUCENE-9497: Integerate Error Prone ( Static Analysis Tool ) during compilation

2020-09-03 Thread GitBox


dweiss commented on a change in pull request #1816:
URL: https://github.com/apache/lucene-solr/pull/1816#discussion_r482745406



##
File path: gradle/validation/error-prone.gradle
##
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure([project(":lucene:core")]) {
+apply plugin: 'net.ltgt.errorprone'
+
+plugins.withType(JavaPlugin) {
+dependencies {
+errorprone("com.google.errorprone:error_prone_core:2.4.0")
+}
+
+tasks.withType(JavaCompile) {
+options.errorprone.errorproneArgs = ['-Xep:InvalidBlockTag:OFF', 
'-Xep:MissingSummary:OFF', '-Xep:UnusedVariable:OFF']

Review comment:
   The gradle plugin has a nice DSL for setting options, see here?
   
https://github.com/tbroyer/gradle-errorprone-plugin#migration-from-versions-00x





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org