diff --git a/CHANGES.txt b/CHANGES.txt index 89833334..a065ddc0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,17 +3,19 @@ ** New features and API changes - GH-235: Drop WormMap and WormSet. - Those associative containers implementing Worm Hashing were added in HPPC-176. - Since then, with improvements to HashMap, there is no clear advantage to using - WormMap. Dropping them helps to reduce the library size. - (Bruno Roustant). + GH-239: Minimum Java bumped to 11 (from 8). (Dawid Weiss) + + GH-235: Drop WormMap and WormSet. + Those associative containers implementing Worm Hashing were added in HPPC-176. + Since then, with improvements to HashMap, there is no clear advantage to using + WormMap. Dropping them helps to reduce the library size. + (Bruno Roustant). ** Improvements ** Bugs - GH-237: Fix HashMap put/remove returned value for empty key after clear. (Bruno Roustant) + GH-237: Fix HashMap put/remove returned value for empty key after clear. (Bruno Roustant) [0.9.1] https://github.com/carrotsearch/hppc/releases/tag/0.9.1 @@ -24,7 +26,7 @@ https://github.com/carrotsearch/hppc/releases/tag/0.9.1 QuickSort can be used with custom element comparator and swapper. GH-28: Added SortedIterationKTypeVTypeHashMap: a sorted-iteration order view over - another key-value map. (Bruno Roustant) + another key-value map. (Bruno Roustant) ** Improvements diff --git a/build.gradle b/build.gradle index 07548220..693c022b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,12 @@ plugins { id 'base' - id 'com.diffplug.spotless' version "5.17.1" apply false - id "com.palantir.consistent-versions" version "2.5.0" - - id "com.github.ben-manes.versions" version "0.28.0" - - id 'de.thetaphi.forbiddenapis' version '3.2' apply false - - id "me.champeau.gradle.jmh" version "0.5.3" apply false + alias(deps.plugins.dependencychecks) + alias(deps.plugins.spotless) apply false + alias(deps.plugins.benmanes.versions) + alias(deps.plugins.forbiddenapis) apply false + alias(deps.plugins.jmh) apply false + alias(deps.plugins.versionCatalogUpdate) apply false } rootProject.version = '0.10.0-SNAPSHOT' @@ -18,6 +16,7 @@ ext { forbiddenApiRulesDir = file("gradle/forbidden-apis") } +apply from: file('gradle/java/dependencies.gradle') apply from: file('gradle/misc/propertyOrDefault.gradle') apply from: file('gradle/validation/check-environment.gradle') apply from: file('gradle/validation/forbidden-apis.gradle') diff --git a/gradle/java/compiler.gradle b/gradle/java/compiler.gradle index 8ebde4cc..9e8f583a 100644 --- a/gradle/java/compiler.gradle +++ b/gradle/java/compiler.gradle @@ -1,17 +1,16 @@ -configure(rootProject) { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = sourceCompatibility -} +def minJavaVersion = JavaVersion.toVersion(deps.versions.minJava.get()) allprojects { - plugins.withType(JavaPlugin) { - tasks.withType(JavaCompile) { - sourceCompatibility = rootProject.sourceCompatibility - targetCompatibility = rootProject.sourceCompatibility - options.encoding = "UTF-8" + plugins.withType(JavaPlugin).configureEach { + java { + sourceCompatibility = minJavaVersion + targetCompatibility = minJavaVersion + } + tasks.withType(JavaCompile).configureEach { + options.encoding = "UTF-8" options.compilerArgs += [ - "--release", "8", + "--release", minJavaVersion.majorVersion, "-Xlint:unchecked,deprecation", "-proc:none", "-Werror", diff --git a/gradle/java/dependencies.gradle b/gradle/java/dependencies.gradle new file mode 100644 index 00000000..91321c9b --- /dev/null +++ b/gradle/java/dependencies.gradle @@ -0,0 +1,75 @@ +allprojects { + apply plugin: deps.plugins.dependencychecks.get().pluginId + + def mainConfigurations = project.configurations.matching { + it.name in [ + "compileClasspath", + "runtimeClasspath" + ] + } + def testConfigurations = project.configurations.matching { + it.name in [ + "annotationProcessor", + "testCompileClasspath", + "testRuntimeClasspath" + ] + } + + dependencyVersionChecks { + lockFileComment = "An inventory of resolved dependency versions. Do not edit this file directly." + + configurationGroups { + // this groups all 'main' source set configurations from all projects. + main_dependencies { + include mainConfigurations + } + // this groups all 'test' and other configurations from all projects. + test_dependencies { + include testConfigurations + } + } + } + + dependencies { + constraints { + mainConfigurations.configureEach { Configuration conf -> + // no resolutions for conflicting dependencies at the moment. + } + } + } +} + +// Configure version catalog cleanups plugin. +configure(rootProject) { + apply plugin: deps.plugins.versionCatalogUpdate.get().pluginId + + versionCatalogUpdate { + sortByKey = true + + keep { + // Never remove these named versions (used for other things than module dependencies). + versions = [ + "minJava" + ] + } + + versionCatalogs { + deps { + catalogFile = file("versions.toml") + } + } + } + + tasks.matching { it.name == "tidy" }.configureEach { + it.dependsOn(":versionCatalogFormatDeps") + } + + tasks.matching { it.path in [":versionCatalogUpdateDeps"] }.configureEach { + it.interactive = true + } + + tasks.register("updateTomls", { + dependsOn ":versionCatalogUpdateInternalDeps" + dependsOn ":versionCatalogUpdateDeps" + }) +} \ No newline at end of file diff --git a/gradle/validation/check-environment.gradle b/gradle/validation/check-environment.gradle index 9b9e9c29..c1c48166 100644 --- a/gradle/validation/check-environment.gradle +++ b/gradle/validation/check-environment.gradle @@ -5,8 +5,8 @@ import org.gradle.util.GradleVersion configure(rootProject) { ext { - expectedGradleVersion = '7.3' - expectedJavaVersion = JavaVersion.VERSION_1_8 + expectedGradleVersion = '8.7' + expectedJavaVersion = JavaVersion.VERSION_11 } wrapper { diff --git a/gradle/validation/spotless.gradle b/gradle/validation/spotless.gradle index 5de14600..9b24f62a 100644 --- a/gradle/validation/spotless.gradle +++ b/gradle/validation/spotless.gradle @@ -3,6 +3,8 @@ configure(rootProject) { ext { licenseHeader = rootProject.file('gradle/validation/spotless/license-header.txt') } + + tasks.register("tidy") {} } subprojects { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c053..943f0cbf 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fbce071a..48c0a02c 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.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/hppc-benchmarks/build.gradle b/hppc-benchmarks/build.gradle index b3d4f2c5..cd925b9d 100644 --- a/hppc-benchmarks/build.gradle +++ b/hppc-benchmarks/build.gradle @@ -1,17 +1,17 @@ plugins { id 'java-library' - id "me.champeau.gradle.jmh" + alias(deps.plugins.jmh) } dependencies { implementation project(":hppc") - implementation "it.unimi.dsi:fastutil:8.4.1" - implementation "com.koloboke:koloboke-impl-jdk8:1.0.0" + implementation deps.fastutil + implementation deps.koloboke + implementation deps.jmh.core - implementation 'org.openjdk.jmh:jmh-core' - jmh 'org.openjdk.jmh:jmh-core' - jmh 'org.openjdk.jmh:jmh-generator-annprocess' + jmh deps.jmh.core + jmh deps.jmh.generator.annprocess } jmh { @@ -44,8 +44,4 @@ Example of filtering to one benchmark and a subset of parameters: """ } -} - -versionsLock { - testProject() } \ No newline at end of file diff --git a/hppc-examples/build.gradle b/hppc-examples/build.gradle index 09bcc17d..5ab31b36 100644 --- a/hppc-examples/build.gradle +++ b/hppc-examples/build.gradle @@ -4,8 +4,8 @@ plugins { dependencies { testImplementation project(":hppc") - testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner" - testImplementation "org.assertj:assertj-core" + testImplementation deps.randomizedtesting.runner + testImplementation deps.assertj } test { diff --git a/hppc-template-processor/build.gradle b/hppc-template-processor/build.gradle index 428ac500..088be15c 100644 --- a/hppc-template-processor/build.gradle +++ b/hppc-template-processor/build.gradle @@ -13,14 +13,14 @@ configurations { dependencies { api project(":hppc-template-intrinsics") - implementation "org.antlr:antlr4-runtime" - implementation "org.apache.velocity:velocity-engine-core" - implementation "com.carrotsearch.console:launcher" + implementation deps.antlr.runtime + implementation deps.velocity + implementation deps.carrotsearch.console.launcher - testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner" - testImplementation "org.assertj:assertj-core" + testImplementation deps.randomizedtesting.runner + testImplementation deps.assertj - antlr "org.antlr:antlr4" + antlr deps.antlr.base } sourceSets { diff --git a/hppc/build.gradle b/hppc/build.gradle index 2249efb1..9084b3f8 100644 --- a/hppc/build.gradle +++ b/hppc/build.gradle @@ -35,8 +35,8 @@ dependencies { templatesImplementation project(":hppc-template-intrinsics") - testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner" - testImplementation "org.assertj:assertj-core" + testImplementation deps.randomizedtesting.runner + testImplementation deps.assertj } task generateMainTemplates(type: GenerateTemplatesTask) { diff --git a/settings.gradle b/settings.gradle index 32ea188d..66ae8d9e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,10 @@ +dependencyResolutionManagement { + versionCatalogs { + deps { + from(files('versions.toml')) + } + } +} rootProject.name = 'hppc-root' diff --git a/versions.lock b/versions.lock index c39281e0..d6244315 100644 --- a/versions.lock +++ b/versions.lock @@ -1,30 +1,117 @@ -# Run ./gradlew --write-locks to regenerate this file -com.carrotsearch.console:launcher:1.0.6 (1 constraints: 0905f635) -com.carrotsearch.progresso:progresso:1.7.4 (3 constraints: f53976b5) -com.carrotsearch.progresso:progresso-consolewidth-unixish:1.7.4 (1 constraints: bf0e485b) -com.carrotsearch.progresso:progresso-log4j2:1.7.4 (1 constraints: bf0e485b) -org.antlr:antlr4-runtime:4.8 (1 constraints: b0042b2c) -org.apache.commons:commons-lang3:3.9 (1 constraints: dd10c5b0) -org.apache.logging.log4j:log4j-api:2.15.0 (2 constraints: f71fed82) -org.apache.logging.log4j:log4j-core:2.15.0 (3 constraints: d3324fa1) -org.apache.logging.log4j:log4j-slf4j18-impl:2.15.0 (1 constraints: eb0e2e6a) -org.apache.velocity:velocity-engine-core:2.2 (1 constraints: a8041f2c) -org.slf4j:slf4j-api:1.8.0-beta4 (4 constraints: 144e9e32) - -[Test dependencies] -com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.9 (1 constraints: 14051336) -com.koloboke:koloboke-api-jdk8:1.0.0 (2 constraints: 871d9d62) -com.koloboke:koloboke-impl-common-jdk8:1.0.0 (1 constraints: 690d3433) -com.koloboke:koloboke-impl-jdk8:1.0.0 (1 constraints: 0305f035) -it.unimi.dsi:fastutil:8.4.1 (1 constraints: 0f052036) -junit:junit:4.13.1 (1 constraints: c4198ec1) -net.sf.jopt-simple:jopt-simple:4.6 (1 constraints: 610a91b7) -org.apache.commons:commons-math3:3.2 (1 constraints: 5c0a8ab7) -org.assertj:assertj-core:3.21.0 (1 constraints: 38053c3b) -org.hamcrest:hamcrest-core:1.3 (1 constraints: cc05fe3f) -org.openjdk.jmh:jmh-core:1.25 (5 constraints: 37454039) -org.openjdk.jmh:jmh-generator-annprocess:1.25 (1 constraints: dc04f830) -org.openjdk.jmh:jmh-generator-asm:1.25 (1 constraints: 29107198) -org.openjdk.jmh:jmh-generator-bytecode:1.25 (1 constraints: dc04f830) -org.openjdk.jmh:jmh-generator-reflection:1.25 (2 constraints: 431e9e63) -org.ow2.asm:asm:5.0.3 (1 constraints: 490ea250) +{ + "comment" : "An inventory of resolved dependency versions. Do not edit this file directly.", + "configurationGroups" : { + "main_dependencies" : { + "com.carrotsearch.console:launcher:1.1.3" : "4c9ff4c6,refs=2", + "com.carrotsearch.progresso:progresso:1.8.2" : "4c9ff4c6,refs=2", + "com.carrotsearch.progresso:progresso-consolewidth-unixish:1.8.2" : "4c9ff4c6,refs=2", + "com.carrotsearch.progresso:progresso-log4j2:1.8.2" : "4c9ff4c6,refs=2", + "com.koloboke:koloboke-api-jdk8:1.0.0" : "236177a6,refs=2", + "com.koloboke:koloboke-impl-common-jdk8:1.0.0" : "236177a6,refs=2", + "com.koloboke:koloboke-impl-jdk8:1.0.0" : "236177a6,refs=2", + "it.unimi.dsi:fastutil:8.4.1" : "236177a6,refs=2", + "net.sf.jopt-simple:jopt-simple:4.6" : "236177a6,refs=2", + "org.antlr:antlr4-runtime:4.8" : "4c9ff4c6,refs=2", + "org.apache.commons:commons-lang3:3.9" : "4c9ff4c6,refs=2", + "org.apache.commons:commons-math3:3.2" : "236177a6,refs=2", + "org.apache.logging.log4j:log4j-api:2.19.0" : "4c9ff4c6,refs=2", + "org.apache.logging.log4j:log4j-core:2.19.0" : "4c9ff4c6,refs=2", + "org.apache.logging.log4j:log4j-slf4j2-impl:2.19.0" : "4c9ff4c6,refs=2", + "org.apache.velocity:velocity-engine-core:2.2" : "4c9ff4c6,refs=2", + "org.openjdk.jmh:jmh-core:1.25" : "236177a6,refs=2", + "org.slf4j:slf4j-api:2.0.3" : "4c9ff4c6,refs=2" + }, + "test_dependencies" : { + "com.carrotsearch.console:launcher:1.1.3" : "5ece2686,refs=2", + "com.carrotsearch.progresso:progresso:1.8.2" : "5ece2686,refs=2", + "com.carrotsearch.progresso:progresso-consolewidth-unixish:1.8.2" : "5ece2686,refs=2", + "com.carrotsearch.progresso:progresso-log4j2:1.8.2" : "5ece2686,refs=2", + "com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1" : "72da68d0,refs=6", + "com.koloboke:koloboke-api-jdk8:1.0.0" : "358fa966,refs=2", + "com.koloboke:koloboke-impl-common-jdk8:1.0.0" : "358fa966,refs=2", + "com.koloboke:koloboke-impl-jdk8:1.0.0" : "358fa966,refs=2", + "it.unimi.dsi:fastutil:8.4.1" : "358fa966,refs=2", + "junit:junit:4.13.1" : "72da68d0,refs=6", + "net.sf.jopt-simple:jopt-simple:4.6" : "358fa966,refs=2", + "org.antlr:antlr4-runtime:4.8" : "5ece2686,refs=2", + "org.apache.commons:commons-lang3:3.9" : "5ece2686,refs=2", + "org.apache.commons:commons-math3:3.2" : "358fa966,refs=2", + "org.apache.logging.log4j:log4j-api:2.19.0" : "5ece2686,refs=2", + "org.apache.logging.log4j:log4j-core:2.19.0" : "5ece2686,refs=2", + "org.apache.logging.log4j:log4j-slf4j2-impl:2.19.0" : "5ece2686,refs=2", + "org.apache.velocity:velocity-engine-core:2.2" : "5ece2686,refs=2", + "org.assertj:assertj-core:3.21.0" : "72da68d0,refs=6", + "org.hamcrest:hamcrest-core:1.3" : "72da68d0,refs=6", + "org.openjdk.jmh:jmh-core:1.25" : "358fa966,refs=2", + "org.slf4j:slf4j-api:2.0.3" : "5ece2686,refs=2" + } + }, + "because" : { + "236177a6" : [ + { + "configuration" : "compileClasspath", + "projectPath" : ":hppc-benchmarks" + }, + { + "configuration" : "runtimeClasspath", + "projectPath" : ":hppc-benchmarks" + } + ], + "358fa966" : [ + { + "configuration" : "testCompileClasspath", + "projectPath" : ":hppc-benchmarks" + }, + { + "configuration" : "testRuntimeClasspath", + "projectPath" : ":hppc-benchmarks" + } + ], + "4c9ff4c6" : [ + { + "configuration" : "compileClasspath", + "projectPath" : ":hppc-template-processor" + }, + { + "configuration" : "runtimeClasspath", + "projectPath" : ":hppc-template-processor" + } + ], + "5ece2686" : [ + { + "configuration" : "testCompileClasspath", + "projectPath" : ":hppc-template-processor" + }, + { + "configuration" : "testRuntimeClasspath", + "projectPath" : ":hppc-template-processor" + } + ], + "72da68d0" : [ + { + "configuration" : "testCompileClasspath", + "projectPath" : ":hppc" + }, + { + "configuration" : "testRuntimeClasspath", + "projectPath" : ":hppc" + }, + { + "configuration" : "testCompileClasspath", + "projectPath" : ":hppc-examples" + }, + { + "configuration" : "testRuntimeClasspath", + "projectPath" : ":hppc-examples" + }, + { + "configuration" : "testCompileClasspath", + "projectPath" : ":hppc-template-processor" + }, + { + "configuration" : "testRuntimeClasspath", + "projectPath" : ":hppc-template-processor" + } + ] + } +} \ No newline at end of file diff --git a/versions.props b/versions.props deleted file mode 100644 index fc0beefb..00000000 --- a/versions.props +++ /dev/null @@ -1,8 +0,0 @@ -org.antlr:*=4.8 -org.apache.velocity:velocity-engine-core=2.2 - -com.carrotsearch.console:*=1.0.6 -com.carrotsearch.randomizedtesting:*=2.7.9 -org.assertj:*=3.21.0 - -org.openjdk.jmh:*=1.25 \ No newline at end of file diff --git a/versions.toml b/versions.toml new file mode 100644 index 00000000..a7224974 --- /dev/null +++ b/versions.toml @@ -0,0 +1,30 @@ +[versions] +antlr = "4.8" +assertj = "3.21.0" +carrotsearch-console = "1.1.3" +fastutil = "8.4.1" +jmh = "1.25" +koloboke = "1.0.0" +minJava = "11" +randomizedtesting = "2.8.1" +velocity = "2.2" + +[libraries] +antlr-base = { module = "org.antlr:antlr4", version.ref = "antlr" } +antlr-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr" } +assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } +carrotsearch-console-launcher = { module = "com.carrotsearch.console:launcher", version.ref = "carrotsearch-console" } +fastutil = { module = "it.unimi.dsi:fastutil", version.ref = "fastutil" } +jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" } +jmh-generator-annprocess = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" } +koloboke = { module = "com.koloboke:koloboke-impl-jdk8", version.ref = "koloboke" } +randomizedtesting-runner = { module = "com.carrotsearch.randomizedtesting:randomizedtesting-runner", version.ref = "randomizedtesting" } +velocity = { module = "org.apache.velocity:velocity-engine-core", version.ref = "velocity" } + +[plugins] +benmanes-versions = "com.github.ben-manes.versions:0.47.0" +dependencychecks = "com.carrotsearch.gradle.dependencychecks:0.0.7" +forbiddenapis = "de.thetaphi.forbiddenapis:3.5.1" +jmh = "me.champeau.gradle.jmh:0.5.3" +spotless = "com.diffplug.spotless:5.17.1" +versionCatalogUpdate = "nl.littlerobots.version-catalog-update:0.8.4"