diff --git a/.gitea/workflows/ci-basex.yaml b/.gitea/workflows/ci-basex.yaml
index 9617331..100a375 100644
--- a/.gitea/workflows/ci-basex.yaml
+++ b/.gitea/workflows/ci-basex.yaml
@@ -40,9 +40,7 @@ jobs:
- name: Build package
run: |
basex scripts/install.bxs
- cp dist/pdfbox-3.0.4.fat.jar /usr/local/basex/lib/custom/
- echo "PWS" $PWD
- ls -l /usr/local/basex/lib/custom
+
- name: run tests
run: |
basex -Wt src/test
diff --git a/.gitea/workflows/trigger/release b/.gitea/workflows/trigger/release
index d573dfe..7077172 100644
--- a/.gitea/workflows/trigger/release
+++ b/.gitea/workflows/trigger/release
@@ -1,2 +1,2 @@
30/1/2025.................
-..lgnfjfggfgxhcsxwnndc
\ No newline at end of file
+..lgnfjfggfgxhcsxwnndcc
\ No newline at end of file
diff --git a/scripts/build.xqm b/scripts/build.xqm
index 520cc2e..a67db18 100644
--- a/scripts/build.xqm
+++ b/scripts/build.xqm
@@ -26,7 +26,7 @@ return
@remark
:)
declare function build:fatjar-with-lib($input-dir as xs:string,$manifest-jar as xs:string)
- {
+ as xs:base64Binary{
let $bin :=file:read-binary($input-dir || $manifest-jar)
let $lib:=file:list($input-dir || "lib/", false(), "*.jar")!concat("lib/",.)
@@ -55,6 +55,32 @@ as xs:base64Binary{
archive:update($jar,$name,$file)
};
+declare function build:xar-create($base as xs:string)
+as xs:base64Binary{
+ let $entries:=
+ build:xar-add(map{},file:resolve-path("jars/",$base),"content/")
+ =>build:xar-add(file:resolve-path("src/Pdfbox3.xqm",$base),"content/")
+ =>build:xar-add(file:resolve-path("src/metadata/",$base),"")
+ return archive:create($entries?name, $entries?content,
+ map { "format" : "zip", "algorithm" : "deflate" })
+};
+
+(:~ zip data for $dir
+:)
+declare function build:xar-add($map as map(*),$src as xs:string,$xar-dir as xs:string)
+as map(*){
+let $_:=trace(count($map?name),"size ")
+let $names:=if(file:is-dir($src))
+ then file:children($src)
+ else $src
+return map:merge((
+ $map,
+ map{"name":$names!concat($xar-dir,file:name(.)),
+ "content":$names!file:read-binary( .)}
+ ),
+ map{"duplicates":"combine"}
+ )
+};
(:~ download $files from $urls to $destdir:)
declare variable $build:REPO as xs:string external :="https://repo1.maven.org/maven2/";
@@ -68,7 +94,7 @@ as empty-sequence(){
=>trace("Download: ")))
};
-(:~ write-binary but create dir if required :)
+(:~ write-binary, creating dir if required :)
declare function build:write-binary($dest as xs:string,$contents)
as empty-sequence(){
file:create-dir(file:parent($dest)),
diff --git a/scripts/install.bxs b/scripts/install.bxs
index 015241c..16551bc 100644
--- a/scripts/install.bxs
+++ b/scripts/install.bxs
@@ -1,9 +1,8 @@
# run query
XQUERY "make fat jar.."
-RUN make-fat-jar.xq
+RUN make-xar.xq
XQUERY "Repo install.."
-REPO INSTALL dist/pdfbox-3.0.4.fat.jar
+REPO INSTALL dist/pdfbox.xar
REPO LIST
-XQUERY "add-to-custom.."
-RUN add-to-custom.xq
-#TEST src/test
+
+
diff --git a/scripts/make-xar.xq b/scripts/make-xar.xq
new file mode 100644
index 0000000..57c1908
--- /dev/null
+++ b/scripts/make-xar.xq
@@ -0,0 +1,8 @@
+
+import module namespace build = 'urn:quodatum:build1' at 'build.xqm';
+
+declare variable $base:= file:resolve-path("../",static-base-uri())=>trace("base ");
+let $xar:=build:xar-create($base)
+let $output-file := file:resolve-path("dist/pdfbox.xar",$base)
+return (build:write-binary($output-file, $xar),
+ trace($output-file,"zar: "))
diff --git a/src/metadata/basex.xml b/src/metadata/basex.xml
new file mode 100644
index 0000000..f4f884f
--- /dev/null
+++ b/src/metadata/basex.xml
@@ -0,0 +1,7 @@
+
+ pdfbox-3.0.4.jar
+ pdfbox-io-3.0.4.jar
+ fontbox-3.0.4.jar
+ commons-logging-1.3.4.jar
+ org.apache.pdfbox.pdmodel.PDDocument
+
\ No newline at end of file
diff --git a/src/metadata/expath-pkg.xml b/src/metadata/expath-pkg.xml
new file mode 100644
index 0000000..0b18387
--- /dev/null
+++ b/src/metadata/expath-pkg.xml
@@ -0,0 +1,13 @@
+
+
+ BaseX interface to Pdfbox (https://pdfbox.apache.org/) version 3
+
+
+ org.expkg_zone58.Pdfbox3
+ Pdfbox3.xqm
+
+