This repository was archived by the owner on Mar 29, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
bindings/java/dbeaver-extension Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,11 +22,32 @@ jobs:
2222 - name : Checkout
2323 uses : actions/checkout@v5
2424
25- - name : Set up Java 17
25+ - name : Set up Java 21
2626 uses : actions/setup-java@v4
2727 with :
2828 distribution : temurin
29- java-version : ' 17'
29+ java-version : ' 21'
30+
31+ - name : Download DBeaver plugins (for compile)
32+ shell : bash
33+ run : |
34+ set -euo pipefail
35+ repo_root="$PWD"
36+ dbeaver_dir="$repo_root/.dbeaver"
37+ mkdir -p "$dbeaver_dir"
38+
39+ curl -fsSL -o "$dbeaver_dir/dbeaver.zip" \
40+ https://dbeaver.io/files/dbeaver-ce-latest-win32.win32.x86_64.zip
41+
42+ python - "$dbeaver_dir/dbeaver.zip" "$dbeaver_dir" <<'PY'
43+ import sys, zipfile
44+ zip_path, dest = sys.argv[1], sys.argv[2]
45+ with zipfile.ZipFile(zip_path) as z:
46+ z.extractall(dest)
47+ PY
48+
49+ test -d "$dbeaver_dir/dbeaver/plugins"
50+ echo "DBEAVER_PLUGIN_DIR=$dbeaver_dir/dbeaver/plugins" >> "$GITHUB_ENV"
3051
3152 - name : Set up Nim
3253 uses : jiro4989/setup-nim-action@v2
82103 run : |
83104 set -euo pipefail
84105 cd bindings/java
85- ./gradlew --no-daemon :driver:jar :dbeaver-extension:jar -PnativeLibDir="$GITHUB_WORKSPACE/build"
106+ ./gradlew --no-daemon :driver:jar :dbeaver-extension:jar -PnativeLibDir="$GITHUB_WORKSPACE/build" -PdbeaverPluginDir="$DBEAVER_PLUGIN_DIR"
86107
87108 mkdir -p "$GITHUB_WORKSPACE/dbeaver-dist/dbeaver/plugins"
88109 # Name the bundle jar in the conventional DBeaver/OSGi style.
Original file line number Diff line number Diff line change @@ -19,19 +19,21 @@ dependencies {
1919 implementation project(' :driver' )
2020
2121 // DBeaver OSGi bundles – compile-only (provided at runtime by the DBeaver platform).
22- def pluginDir = new File ( ' /usr/lib/dbeaver/plugins ' )
23- if (pluginDir . exists()) {
24- def jars = pluginDir . listFiles() . findAll { f ->
25- f . name . endsWith( ' .jar ' ) && (
26- f . name . startsWith( ' org.jkiss.dbeaver.model_ ' ) ||
27- f . name . startsWith( ' org.jkiss.dbeaver.model.jdbc_ ' ) ||
28- f . name . startsWith( ' org.jkiss. dbeaver.model.sql_ ' ) ||
29- f . name . startsWith( ' org.jkiss. dbeaver.ext.generic_ ' ) ||
30- f . name . startsWith( ' org.jkiss.utils_ ' )
31- )
32- }
33- compileOnly files(jars )
22+ def dbeaverPluginDirProp = project . findProperty( ' dbeaverPluginDir ' )
23+ def dbeaverPluginDirEnv = System . getenv( ' DBEAVER_PLUGIN_DIR ' )
24+
25+ def candidateDirs = []
26+ if (dbeaverPluginDirProp != null ) candidateDirs << new File (dbeaverPluginDirProp . toString())
27+ if (dbeaverPluginDirEnv != null ) candidateDirs << new File (dbeaverPluginDirEnv)
28+ candidateDirs << new File ( ' /usr/lib/ dbeaver/plugins ' )
29+ candidateDirs << new File ( ' /usr/share/ dbeaver/plugins ' )
30+
31+ def pluginDir = candidateDirs . find { it . exists() && it . isDirectory() }
32+ if (pluginDir == null ) {
33+ throw new GradleException ( " DBeaver plugin directory not found. Set -PdbeaverPluginDir=... (or DBEAVER_PLUGIN_DIR) to a folder containing DBeaver's *.jar bundles. " )
3434 }
35+
36+ compileOnly fileTree(pluginDir) { include ' *.jar' }
3537}
3638
3739jar {
You can’t perform that action at this time.
0 commit comments