diff --git a/bin/install-clara b/bin/install-clara index 3c89e2dfa4..a5dca84c23 100755 --- a/bin/install-clara +++ b/bin/install-clara @@ -3,8 +3,7 @@ set -e # Default versions: -grapes=2.26 -clara=5.0.2 +clara=main function error() { echo -e "\n$usage\n\n Use option '-h' for more usage guidance.\n\nERROR: $@" @@ -56,24 +55,18 @@ function cleanup() { } function build_clara { - #git clone --branch $clara --depth 1 https://code.jlab.org/hallb/clas12/clara-java - git clone --depth 1 https://code.jlab.org/hallb/clas12/clara-java + git clone --branch $clara --depth 1 https://code.jlab.org/hallb/clas12/clara-java cd clara-java && CLARA_HOME=$1 ./gradlew deploy && cd - } -function build_grapes { - git clone --depth 1 --branch $grapes https://code.jlab.org/hallb/clas12/coatjava/grapes.git - cd grapes && mvn package && cd - -} - trap cleanup EXIT # Configure: debug=0 args=() -usage="Usage: install-clara [-v] [-c COATJAVA] [-f CLARA] [-g GRAPES] PATH" +usage="Usage: install-clara [-v] [-c COATJAVA] [-f CLARA] PATH" info=""" -- The default CLARA / GRAPES versions are $clara / $grapes +- The default CLARA version is $clara - COATJAVA can also be specified as a local installation directory - If the COATJAVA version is not specified, it will try to auto-detect it. - [-v adds verbosity and disables cleanup]""" @@ -84,7 +77,7 @@ do -h|--help) echo -e "\n$usage" && echo -e "$info" && exit 1 ;; -f) clara="$2" && shift && shift ;; -c) coatjava="$2" && shift && shift ;; - -g) grapes="$2" && shift && shift ;; + -g) echo "WARNING: option -g has been removed" >&2 && shift && shift ;; -v) let debug=$debug+1 && shift ;; -*|--*) echo -e "$usage\n\nUnknown option: $1" && exit 1 ;; *) args+=("$1") && shift ;; @@ -138,7 +131,4 @@ mkdir -p clara-cre/plugins/clas12/config cp -Lr $coatjava/etc $coatjava/bin $coatjava/lib* clara-cre/plugins/clas12 # GRAPES: -echo -e "\nRetrieving GRAPES version $grapes ..." -build_grapes $PWD/grapes -mkdir -p clara-cre/plugins/grapes/lib/core/ -cp grapes/target/grapes-*core*.jar clara-cre/plugins/grapes/lib/core/ +cp $coatjava/lib/utils/grapes*.jar clara-cre/plugins/grapes/lib/core/ diff --git a/build-coatjava.sh b/build-coatjava.sh index dea396ae15..a69489b5c1 100755 --- a/build-coatjava.sh +++ b/build-coatjava.sh @@ -386,22 +386,23 @@ fi # - seem to break thread safety of `mvn install`, i.e., we'd need to run `mvn package` first, then `mvn install` # - we just want copy the produced JAR files to a final installation directory, so the following bash code gets the job done without drama install_jars() { - src=$(dirname $1) + src=$1 dest=$2 [ $# -ge 3 ] && filter="$3" || filter='*.jar' - if [ -d $src/target ]; then - for f in $(find $src/target -name $filter); do + if [ -d $src ]; then + for f in $(find $src -name $filter); do mkdir -p $dest cp $f $dest/ done fi } for pom in $(find reconstruction -name pom.xml); do - install_jars $pom $prefix_dir/lib/services + install_jars $(dirname $pom)/target $prefix_dir/lib/services done -install_jars common-tools/djl-runtime/pom.xml $prefix_dir/lib/services -install_jars common-tools/clara-io/pom.xml $prefix_dir/lib/utils 'jclara-*.jar' -install_jars common-tools/coat-libs/pom.xml $prefix_dir/lib/clas 'coat-libs-*.jar' +install_jars common-tools/copycat/target/lib/djl $prefix_dir/lib/services +install_jars common-tools/copycat/target/lib/grapes $prefix_dir/lib/utils +install_jars common-tools/copycat/target/lib/clara $prefix_dir/lib/utils 'jclara-*.jar' +install_jars common-tools/coat-libs/target $prefix_dir/lib/clas 'coat-libs-*.jar' echo "installed coatjava to: $prefix_dir" # install clara diff --git a/common-tools/clara-io/pom.xml b/common-tools/clara-io/pom.xml index c942080a04..8ebd8c9a59 100644 --- a/common-tools/clara-io/pom.xml +++ b/common-tools/clara-io/pom.xml @@ -55,29 +55,4 @@ - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-jclara - package - - copy-dependencies - - - ${project.build.directory}/lib/utils - org.jlab.coda - jclara - jar - - - - - - - diff --git a/common-tools/djl-runtime/pom.xml b/common-tools/copycat/pom.xml similarity index 63% rename from common-tools/djl-runtime/pom.xml rename to common-tools/copycat/pom.xml index 5c6d998062..76b4a5a1d6 100644 --- a/common-tools/djl-runtime/pom.xml +++ b/common-tools/copycat/pom.xml @@ -2,12 +2,9 @@ 4.0.0 - + - djl-runtime + copycat pom @@ -63,6 +60,17 @@ + + + org.jlab.coda + jclara + + + + org.jlab.jnp + grapes + + ai.djl api @@ -103,8 +111,35 @@ copy-dependencies - ${project.build.directory}/lib/services - runtime + ${project.build.directory}/lib/djl + ai.djl,ai.djl.pytorch + runtime + + + + copy-jclara + package + + copy-dependencies + + + ${project.build.directory}/lib/clara + org.jlab.coda + jclara + jar + + + + copy-grapes + package + + copy-dependencies + + + ${project.build.directory}/lib/grapes + org.jlab.jnp + grapes + jar diff --git a/common-tools/pom.xml b/common-tools/pom.xml index 852f74101f..96c4eda547 100644 --- a/common-tools/pom.xml +++ b/common-tools/pom.xml @@ -29,7 +29,7 @@ clara-io clas-tracking clas-decay-tools - djl-runtime + copycat coat-libs diff --git a/pom.xml b/pom.xml index 26f2b9ab3b..d4b91f550b 100644 --- a/pom.xml +++ b/pom.xml @@ -29,6 +29,11 @@ clasweb-clas12maven https://clasweb.jlab.org/.clas12maven + + + code.jlab.org-hallb-grapes + https://code.jlab.org/api/v4/projects/776/packages/maven + @@ -124,6 +129,12 @@ 6.2 + + org.jlab.jnp + grapes + 2.27-SNAPSHOT + + org.jlab.coda jevio