Skip to content

Commit

Permalink
Bump minimum Java to 11 (#239). Drop palantir's version consistency p…
Browse files Browse the repository at this point in the history
…lugin in favor of plugin catalogues and less invasive consistency/ sanity checker written by myself. #240.
  • Loading branch information
dweiss committed May 21, 2024
1 parent f51ab20 commit 3e57b45
Show file tree
Hide file tree
Showing 16 changed files with 275 additions and 86 deletions.
16 changes: 9 additions & 7 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
15 changes: 7 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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')
Expand Down
19 changes: 9 additions & 10 deletions gradle/java/compiler.gradle
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
75 changes: 75 additions & 0 deletions gradle/java/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -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"
})
}
4 changes: 2 additions & 2 deletions gradle/validation/check-environment.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions gradle/validation/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ configure(rootProject) {
ext {
licenseHeader = rootProject.file('gradle/validation/spotless/license-header.txt')
}

tasks.register("tidy") {}
}

subprojects {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 6 additions & 10 deletions hppc-benchmarks/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -44,8 +44,4 @@ Example of filtering to one benchmark and a subset of parameters:
"""
}
}

versionsLock {
testProject()
}
4 changes: 2 additions & 2 deletions hppc-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions hppc-template-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions hppc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
dependencyResolutionManagement {
versionCatalogs {
deps {
from(files('versions.toml'))
}
}
}

rootProject.name = 'hppc-root'

Expand Down
Loading

0 comments on commit 3e57b45

Please sign in to comment.