@@ -2,7 +2,6 @@ plugins {
22 id " java-library"
33 id " maven-publish"
44 id " signing"
5- id " me.champeau.jmh" version " 0.7.3"
65 id " com.diffplug.spotless" version " 8.3.0"
76 id " jacoco"
87}
@@ -36,28 +35,22 @@ dependencies {
3635 testImplementation platform(" org.junit:junit-bom:5.10.0" )
3736 testImplementation " org.junit.jupiter:junit-jupiter"
3837 testRuntimeOnly " org.junit.platform:junit-platform-launcher:1.7.1"
39- jmhImplementation " org.openjdk.jmh:jmh-core:1.37"
40- jmhAnnotationProcessor " org.openjdk.jmh:jmh-generator-annprocess:1.37"
4138}
4239
4340test {
4441 useJUnitPlatform()
4542}
4643
4744tasks. withType(Test ). configureEach {
48- maxHeapSize = " 4g"
4945 jvmArgs = [
50- " -Xlog:gc=debug:stdout" ,
51- " -XX:+HeapDumpOnOutOfMemoryError" ,
52- " -XX:HeapDumpPath=${ layout.buildDirectory} /heapdumps" ,
5346 " --enable-native-access=ALL-UNNAMED"
5447 ]
5548 systemProperty " vs4j.native.countMatches" ,
5649 layout. buildDirectory. file(" native/libvs4j_count_matches.so" ). get(). asFile. absolutePath
5750}
5851
59- // Build a tiny native shared library used by tests/benchmarks that exercise the
60- // no-upcall scan path (see NativeMatchHandler). Skipped silently if cmake is missing.
52+ // Build a tiny native shared library used by tests that exercise the
53+ // no-upcall scan path (see NativeMatchHandler). Skipped silently if cc is missing.
6154tasks. register(' buildTestNativeCallback' , Exec ) {
6255 def srcDir = file(" src/test/native" )
6356 def outDir = layout. buildDirectory. dir(" native" ). get(). asFile
@@ -66,30 +59,20 @@ tasks.register('buildTestNativeCallback', Exec) {
6659 doFirst { outDir. mkdirs() }
6760 ignoreExitValue = true
6861 commandLine ' sh' , ' -c' ,
69- " command -v cmake >/dev/null 2>&1 && " +
70- " cmake -S ${ srcDir} -B ${ outDir} -DCMAKE_BUILD_TYPE=Release && " +
71- " cmake --build ${ outDir} --config Release || " +
72- " echo 'cmake not available or build failed; native-callback tests will be skipped.'"
62+ " command -v cc >/dev/null 2>&1 && " +
63+ " cc -std=c11 -O3 -fPIC -shared " +
64+ " -o ${ outDir} /libvs4j_count_matches.so " +
65+ " ${ srcDir} /count-matches-native.c || " +
66+ " echo 'cc not available or build failed; native-callback tests will be skipped.'"
7367}
7468
7569tasks. named(' test' ). configure { dependsOn ' buildTestNativeCallback' }
76- tasks. matching { it. name == ' jmh' }. configureEach { dependsOn ' buildTestNativeCallback' }
7770
7871spotless {
7972 java {
8073 palantirJavaFormat(" 2.90.0" )
81- targetExclude " src/jmh/java/com/dynatrace/utils/RegexGenerator.java"
8274 licenseHeaderFile rootProject. file(' spotless/HEADER.java' )
8375 }
84-
85- format(' javaWithAttribution' ) {
86- target " src/jmh/java/com/dynatrace/utils/RegexGenerator.java"
87- licenseHeaderFile rootProject. file(' spotless/HEADER_WITH_ATTRIBUTION.java' ), ' package '
88- }
89- }
90-
91- jmh {
92- includeTests = false
9376}
9477
9578tasks. named(" jar" ) {
0 commit comments