fix: harden JNI boundary and remove legacy example

This commit is contained in:
桥下红药
2026-07-30 14:26:10 +08:00
parent 24a1552bf8
commit e9d383f64d
22 changed files with 262 additions and 1079 deletions
-32
View File
@@ -12,38 +12,6 @@ env:
CARGO_TERM_COLOR: always
jobs:
# ──────────────────────────────────────────────────────────────────
# Java fat JAR(平台无关,只需构建一次)
# 运行方式:java -Djava.library.path=<so/dll 目录> -jar dht-crawler-jni-example-<ver>.jar
# ──────────────────────────────────────────────────────────────────
build-java-jar:
name: Build Java Example JAR
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Build fat JAR
working-directory: examples-jni
run: |
chmod +x gradlew
./gradlew shadowJar -PprojectVersion=${{ github.event.inputs.version }} --no-daemon
shell: bash
- name: Upload JAR to Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
files: examples-jni/build/libs/dht-crawler-jni-example-${{ github.event.inputs.version }}.jar
# ──────────────────────────────────────────────────────────────────
# 各平台 Rust 构建(example 可执行 + JNI so/dll/dylib
# ──────────────────────────────────────────────────────────────────
+2 -1
View File
@@ -59,6 +59,7 @@ jobs:
- "mimalloc"
- "metrics"
- "mimalloc,metrics"
- "jni"
steps:
- uses: actions/checkout@v4
- name: Install Rust
@@ -88,4 +89,4 @@ jobs:
cargo build --examples --verbose
else
cargo build --examples --verbose --features "${{ matrix.features }}"
fi
fi