Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 6 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,14 @@ jobs:
working-directory: log/native
run: cargo build --release

- name: Set up Java 17
- name: Set up Java 24
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '24'
distribution: 'temurin'

- name: Cache Maven local repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Maven build and test
run: mvn verify -Djava.library.path=log/native/target/release
- name: Gradle build and test
run: ./gradlew build
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
# Rust build artifacts
target/

# Gradle
.gradle/
build/

# Java build artifacts
*.class
*.jar
!gradle/wrapper/gradle-wrapper.jar
*.war
*.ear
log/target/
benchmark-driver/target/

# Benchmark results
*.json
Expand Down
12 changes: 6 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ opendata-java/
│ ├── LogDbReader.java # Read-only API
│ ├── LogDbConfig.java # Configuration record
│ └── ...
└── pom.xml # Maven multi-module build
├── build.gradle # Gradle multi-module build
└── settings.gradle
```

## JNI Architecture
Expand Down Expand Up @@ -92,8 +93,7 @@ The JNI layer prepends an 8-byte timestamp to values for latency measurement:
### Prerequisites

- Rust stable toolchain
- Java 17+
- Maven 3.8+
- Java 24+
- Sibling clone of `opendata` repository

### Building
Expand All @@ -103,9 +103,9 @@ The JNI layer prepends an 8-byte timestamp to values for latency measurement:
cd log/native
cargo build --release

# Build and install Java modules
# Build Java modules
cd ../..
mvn clean install
./gradlew build
```

### Testing
Expand All @@ -116,7 +116,7 @@ cd log/native
cargo test

# Java tests (requires native library)
mvn test -Djava.library.path=log/native/target/release
./gradlew test
```

### Formatting and Linting
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ Open an issue describing:
### Prerequisites

- Rust stable toolchain ([rustup](https://rustup.rs/))
- Java 17+ ([SDKMAN](https://sdkman.io/) recommended)
- Maven 3.8+
- Java 24+ ([SDKMAN](https://sdkman.io/) recommended)
- Git
- Local clone of [opendata](https://github.com/opendata-oss/opendata) as sibling directory

Expand All @@ -72,7 +71,7 @@ cargo build --release

# Build Java modules
cd ../..
mvn clean install -DskipTests
./gradlew build
```

## Code Style
Expand Down Expand Up @@ -154,7 +153,7 @@ cd log/native
cargo test

# Java tests (requires native library built)
mvn test -Djava.library.path=log/native/target/release
./gradlew test
```

## Pull Request Process
Expand Down
38 changes: 38 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
subprojects {
apply plugin: 'java-library'

group = 'dev.opendata'
version = '0.1.0-SNAPSHOT'

def minimumJava = 24
def currentJava = JavaVersion.current()
def toolchainVersion = currentJava.isCompatibleWith(JavaVersion.toVersion(minimumJava))
? Integer.parseInt(currentJava.majorVersion)
: minimumJava

java {
toolchain {
languageVersion = JavaLanguageVersion.of(toolchainVersion)
}
sourceCompatibility = JavaVersion.toVersion(minimumJava)
targetCompatibility = JavaVersion.toVersion(minimumJava)
}

tasks.withType(JavaCompile).configureEach {
options.release = minimumJava
}

repositories {
mavenCentral()
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testImplementation 'org.assertj:assertj-core:3.25.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.2'
}

test {
useJUnitPlatform()
}
}
2 changes: 2 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Common utilities for OpenData Java bindings
// Dependencies are configured in the root build.gradle
42 changes: 0 additions & 42 deletions common/pom.xml

This file was deleted.

Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 18 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions log/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dependencies {
implementation project(':common')
}

test {
jvmArgs "-Djava.library.path=${project.projectDir}/native/target/release"
jvmArgs '--enable-native-access=ALL-UNNAMED'
}
59 changes: 0 additions & 59 deletions log/pom.xml

This file was deleted.

25 changes: 0 additions & 25 deletions pom.xml

This file was deleted.

6 changes: 6 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}

rootProject.name = 'opendata-java'
include 'common', 'log'