Skip to content

Commit

Permalink
update tools, fix codenarc groovy4 support (change dependency)
Browse files Browse the repository at this point in the history
  • Loading branch information
xvik committed Feb 17, 2023
1 parent cf94c00 commit 3a85f37
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
* Gradle 8 support (#77)
* Update checkstyle 10.3.1 -> 10.6.0
* Update pmd 6.47 -> 6.54 (java 19 support)
* Update spotbugs 4.7.1 -> 4.7.3
* Update codenarc 3.1.0 -> 3.2.0
* Fix codenarc for groovy4 support: change to x.x-groovy-4.0 version instead of codenarc-groovy4 artifact

### 4.8.0 (2022-07-02)
* Update checkstyle 9.1 -> 10.3.1
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ mkdocs {
}
extras = [
'version': project.docVersion,
'checkstyle': '10.3.1',
'pmd': '6.47.0',
'spotbugs': '4.7.1',
'codenarc': '3.1.0',
'checkstyle': '10.6.0',
'pmd': '6.54.0',
'spotbugs': '4.7.3',
'codenarc': '3.2.0',
'spotbugsPlugin': project.spotbugsPluginVersion,
'cpd': project.cpdVersion,
'animalsnifferPlugin': project.animalsnifferVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class QualityExtension {
sourceSets = [project.sourceSets.main] as Collection<SourceSet>
}

String checkstyleVersion = '10.3.1'
String pmdVersion = '6.47.0'
String spotbugsVersion = '4.7.1'
String codenarcVersion = '3.1.0'
String checkstyleVersion = '10.6.0'
String pmdVersion = '6.54.0'
String spotbugsVersion = '4.7.3'
String codenarcVersion = '3.2.0'

/**
* Sets AnimalSniffer version.
Expand Down Expand Up @@ -96,7 +96,7 @@ class QualityExtension {
boolean checkstyleBackport = !JavaVersion.current().java11Compatible

/**
* Since codenarc 3.1.0 there is a separate artifact for groovy 4 (CodeNarc-Groovy4). Gradle runs codenarc
* Since codenarc 3.1.0 there is a separate artifact for groovy 4 (CodeNarc-x.x-groovy-4.0). Gradle runs codenarc
* task with it's own groovy so by default groovy4 artifact is active. If you need to use earlier codenarc version
* then switch this option to false.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import ru.vyarus.gradle.plugin.quality.util.SpotbugsUtils
class QualityPlugin implements Plugin<Project> {

private static final String QUALITY_TASK = 'checkQuality'
private static final String CODENARC_GROOVY4 = '-groovy-4.0'

@Override
void apply(Project project) {
Expand Down Expand Up @@ -284,10 +285,10 @@ class QualityPlugin implements Plugin<Project> {
configFile = configLoader.resolveCodenarcConfig(false)
sourceSets = extension.sourceSets
}
if (extension.codenarcGroovy4) {
if (extension.codenarcGroovy4 && !extension.codenarcVersion.endsWith(CODENARC_GROOVY4)) {
// since codenarc 3.1 different groovy4-based jar could be used
dependencies {
codenarc "org.codenarc:CodeNarc-Groovy4:${extension.codenarcVersion}"
codenarc "org.codenarc:CodeNarc:${extension.codenarcVersion}$CODENARC_GROOVY4"
}
}
tasks.withType(CodeNarc).configureEach {
Expand Down

0 comments on commit 3a85f37

Please sign in to comment.