Skip to content

Commit

Permalink
Restrict codenarc configuration
Browse files Browse the repository at this point in the history
* Bump codenarc to latest
* Bump Groovy to v3.0.x
  • Loading branch information
abelsromero committed Apr 22, 2023
1 parent f9cb8d7 commit 2d1fa7d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
4 changes: 3 additions & 1 deletion asciidoctorj-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ dependencies {
api project(':asciidoctorj')
implementation "com.beust:jcommander:$jcommanderVersion"

testImplementation project(':asciidoctorj-arquillian-extension')
testImplementation (project(':asciidoctorj-test-support')) {
exclude group: 'junit', module: 'junit'
}
testImplementation "org.jsoup:jsoup:$jsoupVersion"
}

Expand Down
46 changes: 28 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ ext {
coderayGemVersion = '1.1.3'
rougeGemVersion = '3.30.0'

codenarcVersion = '2.1.0'
groovyVersion = '2.5.22'
codenarcVersion = '3.2.0'
groovyVersion = '3.0.17'
erubisGemVersion = '2.7.0'
hamlGemVersion = '5.2.2'
openUriCachedGemVersion = '0.0.5'
slimGemVersion = '4.1.0'
concurrentRubyGemVersion = '1.1.7'
spockVersion = '2.0-groovy-2.5'
spockVersion = '2.3-groovy-3.0'
threadSafeGemVersion = '0.3.6'
tiltGemVersion = '2.0.11'
osgiVersion = '7.0.0'
Expand All @@ -113,7 +113,6 @@ subprojects {

status = _status


plugins.withType(JavaPlugin) {
project.tasks.withType(JavaCompile) { task ->
if (project.hasProperty("showDeprecation")) {
Expand All @@ -132,34 +131,47 @@ subprojects {
mavenCentral()
}

apply plugin: 'codenarc'
codenarc {
configFile = rootProject.file('config/codenarc/codenarc.groovy')
}

dependencies {
testImplementation(platform("org.junit:junit-bom:$junit5Version"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")

testImplementation "org.assertj:assertj-core:$assertjVersion"
testImplementation "org.hamcrest:hamcrest-library:$hamcrestVersion"
}

if (usesSpock(it)) {
apply plugin: 'codenarc'

codenarc {
configFile = rootProject.file('config/codenarc/codenarc.groovy')
}

dependencies {
testImplementation("org.spockframework:spock-core:$spockVersion") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
testImplementation "org.codehaus.groovy:groovy-all:$groovyVersion"

codenarc "org.codehaus.groovy:groovy:$groovyVersion"
codenarc "org.codehaus.groovy:groovy-xml:$groovyVersion"
codenarc "org.codehaus.groovy:groovy-ant:$groovyVersion"
codenarc("org.codenarc:CodeNarc:$codenarcVersion") {
exclude group: 'org.codehaus.groovy'
}

testRuntimeOnly("org.junit.vintage:junit-vintage-engine")

codenarc("org.codenarc:CodeNarc:$codenarcVersion")

constraints {
["groovy",
"groovy-ant",
"groovy-groovydoc",
"groovy-json",
"groovy-xml",
].each {
codenarc ("org.codehaus.groovy:$it") {
version {
strictly "$groovyVersion"
because "Use same groovy version as project"
}
}
}
}
}
}

Expand All @@ -170,7 +182,6 @@ subprojects {
}
}


test {
useJUnitPlatform()

Expand Down Expand Up @@ -206,7 +217,6 @@ configure(subprojects.findAll { !it.isDistribution() }) {
apply from: rootProject.file('gradle/eclipse.gradle')
apply plugin: 'idea'


javadoc {
// Oracle JDK11+ likes to fail the build over spoiled HTML
options.addStringOption('Xdoclint:none', '-quiet')
Expand Down

0 comments on commit 2d1fa7d

Please sign in to comment.