BAEL-4091: Intro to Gradle Lint Plugin (#14674)
This commit is contained in:
parent
cd16715e10
commit
dab5b25f7e
@ -1,14 +1,21 @@
|
|||||||
plugins{
|
plugins {
|
||||||
id "nebula.lint" version "16.9.0"
|
id "nebula.lint" version "18.1.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
description = "Gradle 5 root project"
|
description = "Gradle 5 root project"
|
||||||
allprojects {
|
allprojects {
|
||||||
apply plugin :"java"
|
apply plugin: "java"
|
||||||
apply plugin :"nebula.lint"
|
apply plugin: "nebula.lint"
|
||||||
gradleLint {
|
gradleLint {
|
||||||
rules=['unused-dependency']
|
rules = [
|
||||||
|
// 'unused-dependency',
|
||||||
|
// 'dependency-parentheses',
|
||||||
|
// 'undeclared-dependency',
|
||||||
|
// 'minimum-dependency-version'
|
||||||
|
]
|
||||||
reportFormat = 'text'
|
reportFormat = 'text'
|
||||||
|
reportOnlyFixableViolations = true
|
||||||
}
|
}
|
||||||
group = "com.baeldung"
|
group = "com.baeldung"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
@ -16,6 +23,6 @@ allprojects {
|
|||||||
targetCompatibility = "1.8"
|
targetCompatibility = "1.8"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
6
gradle-modules/gradle-5/gradle-lint-intro.gradle
Normal file
6
gradle-modules/gradle-5/gradle-lint-intro.gradle
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
allprojects {
|
||||||
|
apply plugin: "nebula.lint"
|
||||||
|
gradleLint {
|
||||||
|
rules = ['dependency-parenthesis']
|
||||||
|
}
|
||||||
|
}
|
1
gradle-modules/gradle-5/gradle-lint-intro/.gitignore
vendored
Normal file
1
gradle-modules/gradle-5/gradle-lint-intro/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/build/
|
15
gradle-modules/gradle-5/gradle-lint-intro/build.gradle
Normal file
15
gradle-modules/gradle-5/gradle-lint-intro/build.gradle
Normal 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')
|
||||||
|
}
|
||||||
|
}
|
@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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
|
||||||
|
16
gradle-modules/gradle-5/lint.gradle
Normal file
16
gradle-modules/gradle-5/lint.gradle
Normal 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
|
||||||
|
}
|
||||||
|
}
|
@ -2,4 +2,5 @@ rootProject.name='gradle-5'
|
|||||||
include 'java-exec'
|
include 'java-exec'
|
||||||
include 'unused-dependencies'
|
include 'unused-dependencies'
|
||||||
include 'source-sets'
|
include 'source-sets'
|
||||||
include 'cmd-line-args'
|
include 'cmd-line-args'
|
||||||
|
include 'gradle-lint-intro'
|
Loading…
x
Reference in New Issue
Block a user