Rollup for java clustering

This commit is contained in:
2024-08-16 17:07:57 -04:00
parent 38b3f66695
commit d1380f9c3b
6032 changed files with 23267 additions and 924 deletions

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
#
# On rpm, you'll need:
#
# * java-devel
# * javapackages-tools
# * ecj
#
dirs=(bin lib src)
name="weka-clustering.jar"
weka_version="3.8.6"
weka_version_hyphen="3-8-6"
[[ -f $name ]] && mv "$name" "$name.bk"
[[ -d src ]] || (echo "This script requires the input java files in src"; exit)
rm -rf bin
for d in "${dirs[@]}"; do
[[ -d $d ]] || mkdir "$d"
done
# Download and extract weka.jar to the lib dir
wget -qO temp.zip "https://sourceforge.net/projects/weka/files/weka-${weka_version_hyphen%-*}/$weka_version/weka-$weka_version_hyphen.zip/download" &&
unzip -o -j temp.zip weka-$weka_version_hyphen/weka.jar -d lib &&
rm temp.zip
# Build the classes from source java
ecj -17 -classpath lib/weka.jar -d bin src &&
# Add weka classes to the bin
unzip -o lib/weka.jar -d bin &&
# Create the jar file from the classes
jar cf "$name" -C bin .