BAEL-4091: Intro to Gradle Lint Plugin (#14674)

This commit is contained in:
Chrys Exaucet 2023-09-18 02:58:54 +00:00 committed by GitHub
parent cd16715e10
commit dab5b25f7e
7 changed files with 54 additions and 8 deletions

View File

@ -1,14 +1,21 @@
plugins{
id "nebula.lint" version "16.9.0"
plugins {
id "nebula.lint" version "18.1.0"
}
description = "Gradle 5 root project"
allprojects {
apply plugin :"java"
apply plugin :"nebula.lint"
apply plugin: "java"
apply plugin: "nebula.lint"
gradleLint {
rules=['unused-dependency']
rules = [
// 'unused-dependency',
// 'dependency-parentheses',
// 'undeclared-dependency',
// 'minimum-dependency-version'
]
reportFormat = 'text'
reportOnlyFixableViolations = true
}
group = "com.baeldung"
version = "0.0.1"
@ -16,6 +23,6 @@ allprojects {
targetCompatibility = "1.8"
repositories {
jcenter()
mavenCentral()
}
}

View File

@ -0,0 +1,6 @@
allprojects {
apply plugin: "nebula.lint"
gradleLint {
rules = ['dependency-parenthesis']
}
}

View File

@ -0,0 +1 @@
/build/

View File

@ -0,0 +1,15 @@
description = "Introduction to Gradle Lint Plugin"
ext {
awsVersion = '2.20.83'
}
dependencies {
implementation platform("software.amazon.awssdk:bom:$awsVersion")
testImplementation('junit:junit:4.13.1')
gradleLint.ignore('unused-dependency', 'dependency-parentheses') {
implementation('software.amazon.awssdk:sts')
}
}

View File

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip

View File

@ -0,0 +1,16 @@
import com.netflix.nebula.lint.plugin.GradleLintPlugin
initscript {
repositories { mavenCentral() }
dependencies {
classpath 'com.netflix.nebula:gradle-lint-plugin:18.1.0'
}
}
allprojects {
apply plugin: GradleLintPlugin
gradleLint {
rules=[]
alwaysRun= false
}
}

View File

@ -2,4 +2,5 @@ rootProject.name='gradle-5'
include 'java-exec'
include 'unused-dependencies'
include 'source-sets'
include 'cmd-line-args'
include 'cmd-line-args'
include 'gradle-lint-intro'