borinquenkid commented on code in PR #15686:
URL: https://github.com/apache/grails-core/pull/15686#discussion_r3336931134
##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GradleUtils.groovy:
##########
@@ -37,6 +38,12 @@ class GradleUtils {
asfFile.exists() ? currentDirectory :
findAsfRootDir(currentDirectory.dir('../'))
}
+ static Provider<Boolean> booleanProvider(Project project, String name,
boolean defaultValue = false) {
+ project.providers.gradleProperty(name)
+ .map { String it -> it.trim().toBoolean() }
Review Comment:
Done
##########
build-logic/plugins/src/test/groovy/org/apache/grails/buildsrc/GrailsCodeStylePluginSpec.groovy:
##########
@@ -0,0 +1,223 @@
+/*
+ * 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
+ *
+ * https://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.
+ */
+package org.apache.grails.buildsrc
+
+import org.gradle.testkit.runner.GradleRunner
+import spock.lang.Specification
+import spock.lang.TempDir
+import java.nio.file.Path
+
+class GrailsCodeStylePluginSpec extends Specification {
+ @TempDir
+ Path testProjectDir
+
+ File buildFile
+ File groovyFile
+
+ def setup() {
+ buildFile = testProjectDir.resolve('build.gradle').toFile()
+ buildFile << """
+ plugins {
+ id 'groovy'
+ id 'org.apache.grails.gradle.grails-code-style'
+ }
+
+ // Minimal configuration for the plugin
+ repositories {
+ mavenCentral()
+ }
+ """
+
+ testProjectDir.resolve('src/main/groovy').toFile().mkdirs()
+ groovyFile =
testProjectDir.resolve('src/main/groovy/Test.groovy').toFile()
+ }
+
+ def "test codenarcFix task fixes violations"() {
+ given: "a file with violations"
+ groovyFile.text = """package org.test
+
+class Test{
+ def map = [key:"value"]
+ def str = "unnecessary gstring"
+ def semi = "semicolon";
+ def lines = 1
+
+
+ def other = 2
+}
+"""
+ when: "running codenarcFix"
+ def result = GradleRunner.create()
+ .withProjectDir(testProjectDir.toFile())
+ .withArguments('codenarcFix', '--stacktrace')
+ .withPluginClasspath()
+ .build()
+
+ then: "task finished successfully"
+ result.task(':codenarcFix').outcome ==
org.gradle.testkit.runner.TaskOutcome.SUCCESS
Review Comment:
Done
##########
.idea/codeStyles/codeStyleConfig.xml:
##########
@@ -1,25 +1,5 @@
-<!--
-
- 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
-
- https://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.
-
--->
<component name="ProjectCodeStyleConfiguration">
<state>
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default copy" />
Review Comment:
Done
##########
.idea/codeStyles/Project.xml:
##########
@@ -1,105 +1,97 @@
-<!--
-
- 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
-
- https://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.
-
--->
<component name="ProjectCodeStyleConfiguration">
- <code_scheme name="Project" version="173">
- <option name="AUTODETECT_INDENTS" value="false"/>
- <GroovyCodeStyleSettings>
- <option name="ENABLE_GROOVYDOC_FORMATTING" value="false"/>
- <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999"/>
- <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999"/>
- <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
- <value/>
- </option>
- <option name="IMPORT_LAYOUT_TABLE">
- <value>
- <package name="java" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="javax" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="groovy" withSubpackages="true"
static="false"/>
- <package name="org.apache.groovy" withSubpackages="true"
static="false"/>
- <package name="org.codehaus.groovy" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="jakarta" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="" withSubpackages="true" static="false"/>
- <emptyLine/>
- <package name="io.spring" withSubpackages="true"
static="false"/>
- <package name="org.springframework" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="grails" withSubpackages="true"
static="false"/>
- <package name="org.apache.grails" withSubpackages="true"
static="false"/>
- <package name="org.grails" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="" withSubpackages="true" static="true"/>
- </value>
- </option>
- </GroovyCodeStyleSettings>
- <JavaCodeStyleSettings>
- <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999"/>
- <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999"/>
- <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
- <value/>
- </option>
- <option name="IMPORT_LAYOUT_TABLE">
- <value>
- <package name="java" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="javax" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="groovy" withSubpackages="true"
static="false"/>
- <package name="org.apache.groovy" withSubpackages="true"
static="false"/>
- <package name="org.codehaus.groovy" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="jakarta" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="" withSubpackages="true" static="false"/>
- <emptyLine/>
- <package name="io.spring" withSubpackages="true"
static="false"/>
- <package name="org.springframework" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="grails" withSubpackages="true"
static="false"/>
- <package name="org.apache.grails" withSubpackages="true"
static="false"/>
- <package name="org.grails" withSubpackages="true"
static="false"/>
- <emptyLine/>
- <package name="" withSubpackages="true" static="true"/>
- </value>
- </option>
- <option name="ENABLE_JAVADOC_FORMATTING" value="false"/>
- </JavaCodeStyleSettings>
- <editorconfig>
- <option name="ENABLED" value="false"/>
- </editorconfig>
- <codeStyleSettings language="Groovy">
- <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1"/>
- </codeStyleSettings>
- <codeStyleSettings language="JAVA">
- <option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1"/>
- <option name="KEEP_BLANK_LINES_IN_CODE" value="1"/>
- <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1"/>
- <option name="ARRAY_INITIALIZER_WRAP" value="1"/>
- <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true"/>
- <indentOptions>
- <option name="CONTINUATION_INDENT_SIZE" value="4"/>
- </indentOptions>
- </codeStyleSettings>
- </code_scheme>
+ <code_scheme name="Project" version="173">
+ <option name="AUTODETECT_INDENTS" value="false" />
Review Comment:
Done
##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GrailsCodeAnalysisPlugin.groovy:
##########
@@ -0,0 +1,183 @@
+/*
+ * 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
+ *
+ * https://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.
+ */
+package org.apache.grails.buildsrc
+
+import java.nio.file.Files
+import java.nio.file.Path
+
+import groovy.transform.CompileStatic
+
+import org.gradle.api.NamedDomainObjectContainer
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.api.plugins.quality.Pmd
+import org.gradle.api.plugins.quality.PmdExtension
+import org.gradle.api.plugins.quality.PmdPlugin
+import org.gradle.api.provider.Provider
+
+import com.github.spotbugs.snom.Confidence
+import com.github.spotbugs.snom.Effort
+import com.github.spotbugs.snom.SpotBugsExtension
+import com.github.spotbugs.snom.SpotBugsPlugin
+import com.github.spotbugs.snom.SpotBugsReport
+import com.github.spotbugs.snom.SpotBugsTask
+
+/**
+ * Convention plugin for Grails byte code analysis (PMD and SpotBugs).
+ * Both tools are opt-in; enable via Gradle properties.
+ */
+@CompileStatic
+class GrailsCodeAnalysisPlugin implements Plugin<Project> {
+
+ static String PMD_DIR_PROPERTY = 'grails.codeanalysis.dir.pmd'
+ static String PMD_ENABLED_PROPERTY = 'grails.codeanalysis.enabled.pmd'
+ static String PMD_CONFIG_FILE_NAME = 'pmd.xml'
+
+ static String SPOTBUGS_ENABLED_PROPERTY =
'grails.codeanalysis.enabled.spotbugs'
+
+ static String IGNORE_FAILURES_PROPERTY =
'grails.codeanalysis.ignoreFailures'
+ static String TEST_ANALYSIS_PROPERTY = 'grails.codeanalysis.enabled.tests'
+
+ static String BASE_RESOURCE_PATH =
'/META-INF/org.apache.grails.buildsrc.grails-code-analysis'
+
+ @Override
+ void apply(Project project) {
+ initExtension(project)
+ configurePmd(project)
+ configureSpotbugs(project)
+
+ // withType returns a live empty collection when the tool is not
enabled,
+ // so these dependsOn calls are safe regardless of whether
PMD/SpotBugs are active
+ project.tasks.register('codeAnalysis') { task ->
+ task.group = 'verification'
+ task.description = 'Runs code analysis checks (PMD, SpotBugs)'
+ task.dependsOn(project.tasks.withType(Pmd))
+ task.dependsOn(project.tasks.withType(SpotBugsTask))
+ }
+ }
+
+ private static void initExtension(Project project) {
+ def gca = project.extensions.create('grailsCodeAnalysis',
GrailsCodeAnalysisExtension)
+
+ gca.pmdDirectory.set(project.provider {
+ def directory = project.hasProperty(PMD_DIR_PROPERTY) ?
+
project.rootProject.layout.projectDirectory.dir(project.property(PMD_DIR_PROPERTY)
as String) :
+
project.rootProject.layout.buildDirectory.get().dir('codeanalysis').dir('pmd')
+
+ def toCreate = directory.asFile.toPath()
+ Files.createDirectories(toCreate)
+
+ createOrLoad(
+ toCreate.resolve(PMD_CONFIG_FILE_NAME),
+ "${BASE_RESOURCE_PATH}/pmd/${PMD_CONFIG_FILE_NAME}",
+ project
+ )
+
+ directory
+ })
+ }
+
+ private static void createOrLoad(Path expectedPath, String
defaultResource, Project project) {
+ boolean defaultPath =
expectedPath.startsWith(project.rootProject.buildDir.toPath())
Review Comment:
Done
##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GrailsCodeAnalysisPlugin.groovy:
##########
@@ -0,0 +1,183 @@
+/*
+ * 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
+ *
+ * https://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.
+ */
+package org.apache.grails.buildsrc
+
+import java.nio.file.Files
+import java.nio.file.Path
+
+import groovy.transform.CompileStatic
+
+import org.gradle.api.NamedDomainObjectContainer
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.api.plugins.quality.Pmd
+import org.gradle.api.plugins.quality.PmdExtension
+import org.gradle.api.plugins.quality.PmdPlugin
+import org.gradle.api.provider.Provider
+
+import com.github.spotbugs.snom.Confidence
+import com.github.spotbugs.snom.Effort
+import com.github.spotbugs.snom.SpotBugsExtension
+import com.github.spotbugs.snom.SpotBugsPlugin
+import com.github.spotbugs.snom.SpotBugsReport
+import com.github.spotbugs.snom.SpotBugsTask
+
+/**
+ * Convention plugin for Grails byte code analysis (PMD and SpotBugs).
+ * Both tools are opt-in; enable via Gradle properties.
+ */
+@CompileStatic
+class GrailsCodeAnalysisPlugin implements Plugin<Project> {
+
+ static String PMD_DIR_PROPERTY = 'grails.codeanalysis.dir.pmd'
+ static String PMD_ENABLED_PROPERTY = 'grails.codeanalysis.enabled.pmd'
+ static String PMD_CONFIG_FILE_NAME = 'pmd.xml'
+
+ static String SPOTBUGS_ENABLED_PROPERTY =
'grails.codeanalysis.enabled.spotbugs'
+
+ static String IGNORE_FAILURES_PROPERTY =
'grails.codeanalysis.ignoreFailures'
+ static String TEST_ANALYSIS_PROPERTY = 'grails.codeanalysis.enabled.tests'
+
+ static String BASE_RESOURCE_PATH =
'/META-INF/org.apache.grails.buildsrc.grails-code-analysis'
+
+ @Override
+ void apply(Project project) {
+ initExtension(project)
+ configurePmd(project)
+ configureSpotbugs(project)
+
+ // withType returns a live empty collection when the tool is not
enabled,
+ // so these dependsOn calls are safe regardless of whether
PMD/SpotBugs are active
+ project.tasks.register('codeAnalysis') { task ->
+ task.group = 'verification'
+ task.description = 'Runs code analysis checks (PMD, SpotBugs)'
+ task.dependsOn(project.tasks.withType(Pmd))
+ task.dependsOn(project.tasks.withType(SpotBugsTask))
+ }
+ }
+
+ private static void initExtension(Project project) {
+ def gca = project.extensions.create('grailsCodeAnalysis',
GrailsCodeAnalysisExtension)
+
+ gca.pmdDirectory.set(project.provider {
+ def directory = project.hasProperty(PMD_DIR_PROPERTY) ?
+
project.rootProject.layout.projectDirectory.dir(project.property(PMD_DIR_PROPERTY)
as String) :
+
project.rootProject.layout.buildDirectory.get().dir('codeanalysis').dir('pmd')
+
+ def toCreate = directory.asFile.toPath()
+ Files.createDirectories(toCreate)
+
+ createOrLoad(
+ toCreate.resolve(PMD_CONFIG_FILE_NAME),
+ "${BASE_RESOURCE_PATH}/pmd/${PMD_CONFIG_FILE_NAME}",
+ project
+ )
+
+ directory
+ })
+ }
+
+ private static void createOrLoad(Path expectedPath, String
defaultResource, Project project) {
+ boolean defaultPath =
expectedPath.startsWith(project.rootProject.buildDir.toPath())
+ if (!Files.exists(expectedPath) || expectedPath.size() == 0 ||
defaultPath) {
+ def defaultValue =
GrailsCodeAnalysisPlugin.getResourceAsStream(defaultResource)
+ if (!defaultValue) {
+ throw new IllegalStateException("Could not locate default
configuration file: ${defaultResource}")
+ }
+ project.logger.info('Replacing code analysis configuration')
+ expectedPath.text = defaultValue.text
+ }
+ }
+
+ static void configurePmd(Project project) {
+ Provider<Boolean> pmdEnabled = GradleUtils.booleanProvider(project,
PMD_ENABLED_PROPERTY)
Review Comment:
Done
##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GrailsCodeAnalysisPlugin.groovy:
##########
@@ -0,0 +1,183 @@
+/*
+ * 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
+ *
+ * https://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.
+ */
+package org.apache.grails.buildsrc
+
+import java.nio.file.Files
+import java.nio.file.Path
+
+import groovy.transform.CompileStatic
+
+import org.gradle.api.NamedDomainObjectContainer
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.api.plugins.quality.Pmd
+import org.gradle.api.plugins.quality.PmdExtension
+import org.gradle.api.plugins.quality.PmdPlugin
+import org.gradle.api.provider.Provider
+
+import com.github.spotbugs.snom.Confidence
+import com.github.spotbugs.snom.Effort
+import com.github.spotbugs.snom.SpotBugsExtension
+import com.github.spotbugs.snom.SpotBugsPlugin
+import com.github.spotbugs.snom.SpotBugsReport
+import com.github.spotbugs.snom.SpotBugsTask
+
+/**
+ * Convention plugin for Grails byte code analysis (PMD and SpotBugs).
+ * Both tools are opt-in; enable via Gradle properties.
+ */
+@CompileStatic
+class GrailsCodeAnalysisPlugin implements Plugin<Project> {
+
+ static String PMD_DIR_PROPERTY = 'grails.codeanalysis.dir.pmd'
+ static String PMD_ENABLED_PROPERTY = 'grails.codeanalysis.enabled.pmd'
+ static String PMD_CONFIG_FILE_NAME = 'pmd.xml'
+
+ static String SPOTBUGS_ENABLED_PROPERTY =
'grails.codeanalysis.enabled.spotbugs'
+
+ static String IGNORE_FAILURES_PROPERTY =
'grails.codeanalysis.ignoreFailures'
+ static String TEST_ANALYSIS_PROPERTY = 'grails.codeanalysis.enabled.tests'
+
+ static String BASE_RESOURCE_PATH =
'/META-INF/org.apache.grails.buildsrc.grails-code-analysis'
+
+ @Override
+ void apply(Project project) {
+ initExtension(project)
+ configurePmd(project)
+ configureSpotbugs(project)
+
+ // withType returns a live empty collection when the tool is not
enabled,
+ // so these dependsOn calls are safe regardless of whether
PMD/SpotBugs are active
+ project.tasks.register('codeAnalysis') { task ->
+ task.group = 'verification'
+ task.description = 'Runs code analysis checks (PMD, SpotBugs)'
+ task.dependsOn(project.tasks.withType(Pmd))
+ task.dependsOn(project.tasks.withType(SpotBugsTask))
+ }
+ }
+
+ private static void initExtension(Project project) {
+ def gca = project.extensions.create('grailsCodeAnalysis',
GrailsCodeAnalysisExtension)
+
+ gca.pmdDirectory.set(project.provider {
+ def directory = project.hasProperty(PMD_DIR_PROPERTY) ?
+
project.rootProject.layout.projectDirectory.dir(project.property(PMD_DIR_PROPERTY)
as String) :
+
project.rootProject.layout.buildDirectory.get().dir('codeanalysis').dir('pmd')
+
+ def toCreate = directory.asFile.toPath()
+ Files.createDirectories(toCreate)
+
+ createOrLoad(
+ toCreate.resolve(PMD_CONFIG_FILE_NAME),
+ "${BASE_RESOURCE_PATH}/pmd/${PMD_CONFIG_FILE_NAME}",
+ project
+ )
+
+ directory
+ })
+ }
+
+ private static void createOrLoad(Path expectedPath, String
defaultResource, Project project) {
+ boolean defaultPath =
expectedPath.startsWith(project.rootProject.buildDir.toPath())
+ if (!Files.exists(expectedPath) || expectedPath.size() == 0 ||
defaultPath) {
+ def defaultValue =
GrailsCodeAnalysisPlugin.getResourceAsStream(defaultResource)
+ if (!defaultValue) {
+ throw new IllegalStateException("Could not locate default
configuration file: ${defaultResource}")
+ }
+ project.logger.info('Replacing code analysis configuration')
+ expectedPath.text = defaultValue.text
+ }
+ }
+
+ static void configurePmd(Project project) {
+ Provider<Boolean> pmdEnabled = GradleUtils.booleanProvider(project,
PMD_ENABLED_PROPERTY)
+ if (!pmdEnabled.get()) {
+ return
+ }
+
+ project.pluginManager.apply(PmdPlugin)
+
+ Provider<Boolean> ignoreFailures =
GradleUtils.booleanProvider(project, IGNORE_FAILURES_PROPERTY)
+ Provider<Boolean> testStylingEnabled =
GradleUtils.booleanProvider(project, TEST_ANALYSIS_PROPERTY)
+
+ project.extensions.configure(PmdExtension) {
+ it.ruleSetFiles =
project.files(project.extensions.getByType(GrailsCodeAnalysisExtension).pmdDirectory.file(PMD_CONFIG_FILE_NAME))
+ it.ruleSets = []
+ it.ignoreFailures = ignoreFailures.get()
+ it.consoleOutput = true
+ it.toolVersion = project.findProperty('pmdVersion')
+ }
+
+ project.tasks.withType(Pmd).configureEach { Pmd task ->
+ task.group = 'verification'
+ task.onlyIf { !project.hasProperty('skipCodeStyle') }
+ task.ignoreFailures = ignoreFailures.get()
+
+ if (task.name.contains('Test') || task.name.contains('test')) {
+ task.enabled = testStylingEnabled.get()
+ }
+
+ task.reports.xml.required.set(true)
+ task.reports.xml.outputLocation.set(
+ project.extensions.getByType(GrailsCodeAnalysisExtension)
+ .reportsDirectory.get()
+ .dir('pmd')
+ .file("${project.name}-${task.name}.xml")
+ )
+ }
+ }
+
+ static void configureSpotbugs(Project project) {
+ Provider<Boolean> spotbugsEnabled =
GradleUtils.booleanProvider(project, SPOTBUGS_ENABLED_PROPERTY)
Review Comment:
Done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]