From 8c854b03491784a6df017e988aad19b5b1b81472 Mon Sep 17 00:00:00 2001 From: stijndcl Date: Tue, 6 Feb 2024 14:57:13 +0100 Subject: [PATCH] Create script to compile and move binaries, ignore them --- scripts/build_binaries.sh | 23 +++++++++++++++++++++++ scripts/helper_scripts/.gitignore | 8 ++++++++ 2 files changed, 31 insertions(+) create mode 100755 scripts/build_binaries.sh create mode 100644 scripts/helper_scripts/.gitignore diff --git a/scripts/build_binaries.sh b/scripts/build_binaries.sh new file mode 100755 index 0000000..6905226 --- /dev/null +++ b/scripts/build_binaries.sh @@ -0,0 +1,23 @@ +#! /usr/bin/env bash + +# All references to an external script should be relative to the location of this script. +# See: http://mywiki.wooledge.org/BashFAQ/028 +CURRENT_LOCATION="${BASH_SOURCE%/*}" + +checkdep() { + which $1 > /dev/null 2>&1 || hash $1 > /dev/null 2>&1 || { + echo "Unipept database builder requires ${2:-$1} to be installed." >&2 + exit 1 + } +} + +checkdep cargo "Rust Toolchain" + +# Build binaries and copy them to the /helper_scripts folder +cd $CURRENT_LOCATION/helper_scripts/unipept-database-rs +cargo build --release + +for BINARY in "functional-analysis" "lcas" "taxa-by-chunk" "taxons-lineages" "taxons-uniprots-tables" "write-to-chunk" "xml-parser" +do + cp "./target/release/$BINARY" .. +done diff --git a/scripts/helper_scripts/.gitignore b/scripts/helper_scripts/.gitignore new file mode 100644 index 0000000..dbfeff6 --- /dev/null +++ b/scripts/helper_scripts/.gitignore @@ -0,0 +1,8 @@ +# Ignore the compiled binaries that get moved here +functional-analysis +lcas +taxa-by-chunk +taxons-lineages +taxons-uniprots-tables +write-to-chunk +xml-parser