Skip to content

Commit 8426d8e

Browse files
jbachorikclaude
andcommitted
Switch lz4-java to at.yawk.lz4 fork 1.10.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8d2e9c8 commit 8426d8e

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

build-logic/conventions/src/main/kotlin/com/datadoghq/profiler/JavaConventionsPlugin.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.datadoghq.profiler
33

44
import org.gradle.api.Plugin
55
import org.gradle.api.Project
6+
import org.gradle.api.artifacts.VersionCatalogsExtension
67
import org.gradle.api.tasks.compile.JavaCompile
78

89
/**
@@ -11,6 +12,7 @@ import org.gradle.api.tasks.compile.JavaCompile
1112
* Applies standard Java compilation options across all subprojects:
1213
* - Java 8 release target for broad JVM compatibility
1314
* - Suppresses JDK 21+ deprecation warnings for --release 8
15+
* - Redirects org.lz4:lz4-java to at.yawk.lz4:lz4-java (community fork)
1416
*
1517
* Requires JDK 21+ for building (Gradle 9 requirement).
1618
* The compiled bytecode targets Java 8 runtime.
@@ -29,5 +31,16 @@ class JavaConventionsPlugin : Plugin<Project> {
2931
// The deprecation is informational - Java 8 targeting still works
3032
options.compilerArgs.addAll(listOf("--release", "8", "-Xlint:-options"))
3133
}
34+
35+
// Redirect org.lz4:lz4-java → at.yawk.lz4:lz4-java (community fork)
36+
// JMC flightrecorder transitively depends on the old coordinates
37+
val libs = project.extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
38+
val lz4Version = libs.findVersion("lz4").orElseThrow().requiredVersion
39+
project.configurations.all {
40+
resolutionStrategy.dependencySubstitution {
41+
substitute(module("org.lz4:lz4-java"))
42+
.using(module("at.yawk.lz4:lz4-java:$lz4Version"))
43+
}
44+
}
3245
}
3346
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ slf4j = "1.7.32"
1414
# Profiler runtime
1515
jmc = "8.1.0"
1616
jol = "0.16"
17-
lz4 = "1.8.0"
17+
lz4 = "1.10.3"
1818
snappy = "1.1.10.1"
1919
zstd = "1.5.5-4"
2020

@@ -40,7 +40,7 @@ jmc-flightrecorder = { module = "org.openjdk.jmc:flightrecorder", version.ref =
4040
jol-core = { module = "org.openjdk.jol:jol-core", version.ref = "jol" }
4141

4242
# Compression libraries
43-
lz4 = { module = "org.lz4:lz4-java", version.ref = "lz4" }
43+
lz4 = { module = "at.yawk.lz4:lz4-java", version.ref = "lz4" }
4444
snappy = { module = "org.xerial.snappy:snappy-java", version.ref = "snappy" }
4545
zstd = { module = "com.github.luben:zstd-jni", version.ref = "zstd" }
4646

0 commit comments

Comments
 (0)