Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Upgrade Gradle and dependencies
Browse files Browse the repository at this point in the history
Most importantly:

* Gradle upgraded to 8.3.
* Java requirement is now version 17.
  • Loading branch information
rkrisztian committed Aug 26, 2023
1 parent 84698b4 commit fb94dbf
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ij_formatter_tags_enabled = false
ij_smart_tabs = false
ij_wrap_on_typing = true

[{*.gant, *.gradle, *.groovy, *.gy}]
[{*.gradle,*.groovy}]
ij_groovy_align_group_field_declarations = false
ij_groovy_align_multiline_array_initializer_expression = false
ij_groovy_align_multiline_assignment = false
Expand Down Expand Up @@ -198,7 +198,7 @@ ij_groovy_while_brace_force = never
ij_groovy_while_on_new_line = false
ij_groovy_wrap_long_lines = true

[{*.yml, *.yaml}]
[{*.yml,*.yaml}]
indent_style = space
indent_size = 2
tab_width = 2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ search for multiple patterns, Ack cannot replace text in files, and I don't care
* The tool was written primarily for use on Linux & Mac, but git bash for Windows is also supported. The implemented binary file
detection does not work natively on Windows, as [text encoding on there is quite
different](https://superuser.com/questions/294219/what-are-the-differences-between-linux-and-windows-txt-files-unicode-encoding).
* Java Runtime Environment version 11 or newer
* Java Runtime Environment version 17 or newer

### From release

Expand Down
26 changes: 13 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ plugins {
}

wrapper {
gradleVersion = '7.4'
gradleVersion = '8.3'
distributionType = Wrapper.DistributionType.ALL
}

version = BUILD_VERSION
group = GROUP_ID
version = '3.0.0'
group = 'rkrisztian.search'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
languageVersion = JavaLanguageVersion.of(17)
}
}

Expand All @@ -25,18 +25,18 @@ repositories {
}

dependencies {
def groovyVersion = '3.0.9'
def groovyVersion = '3.0.17'

implementation "org.codehaus.groovy:groovy-all:$groovyVersion"
codenarc 'org.codenarc:CodeNarc:2.2.0'
codenarc 'org.codenarc:CodeNarc:3.3.0'
codenarc "org.codehaus.groovy:groovy-all:$groovyVersion"
}

testing {
suites {
all {
dependencies {
implementation 'org.spockframework:spock-core:2.0-groovy-3.0'
implementation 'org.spockframework:spock-core:2.3-groovy-3.0'
}

useJUnitJupiter()
Expand All @@ -50,14 +50,14 @@ testing {

integrationTest(JvmTestSuite) {
dependencies {
implementation project
implementation project()
implementation configurations.testCompileClasspath
implementation sourceSets.test.output
}

targets.all {
testTask.configure {
systemProperty 'java.io.tmpdir', "${buildDir}/tmp"
systemProperty 'java.io.tmpdir', "${->layout.buildDirectory.get()}/tmp"
}
}
}
Expand All @@ -79,7 +79,7 @@ distributions {
}
}

tasks.named('jar').configure {
tasks.named('jar') {
manifest {
attributes 'Implementation-Title': 'Search App',
'Implementation-Version': archiveVersion
Expand All @@ -92,10 +92,10 @@ codenarc {
}

jacoco {
toolVersion = '0.8.7'
toolVersion = '0.8.10'
}

tasks.named('jacocoTestReport').configure {
tasks.named('jacocoTestReport') {
enabled = false
}

Expand All @@ -113,7 +113,7 @@ tasks.register('codeCoverageReport', JacocoReport) {
}
}

tasks.named('check').configure {
tasks.named('check') {
dependsOn testing.suites.integrationTest
dependsOn 'codeCoverageReport'
}
12 changes: 12 additions & 0 deletions config/codenarc/rules.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ ruleset {
ruleset 'rulesets/braces.xml'
ruleset('rulesets/comments.xml') {
'ClassJavadoc' doNotApplyToFilesMatching: /.*?(Test(Constants)?|Mock.*?|Assertions)\.groovy$/
// Bug: https://github.com/CodeNarc/CodeNarc/issues/743
'SpaceAfterCommentDelimiter' enabled: false
'SpaceBeforeCommentDelimiter' enabled: false
}
ruleset 'rulesets/concurrency.xml'
ruleset('rulesets/convention.xml') {
Expand All @@ -29,6 +32,8 @@ ruleset {
}
// TODO: Consider the DRY rules.
//ruleset 'rulesets/dry.xml'
// I get compilation failures for the enhanced ruleset.
//ruleset 'rulesets/enhanced.xml'
ruleset 'rulesets/exceptions.xml'
ruleset('rulesets/formatting.xml') {
'LineLength' length: 130
Expand Down Expand Up @@ -59,6 +64,13 @@ ruleset {
// Not Spock friendly
'MethodName' doNotApplyToFilesMatching: /.*?Test\.groovy$/
}
// TODO: Consider the security rules.
ruleset('rulesets/security.xml') {
// Not developing an Applet
'NonFinalPublicField' enabled: false
// Not a web application
'SystemExit' enabled: false
}
ruleset('rulesets/size.xml') {
// JaCoCo is used, not Cobertura.
'CrapMetric' enabled: false
Expand Down
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
GROUP_ID=rkrisztian.search
BUILD_VERSION=2.0.0

org.gradle.configureondemand=false
org.gradle.parallel=true
org.gradle.daemon=true
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
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.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion src/test/groovy/search/conf/GlobPatternTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GlobPatternTest extends Specification {

void 'glob pattern works'() {
expect:
new GlobPattern('*.java').matches(Paths.get('Test.java'))
new GlobPattern('*.java').matches Paths.get('Test.java')
}

}

0 comments on commit fb94dbf

Please sign in to comment.