diff --git a/.editorconfig b/.editorconfig index a29c687..9d7d4d6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 @@ -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 diff --git a/README.md b/README.md index bda615a..41a5b6e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/build.gradle b/build.gradle index 9605a0a..1465ed6 100644 --- a/build.gradle +++ b/build.gradle @@ -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) } } @@ -25,10 +25,10 @@ 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" } @@ -36,7 +36,7 @@ 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() @@ -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" } } } @@ -79,7 +79,7 @@ distributions { } } -tasks.named('jar').configure { +tasks.named('jar') { manifest { attributes 'Implementation-Title': 'Search App', 'Implementation-Version': archiveVersion @@ -92,10 +92,10 @@ codenarc { } jacoco { - toolVersion = '0.8.7' + toolVersion = '0.8.10' } -tasks.named('jacocoTestReport').configure { +tasks.named('jacocoTestReport') { enabled = false } @@ -113,7 +113,7 @@ tasks.register('codeCoverageReport', JacocoReport) { } } -tasks.named('check').configure { +tasks.named('check') { dependsOn testing.suites.integrationTest dependsOn 'codeCoverageReport' } diff --git a/config/codenarc/rules.groovy b/config/codenarc/rules.groovy index aa862ce..fccd724 100644 --- a/config/codenarc/rules.groovy +++ b/config/codenarc/rules.groovy @@ -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') { @@ -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 @@ -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 diff --git a/gradle.properties b/gradle.properties index c730f52..8d7ab93 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1159fc..27313fb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/src/test/groovy/search/conf/GlobPatternTest.groovy b/src/test/groovy/search/conf/GlobPatternTest.groovy index dc806c2..e1d4d1b 100644 --- a/src/test/groovy/search/conf/GlobPatternTest.groovy +++ b/src/test/groovy/search/conf/GlobPatternTest.groovy @@ -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') } }