File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build Linux java-tree-sitter native (.so)
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ build :
8+ runs-on : ubuntu-22.04
9+ steps :
10+ - uses : actions/checkout@v4
11+
12+ - name : Install build tools
13+ run : |
14+ sudo apt-get update
15+ sudo apt-get install -y build-essential cmake git openjdk-17-jdk-headless
16+
17+ - name : Clone java-tree-sitter 1.9.1
18+ run : |
19+ git clone --depth 1 --branch 1.9.1 \
20+ https://github.com/seart-group/java-tree-sitter.git java-tree-sitter
21+
22+ - name : Build native library
23+ run : |
24+ cd java-tree-sitter
25+ # The native CMake target produces libjava-tree-sitter.so
26+ cmake -B build \
27+ -DCMAKE_BUILD_TYPE=Release \
28+ -DCMAKE_C_FLAGS="-O2" \
29+ -DJTREESITTER_BUILD_SHARED_LIBS=ON
30+ cmake --build build --target java-tree-sitter -- -j$(nproc)
31+ # Find the .so wherever CMake placed it
32+ find build -name "libjava-tree-sitter.so"
33+
34+ - name : Copy to libs/linux-x64/
35+ run : |
36+ mkdir -p libs/linux-x64
37+ find java-tree-sitter/build -name "libjava-tree-sitter.so" \
38+ -exec cp {} libs/linux-x64/ \;
39+ echo "Built:"
40+ file libs/linux-x64/libjava-tree-sitter.so
41+ ldd libs/linux-x64/libjava-tree-sitter.so
42+
43+ - uses : actions/upload-artifact@v4
44+ with :
45+ name : linux-ts-native
46+ path : libs/linux-x64/libjava-tree-sitter.so
47+ retention-days : 90
You can’t perform that action at this time.
0 commit comments