Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
65a768d
Upgrade to Java 17
loveleif Nov 15, 2025
2b75cae
Upgrade fastparse
loveleif Nov 15, 2025
994d7fc
Upgrade upickle
loveleif Nov 15, 2025
be6ed95
Upgrade cats
loveleif Nov 15, 2025
405961f
Upgrade eff
loveleif Nov 15, 2025
3740f40
Upgrade bctls
loveleif Nov 15, 2025
d392be0
Upgrade netty
loveleif Nov 15, 2025
424be5e
Upgrade h2
loveleif Nov 15, 2025
5dce21d
Upgrade log4j
loveleif Nov 15, 2025
5984a41
Upgrade scalatest
loveleif Nov 15, 2025
9fa758d
Upgrade test dependencies
loveleif Nov 15, 2025
314693b
Use build dir for temp files in tests
loveleif Nov 15, 2025
a4189da
Upgrade github workflow to Java 17
loveleif Nov 15, 2025
fbcb847
Upgrade spark
loveleif Nov 15, 2025
57d2355
Downgrade h2
loveleif Nov 16, 2025
b92b98a
Rename test base class
loveleif Nov 16, 2025
3abfabc
Run tests in parallel
loveleif Nov 17, 2025
27d2ea0
Fix broken test
loveleif Nov 17, 2025
9ba2b40
Upgrade to Gradle 8.14.3 and Java 21
loveleif Nov 13, 2025
61b8eaf
Bump JVM version
loveleif Nov 13, 2025
365103a
Fix dependencies
loveleif Nov 13, 2025
54f3b52
Fix license directory
loveleif Nov 13, 2025
67452d8
Fix scala compilation
loveleif Nov 14, 2025
41fbe07
WIP - try out gradle init
vnickolov Nov 14, 2025
09dddee
Add Gradle plugin to update dependency versions
vnickolov Nov 18, 2025
b1af6fc
Update spark and hadoop
vnickolov Nov 18, 2025
97ba6e8
rebasing from Love's branch
vnickolov Nov 18, 2025
8a1d3f8
Update Git workflow to use Java21
vnickolov Nov 18, 2025
2d51066
Update some dependencies and cleanup gradle plugins
vnickolov Nov 18, 2025
16639a9
Fix compiler options
loveleif Nov 18, 2025
319d65a
Fix broken import
loveleif Nov 18, 2025
48ae5dc
Downgrade h2
loveleif Nov 18, 2025
f31e450
Disable tck tests
loveleif Nov 18, 2025
359ab94
Adapt temporal functions to new spark api
loveleif Nov 18, 2025
f7c62a3
Update assertion to match real cypher
loveleif Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

# Binary files should be left untouched
*.jar binary

4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
- name: 'Set up JDK'
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
distribution: temurin
java-version: 21

- name: 'Cache Gradle packages'
uses: actions/cache@v4
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ gradle-app.setting

# Demo data sets
yelp_json
yelp_graph
yelp_graph

# Ignore Gradle build output directory
build

gradle.properties
196 changes: 156 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
plugins {
id 'java-library'
id 'com.github.hierynomus.license' version '0.16.2-37dde1f' apply false
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
id 'com.github.alisiikh.scalastyle' version '3.5.0' apply false
id 'me.champeau.jmh' version '0.7.3' apply false
id 'buildlogic.scala-application-conventions'

alias(libs.plugins.champeau.jmh).apply(false)
alias(libs.plugins.license).apply(false)
alias(libs.plugins.scalastyle).apply(false)
alias(libs.plugins.shadowjar).apply(false)

alias(libs.plugins.versionCatalogUpdate)
}

apply from: 'build.params.gradle'
apply plugin: 'base'

configurations {
resolvableRuntimeClasspath {
extendsFrom configurations.runtimeClasspath
canBeResolved = true
canBeConsumed = false
description = 'Resolvable runtime classpath configuration.'
}
}


allprojects {
java {
sourceCompatibility = 21
targetCompatibility = 21
}

scala {
scalaVersion = libs.scala.library.get().version
}

group = 'org.opencypher'
version = ver.self
}
Expand All @@ -26,30 +48,67 @@ subprojects {
}

dependencies {
implementation group: 'org.scala-lang', name: 'scala-library', version: ver.scala.full
implementation libs.scala.library

// Seems we need to lock these down, otherwise we get runtime errors on reflection
implementation group: 'org.scala-lang', name: 'scala-reflect', version: ver.scala.full
implementation group: 'org.scala-lang', name: 'scala-compiler', version: ver.scala.full

implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: ver.log4j.main
implementation group: 'org.apache.logging.log4j', name: "log4j-api-scala".scala(), version: ver.log4j.scala

testImplementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: ver.log4j.main
testImplementation group: 'org.scalatest', name: "scalatest".scala(), version: ver.scalatest
testImplementation group: 'org.scalacheck', name: "scalacheck".scala(), version: ver.scalacheck
testImplementation group: 'junit', name: 'junit', version: ver.junit.main
testImplementation group: 'org.mockito', name: 'mockito-all', version: ver.mockito
testRuntimeOnly group: 'org.junit.platform', name: 'junit-platform-runner', version: ver.junit.runner
implementation libs.scala.compiler
implementation libs.scala.reflect

implementation libs.log4j.api
implementation libs.log4j.api.scala

testImplementation libs.scalatestplus.mockito
testImplementation libs.scalatestplus.scalacheck
testImplementation libs.junit.platform.engine
testRuntimeOnly libs.junit.platform.launcher
testRuntimeOnly libs.scalatestplus.junit
testImplementation libs.log4j.core
testImplementation libs.scalatest
testImplementation libs.scalacheck
testImplementation libs.mockito.core
}

test {
maxHeapSize = "2g"
useJUnit()
maxHeapSize = '2g'

// Suggestion from https://docs.gradle.org/current/userguide/performance.html#a_run_tests_in_parallel
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1

// JVM args required by spark (see org.apache.spark.launcher.JavaModuleOptions)
jvmArgs(
'-XX:+IgnoreUnrecognizedVMOptions',
'--add-exports=java.base/sun.nio.ch=ALL-UNNAMED',
'--add-opens=java.base/java.lang.invoke=ALL-UNNAMED',
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.lang.invoke=ALL-UNNAMED',
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
'--add-opens=java.base/java.net=ALL-UNNAMED',
'--add-opens=java.base/java.nio=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED',
'--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.ch=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.cs=ALL-UNNAMED',
'--add-opens=java.base/sun.security.action=ALL-UNNAMED',
'--add-opens=java.base/sun.util.calendar=ALL-UNNAMED',
'--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED',
'-Djdk.reflect.useDirectMethodHandle=false'
)
useJUnitPlatform {
includeEngines 'scalatest'
testLogging {
events("passed", "skipped", "failed", "standard_error")
}
}

def testTempDir = file("$buildDir/tmp/test")
testTempDir.mkdirs()
systemProperty 'java.io.tmpdir', testTempDir.absolutePath
}

ext.scalacParameters = [
"-target:jvm-$ver.jvm".toString(),
'-unchecked',
'-deprecation',
'-feature',
Expand All @@ -59,50 +118,75 @@ subprojects {
'-Ywarn-adapted-args'
]

tasks.withType(ScalaCompile) {
tasks.withType(Test).configureEach {
// JVM args required by spark (see org.apache.spark.launcher.JavaModuleOptions)
jvmArgs(
'-XX:+IgnoreUnrecognizedVMOptions',
'--add-exports=java.base/sun.nio.ch=ALL-UNNAMED',
'--add-opens=java.base/java.lang.invoke=ALL-UNNAMED',
'--add-opens=java.base/java.lang=ALL-UNNAMED',
'--add-opens=java.base/java.lang.invoke=ALL-UNNAMED',
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED',
'--add-opens=java.base/java.io=ALL-UNNAMED',
'--add-opens=java.base/java.net=ALL-UNNAMED',
'--add-opens=java.base/java.nio=ALL-UNNAMED',
'--add-opens=java.base/java.util=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent=ALL-UNNAMED',
'--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED',
'--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.ch=ALL-UNNAMED',
'--add-opens=java.base/sun.nio.cs=ALL-UNNAMED',
'--add-opens=java.base/sun.security.action=ALL-UNNAMED',
'--add-opens=java.base/sun.util.calendar=ALL-UNNAMED',
'--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED',
'-Djdk.reflect.useDirectMethodHandle=false'
)
}

tasks.withType(ScalaCompile).configureEach {
options.encoding = 'UTF-8'
scalaCompileOptions.additionalParameters = scalacParameters
}

tasks.withType(ScalaDoc) {
tasks.withType(ScalaDoc).configureEach {
scalaDocOptions.additionalParameters = scalacParameters
}

task sourceJar(type: Jar) {
classifier = 'sources'
tasks.register('sourceJar', Jar) {
archiveClassifier = 'sources'
from(sourceSets.main.allSource)
}

task docJar(type: Jar) {
tasks.register('docJar', Jar) {
dependsOn tasks.scaladoc
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from(tasks.scaladoc.destinationDir)
}

task testJar(type: Jar) {
classifier = 'tests'
tasks.register('testJar', Jar) {
archiveClassifier = 'tests'
from(sourceSets.test.output)
}

tasks.withType(Jar) {
tasks.withType(Jar).configureEach {
from(tasks.generateLicensesFiles) {
into("META-INF/")
}
}

task licenseFile {
tasks.register('licenseFile') {
outputs.file(project.parent.file('LICENSE.txt'))
}

task dependencySearch(type: DependencyInsightReportTask) {
description 'Searches all projects for a dependency'
group 'help'
tasks.register('dependencySearch', DependencyInsightReportTask) {
description = 'Searches all projects for a dependency'
group = 'help'
}

task runApp {
tasks.register('runApp') {
dependsOn tasks.classes
group 'run'
description 'Run a custom Scala app (use -PmainClass=com.my.package.App)'
group = 'run'
description = 'Run a custom Scala app (use -PmainClass=com.my.package.App)'
doLast {
javaexec {
classpath = sourceSets.main.runtimeClasspath
Expand All @@ -111,12 +195,20 @@ subprojects {
}
}

configurations {
resolvableDefault {
extendsFrom configurations.default
canBeResolved = true
canBeConsumed = false
description = 'Resolvable default configuration.'
}
}
// copied from https://stackoverflow.com/a/38058671/568723
task depSize {
description 'Lists all dependencies sorted by their size'
tasks.register('depSize') {
description = 'Lists all dependencies sorted by their size'
doLast {
final formatStr = "%,10.2f"
final conf = configurations.default
final conf = configurations.resolvableDefault
final size = conf.collect { it.length() / (1024 * 1024) }.sum()
final out = new StringBuffer()
out << 'Total dependencies size:'.padRight(45)
Expand All @@ -133,3 +225,27 @@ subprojects {

apply from: 'build.publishing.gradle'
apply from: 'build.style.gradle'

def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}

versionCatalogUpdate {
// sort the catalog by key (default is true)
sortByKey = true

versionSelector {
// here 'it' is a ModuleVersionCandidate that can be used to determine if the version
// is allowed, returning true if it is.
!isNonStable(it.candidate.version)
}

keep {
// keep versions without any library or plugin reference
keepUnusedVersions = true
}


}
29 changes: 23 additions & 6 deletions build.licenses.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def allowList = [
]]
]

// Adapted from https://github.com/neo4j/graph-data-science/blob/2.13/gradle/licensing.gradle
// Adapted from https://github.com/neo4j/graph-data-science/blob/0684425ee000d2d5a13049ff1bf097075825cbe3/gradle/licensing.gradle
subprojects { proj ->
plugins.withType(JavaLibraryPlugin) {
proj.apply plugin: 'com.github.hierynomus.license'
Expand All @@ -63,13 +63,30 @@ subprojects { proj ->
// exclude 'test/resources/**'
// exclude 'main/resources/**'
include '**/*.java'
include '**/*.scala'
}
tasks.check.dependsOn tasks.license

// Define a resolvable configuration for license reporting
configurations {
licenseReportRuntimeClasspath {
extendsFrom configurations.runtimeClasspath
canBeResolved = true
canBeConsumed = false
description = 'Resolvable configuration for license reporting.'
}
}

// Dependency license reporting
downloadLicenses {
dependencyConfiguration = 'runtimeClasspath'
report {
json.enabled = true
json.destination = file(getLayout().getBuildDirectory().dir('reports/license'))
xml.enabled = false
xml.destination = file(getLayout().getBuildDirectory().dir('reports/license'))
html.enabled = false
html.destination = file(getLayout().getBuildDirectory().dir('reports/license'))
}
dependencyConfiguration = 'resolvableRuntimeClasspath'
aliases = allowList.collectEntries { lic ->
def actual = license(lic.name, lic.url)
def alternatives = lic.aliases.collect { it.url ? license(it.name, it.url) : it.name }
Expand All @@ -91,8 +108,8 @@ subprojects { proj ->

// Dependency license validation
tasks.register("validateLicenses") {
group 'license'
description 'Checks dependency licenses against an allowlist'
group = 'license'
description = 'Checks dependency licenses against an allowlist'
dependsOn tasks.downloadLicenses
doLast {
def allowListedNames = allowList.collect { it.name }
Expand All @@ -106,7 +123,7 @@ subprojects { proj ->

// Compound dependency licenses files
tasks.register("generateLicensesFiles") {
description 'Generates dependency license report files'
description = 'Generates dependency license report files'
dependsOn tasks.downloadLicenses, tasks.validateLicenses
ext.licensesFile = file("$tasks.downloadLicenses.jsonDestination/LICENSES.txt")
ext.noticeFile = file("$tasks.downloadLicenses.jsonDestination/NOTICE.txt")
Expand Down
Loading
Loading