Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(binding/java): build, async and docs #2276

Merged
merged 23 commits into from
May 22, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/bindings_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Build with Maven
run: mvn test --file ${{ github.workspace }}/bindings/java/pom.xml

- name: Build and test
working-directory: bindings/java
run: mvn clean verify
38 changes: 19 additions & 19 deletions Cargo.lock

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

5 changes: 2 additions & 3 deletions bindings/java/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ crate-type = ["cdylib"]
doc = false

[dependencies]
jni = "0.21.1"
opendal.workspace = true

jni = "0.21.1"
once_cell = "1.17.1"
tokio = { version = "1", features = ["full"] }

tokio = { version = "1.28.1", features = ["full"] }
num_cpus = "1.15.0"
12 changes: 11 additions & 1 deletion bindings/java/readme.md → bindings/java/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# OpenDAL Java Bindings

## Build and test
suyanhanx marked this conversation as resolved.
Show resolved Hide resolved

Following the command below to build `opendal-java` and run the tests:

```shell
mvn clean verify
```

## Todos

- [ ] Readme for usage
- [ ] Development/Contribution guide.
- [ ] Exceptions need polish to conform Java files related interface.
- [ ] Cucumber test cases
- [ ] Experiment: Java doesn't support async/await hence using Kotlin to implement async related API.
- [ ] Cross platform build for release build.
- [ ] Cross-platform build for release build.
49 changes: 23 additions & 26 deletions bindings/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.opendal</groupId>
<artifactId>java-binding</artifactId>
<artifactId>opendal-java</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
Xuanwo marked this conversation as resolved.
Show resolved Hide resolved
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<rust-maven-plugin.version>1.0.0</rust-maven-plugin.version>

<questdb.version>1.0.0</questdb.version>

<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
</properties>

<dependencyManagement>
Expand All @@ -58,56 +62,53 @@
<dependency>
<groupId>org.questdb</groupId>
<artifactId>jar-jni</artifactId>
<version>${rust-maven-plugin.version}</version>
<version>${questdb.version}</version>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>


</dependencies>

<build>
<testResources>
Xuanwo marked this conversation as resolved.
Show resolved Hide resolved
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<!--
The Rust Maven Plugin
Here it'll build the `str-reverse` crate and place the cdylib in the target's "classes" directory.
Placing it there will have Maven automatically bundle the compiled code in the Jar.
-->
<plugin>
<groupId>org.questdb</groupId>
<artifactId>rust-maven-plugin</artifactId>
<version>${rust-maven-plugin.version}</version>
<version>${questdb.version}</version>
<executions>
<execution>
<id>opendal-java</id>
<goals>
<goal>build</goal>
</goals>
<configuration>
<path>../java</path>
<path>${project.basedir}</path>
<release>true</release>
<copyTo>${project.build.directory}/classes/org/apache/opendal/rust/libs</copyTo>
<copyTo>${project.build.directory}/classes/native</copyTo>
<copyWithPlatformDir>true</copyWithPlatformDir>
<extraArgs>
<extraArg>--color=always</extraArg>
Expand All @@ -119,18 +120,14 @@

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</build>
Expand Down
Loading