-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Gradle 7.2 and fix report generation (#350)
* Gradle 7.2 * Fix Gradle lint report generation with Gradle 7.2
- Loading branch information
Showing
10 changed files
with
787 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ain/groovy/com/netflix/nebula/lint/plugin/Gradle7AndHigherLintPluginTaskConfigurer.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.netflix.nebula.lint.plugin | ||
|
||
import org.gradle.api.Action | ||
import org.gradle.api.Project | ||
|
||
class Gradle7AndHigherLintPluginTaskConfigurer extends GradleBetween5And7LintPluginTaskConfigurer { | ||
@Override | ||
Action<GradleLintReportTask> configureReportAction(Project project, GradleLintExtension extension) { | ||
new Action<GradleLintReportTask>() { | ||
@Override | ||
void execute(GradleLintReportTask gradleLintReportTask) { | ||
gradleLintReportTask.reportOnlyFixableViolations = getReportOnlyFixableViolations(project, extension) | ||
gradleLintReportTask.reports.all { report -> | ||
def fileSuffix = report.name == 'text' ? 'txt' : report.name | ||
report.conventionMapping.with { | ||
required.set(report.name == getReportFormat(project, extension)) | ||
outputLocation.set(new File(project.buildDir, "reports/gradleLint/${project.name}.$fileSuffix")) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...n/groovy/com/netflix/nebula/lint/plugin/GradleBetween5And7LintPluginTaskConfigurer.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.netflix.nebula.lint.plugin | ||
|
||
import org.gradle.api.Action | ||
import org.gradle.api.Project | ||
import org.gradle.api.Task | ||
import org.gradle.api.execution.TaskExecutionListener | ||
import org.gradle.api.plugins.JavaBasePlugin | ||
import org.gradle.api.tasks.TaskProvider | ||
import org.gradle.api.tasks.TaskState | ||
import org.gradle.api.tasks.compile.AbstractCompile | ||
|
||
class GradleBetween5And7LintPluginTaskConfigurer extends GradleLintPluginTaskConfigurer{ | ||
@Override | ||
Action<GradleLintReportTask> configureReportAction(Project project, GradleLintExtension extension) { | ||
new Action<GradleLintReportTask>() { | ||
@Override | ||
void execute(GradleLintReportTask gradleLintReportTask) { | ||
gradleLintReportTask.reportOnlyFixableViolations = getReportOnlyFixableViolations(project, extension) | ||
gradleLintReportTask.reports.all { report -> | ||
report.conventionMapping.with { | ||
enabled = { report.name == getReportFormat(project, extension) } | ||
destination = { | ||
def fileSuffix = report.name == 'text' ? 'txt' : report.name | ||
new File(project.buildDir, "reports/gradleLint/${project.name}.$fileSuffix") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.