Skip to content

Commit a17b8ee

Browse files
committed
test
1 parent 65b0851 commit a17b8ee

File tree

14 files changed

+78
-17
lines changed

14 files changed

+78
-17
lines changed

.github/workflows/prql-java-test.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
junit-test:
1010
strategy:
1111
matrix:
12-
os: [ ubuntu-latest, windows-latest, macOS-latest ]
12+
os: [ ubuntu-latest, macOS-latest ]
1313
runs-on: ${{matrix.os}}
1414
steps:
1515
- name: Checkout code
@@ -20,11 +20,5 @@ jobs:
2020
toolchain: stable
2121
override: true
2222
default: true
23-
- name: build for x86_64-unknown-linux-gnu
24-
run: |
25-
rustup target add x86_64-unknown-linux-gnu
26-
cd ./
27-
cargo build --release --target=x86_64-unknown-linux-gnu
28-
cp -f ./prql-java/target/x86_64-unknown-linux-gnu/release/libprql4j.so ./prql-java/java-api/src/main/resources/libprql4j-linux64.so
2923
- name: Maven test
30-
run: cd ./java-api/ && ./mvnw test
24+
run: cd ./java/ && ./mvnw test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Cargo.lock
2626

2727
target
2828

29-
java-api/src/main/resources/libprql4j*
29+
java/src/main/resources/libprql4j*
File renamed without changes.

java/build.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
set -e
3+
4+
JAVA_SRC_HOME=$1
5+
ARCH="$(uname -m)"
6+
KERNEL_NAME="$(uname -s)"
7+
KERNEL_VERSION="$(uname -r)"
8+
9+
echo JAVA_SRC_HOME="$JAVA_SRC_HOME"
10+
11+
cd "$JAVA_SRC_HOME"
12+
# cd prql-java/
13+
cd ../
14+
15+
echo Platform Info: "$ARCH" "$KERNEL_NAME" "$KERNEL_VERSION"
16+
17+
echo building...
18+
cargo build --release
19+
echo building successfully
20+
ls -la target/release
21+
22+
if [ "$KERNEL_NAME" = 'Linux' ]; then
23+
if [ "$ARCH" = 'arm64' ] || [ "$ARCH" = 'aarch64' ]; then
24+
target='libprql4j-linux-aarch64.so'
25+
elif [ "$ARCH" = 'x86_64' ]; then
26+
target='libprql4j-linux64.so'
27+
else
28+
target='libprql4j-linux32.so'
29+
fi
30+
cp -f target/release/libprql4j.so java/src/main/resources/${target}
31+
elif [ "$KERNEL_NAME" = 'Darwin' ]; then
32+
if [ "$ARCH" = 'arm64' ] || [ "$ARCH" = 'aarch64' ]; then
33+
target='libprql4j-osx-arm64.dylib'
34+
elif [ "$ARCH" = 'x86_64' ]; then
35+
target='libprql4j-osx-x86_64.dylib'
36+
else
37+
echo [ERROR] have not support $ARCH:$$KERNEL_NAME yet
38+
exit 1
39+
fi
40+
cp -f target/release/libprql4j.dylib java/src/main/resources/${target}
41+
fi
42+
43+
ls -la java/src/main/resources
File renamed without changes.
File renamed without changes.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,40 @@ cp -f target/aarch64-unknown-linux-gnu/release/libprql4j.so java-api/src/main/re
1515

1616
#echo "compile target=x86_64-apple-darwin"
1717
#cross build --release --target=x86_64-apple-darwin
18-
#cp -f target/x86_64-apple-darwin/release/libprql4j.dylib java-api/src/main/resources/libprql4j-osx-x86_64.dylib
18+
#cp -f target/x86_64-apple-darwin/release/libprql4j.dylib java/src/main/resources/libprql4j-osx-x86_64.dylib
1919
#
2020
#echo "compile target=aarch64-apple-darwin"
2121
#cross build --release --target=aarch64-apple-darwin
22-
#cp -f target/aarch64-apple-darwin/release/libprql4j.dylib java-api/src/main/resources/libprql4j-osx-arm64.dylib
22+
#cp -f target/aarch64-apple-darwin/release/libprql4j.dylib java/src/main/resources/libprql4j-osx-arm64.dylib
2323
#
2424
#echo "compile target=x86_64-pc-windows-gnu"
2525
#cross build --release --target=x86_64-pc-windows-gnu
26-
#cp -f target/x86_64-pc-windows-gnu/release/prql4j.dll java-api/src/main/resources/libprql4j-win64.dll
26+
#cp -f target/x86_64-pc-windows-gnu/release/prql4j.dll java/src/main/resources/libprql4j-win64.dll
2727

2828

2929
### built by toolchain
3030

3131
#echo "compile target=x86_64-unknown-linux-gnu"
3232
#rustup target add x86_64-unknown-linux-gnu
3333
#cargo build --release --target=x86_64-unknown-linux-gnu
34-
#cp -f target/x86_64-unknown-linux-gnu/release/libprql4j.so java-api/src/main/resources/libprql4j-linux64.so
34+
#cp -f target/x86_64-unknown-linux-gnu/release/libprql4j.so java/src/main/resources/libprql4j-linux64.so
3535
#
3636
#echo "compile target=aarch64-unknown-linux-gnu"
3737
#rustup target add aarch64-unknown-linux-gnu
3838
#cargo build --release --target=aarch64-unknown-linux-gnu
39-
#cp -f target/aarch64-unknown-linux-gnu/release/libprql4j.so java-api/src/main/resources/libprql4j-linux-aarch64.so
39+
#cp -f target/aarch64-unknown-linux-gnu/release/libprql4j.so java/src/main/resources/libprql4j-linux-aarch64.so
4040

4141
#echo "compile target=x86_64-apple-darwin"
4242
#rustup target add x86_64-apple-darwin
4343
#cargo build --release --target=x86_64-apple-darwin
44-
#cp -f target/x86_64-apple-darwin/release/libprql4j.dylib java-api/src/main/resources/libprql4j-osx-x86_64.dylib
44+
#cp -f target/x86_64-apple-darwin/release/libprql4j.dylib java/src/main/resources/libprql4j-osx-x86_64.dylib
4545
#
4646
#echo "compile target=aarch64-apple-darwin"
4747
#rustup target add aarch64-apple-darwin
4848
#cargo build --release --target=aarch64-apple-darwin
49-
#cp -f target/aarch64-apple-darwin/release/libprql4j.dylib java-api/src/main/resources/libprql4j-osx-arm64.dylib
49+
#cp -f target/aarch64-apple-darwin/release/libprql4j.dylib java/src/main/resources/libprql4j-osx-arm64.dylib
5050
#
5151
#echo "compile target=x86_64-pc-windows-gnu"
5252
#rustup target add x86_64-pc-windows-gnu
5353
#cargo build --release --target=x86_64-pc-windows-gnu
54-
#cp -f target/x86_64-pc-windows-gnu/release/prql4j.dll java-api/src/main/resources/libprql4j-win64.dll
54+
#cp -f target/x86_64-pc-windows-gnu/release/prql4j.dll java/src/main/resources/libprql4j-win64.dll

java-api/pom.xml renamed to java/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,28 @@
3838
</dependency>
3939
</dependencies>
4040

41+
<build>
42+
<plugins>
43+
<plugin>
44+
<artifactId>exec-maven-plugin</artifactId>
45+
<groupId>org.codehaus.mojo</groupId>
46+
<version>1.6.0</version>
47+
<executions>
48+
<execution>
49+
<id>Run Script</id>
50+
<phase>initialize</phase>
51+
<goals>
52+
<goal>exec</goal>
53+
</goals>
54+
<configuration>
55+
<executable>build.sh</executable>
56+
<arguments>
57+
<argument>${project.basedir}</argument>
58+
</arguments>
59+
</configuration>
60+
</execution>
61+
</executions>
62+
</plugin>
63+
</plugins>
64+
</build>
4165
</project>

java-api/src/main/java/org/doki23/prql4j/Environment.java renamed to java/src/main/java/org/doki23/prql4j/Environment.java

File renamed without changes.

0 commit comments

Comments
 (0)