-# Use `make variable` to print the value assigned to the variable ISLAND.
-# Spaces in and after non-white characters are part of the value.
-# This includes trailing spaces on the line, and space leading to a comment marker.
-# Note the next line has 4 trailing spaces after 'island':
+# Embedded and trailing spaces are included in the value, there are
+# 4 of each used here. Leading spaces are not included. If there is a comment
+# starting with a hash, the trailing spaces leading up to are included.
+# Use `make variable` to print the value assigned to the variables, including
+# ISLAND.
ISLAND = land island
-ANTLR_JAR = ../tool/executor/antlr-4.9.2-complete.jar
+# JAVA_HOME, CLASSPATH, and ANTLR_JAR variables come from `env_dev`
JAVA_COMP = $(JAVA_HOME)/bin/javac
JAVA_INTERP = $(JAVA_HOME)/bin/java
JAR = $(JAVA_HOME)/bin/jar
#!/usr/bin/env bash
-# Get the project root path by removing 'executor' from the script path
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-project_root="${script_path%/*}"
+# Check if REPO_HOME is set, if not exit with an error
+if [ -z "$REPO_HOME" ]; then
+ echo "REPO_HOME is not set. Please initialize the environment."
+ exit 1
+fi
# Function to handle errors
handle_error() {
}
# Call specific clean scripts
-./clean_Java.sh || { echo "Java cleanup failed."; }
-./clean_ANTLR.sh || { echo "ANTLR cleanup failed."; }
+"$REPO_HOME/executor/clean_Java" || { echo "Java cleanup failed."; }
+"$REPO_HOME/executor/clean_ANTLR" || { echo "ANTLR cleanup failed."; }
# Remove the contents of the tool directory while preserving the directory itself and .gitignore
-find "$project_root/tool" -mindepth 1 -maxdepth 1 -not -name ".gitignore" -not -name "upstream" -not -type l -exec rm -rf {} + || handle_error
-find "$project_root/tool" -maxdepth 1 -type l -exec rm -f {} + || handle_error
+find "$REPO_HOME/tool" -mindepth 1 -maxdepth 1 -not -name ".gitignore" -not -name "upstream" -not -type l -exec rm -rf {} + || handle_error
+find "$REPO_HOME/tool" -maxdepth 1 -type l -exec rm -f {} + || handle_error
-echo 'Tool directory cleanup complete. Run `clean_upstream.sh` to remove cached upstream files.'
+echo "Tool directory cleanup complete."
--- /dev/null
+#!/usr/bin/env bash
+
+# Check if REPO_HOME is set, if not exit with an error
+if [ -z "$REPO_HOME" ]; then
+ echo "REPO_HOME is not set. Please initialize the environment."
+ exit 1
+fi
+
+# Function to handle errors
+handle_error() {
+ echo "Error occurred during ANTLR cleanup. Exiting."
+ exit 1
+}
+
+# Clean the ANTLR directory
+antlr_dir=$(find "$REPO_HOME/tool" -maxdepth 1 -type d -name "antlr4-*" | head -n 1)
+if [ -n "$antlr_dir" ]; then
+ find "$antlr_dir" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
+ find "$antlr_dir" -maxdepth 1 -type l -exec rm -f {} + || handle_error
+else
+ echo "ANTLR directory does not exist."
+fi
+
+echo "ANTLR cleanup complete."
+++ /dev/null
-#!/usr/bin/env bash
-
-# Get the project root path by removing 'executor' from the script path
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-project_root="${script_path%/*}"
-
-# Function to handle errors
-handle_error() {
- echo "Error occurred during ANTLR cleanup. Exiting."
- exit 1
-}
-
-# Clean the ANTLR directory
-antlr_dir="$project_root/tool/upstream/antlr4-*"
-if [ -d "$antlr_dir" ]; then
- find "$antlr_dir" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
- find "$antlr_dir" -maxdepth 1 -type l -exec rm -f {} + || handle_error
-else
- echo "ANTLR directory does not exist."
-fi
-
-echo "ANTLR cleanup complete."
--- /dev/null
+#!/usr/bin/env bash
+
+# Check if REPO_HOME is set, if not exit with an error
+if [ -z "$REPO_HOME" ]; then
+ echo "REPO_HOME is not set. Please initialize the environment."
+ exit 1
+fi
+
+# Function to handle errors
+handle_error() {
+ echo "Error occurred during Java cleanup. Exiting."
+ exit 1
+}
+
+# Clean the JDK directory
+jdk_dir=$(find "$REPO_HOME/tool" -maxdepth 1 -type d -name "jdk-*" | head -n 1)
+if [ -n "$jdk_dir" ]; then
+ find "$jdk_dir" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
+ find "$jdk_dir" -maxdepth 1 -type l -exec rm -f {} + || handle_error
+else
+ echo "JDK directory does not exist."
+fi
+
+echo "Java cleanup complete."
+++ /dev/null
-#!/usr/bin/env bash
-
-# Get the project root path by removing 'executor' from the script path
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-project_root="${script_path%/*}"
-
-# Function to handle errors
-handle_error() {
- echo "Error occurred during Java cleanup. Exiting."
- exit 1
-}
-
-# Clean the JDK directory
-jdk_dir="$project_root/tool/upstream/jdk-*"
-if [ -d "$jdk_dir" ]; then
- find "$jdk_dir" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
- find "$jdk_dir" -maxdepth 1 -type l -exec rm -f {} + || handle_error
-else
- echo "JDK directory does not exist."
-fi
-
-echo "Java cleanup complete."
--- /dev/null
+#!/usr/bin/env bash
+
+# Check if REPO_HOME is set, if not exit with an error
+if [ -z "$REPO_HOME" ]; then
+ echo "REPO_HOME is not set. Please initialize the environment."
+ exit 1
+fi
+
+# Function to handle errors
+handle_error() {
+ echo "Error occurred during upstream cleanup. Exiting."
+ exit 1
+}
+
+# Check if the upstream directory exists
+if [ -d "$REPO_HOME/tool/upstream" ]; then
+ echo "Cleaning up upstream directory..."
+ find "$REPO_HOME/tool/upstream" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
+ find "$REPO_HOME/tool/upstream" -maxdepth 1 -type l -exec rm -f {} + || handle_error
+else
+ echo "Upstream directory does not exist."
+fi
+
+echo "Upstream cleanup complete."
+++ /dev/null
-#!/usr/bin/env bash
-
-# Get the project root path by removing 'executor' from the script path
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-project_root="${script_path%/*}"
-
-# Function to handle errors
-handle_error() {
- echo "Error occurred during upstream cleanup. Exiting."
- exit 1
-}
-
-# Check if the upstream directory exists
-if [ -d "$project_root/tool/upstream" ]; then
- echo "Cleaning up upstream directory..."
- find "$project_root/tool/upstream" -mindepth 1 -maxdepth 1 -not -type l -exec rm -rf {} + || handle_error
- find "$project_root/tool/upstream" -maxdepth 1 -type l -exec rm -f {} + || handle_error
-else
- echo "Upstream directory does not exist."
-fi
-
-echo "Upstream cleanup complete."
--- /dev/null
+#!/usr/bin/env bash
+
+# Ensure the script is sourced
+if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
+ echo "This script must be sourced, not executed. Exiting."
+ return 1
+fi
+
+# These are things set by the `repo` command found in the `resource` project,
+# but if you don't have that, then source this into the environment.
+
+script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
+export REPO_HOME="${script_path%/*}"
+export PROJECT=$(basename "$REPO_HOME")
+
+PPS1="\n[$PROJECT]\n\u@\h§$(pwd)§\n> "
+PPS2=">> "
+
+alias ls="ls -a"
+
+echo REPO_HOME "$REPO_HOME"
+echo PROJECT "$PROJECT"
+echo "${BASH_SOURCE[0]}" "complete"
--- /dev/null
+#!/usr/bin/env bash
+
+# Ensure the script is sourced
+if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
+ echo "This script must be sourced, not executed. Exiting."
+ return 1
+fi
+
+# Check if REPO_HOME is set, if not source env_base
+if [ -z "$REPO_HOME" ]; then
+ script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
+ source "${script_path}/env_base"
+fi
+
+export JAVA_HOME="$REPO_HOME/tool/jdk-22.0.1+8"
+export CLASSPATH=".:$REPO_HOME/tool/executor/antlr-4.11.1-complete.jar:$CLASSPATH"
+export ANTLR_JAR="$REPO_HOME/tool/executor/antlr-4.11.1-complete.jar"
+
+export PATH="$JAVA_HOME/bin:$REPO_HOME/tool/executor:$PATH"
+
+alias ls="ls -a"
+cd "$REPO_HOME/developer"
+
+echo "${BASH_SOURCE[0]}" "complete"
--- /dev/null
+#!/usr/bin/env bash
+
+# Ensure the script is sourced
+if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
+ echo "This script must be sourced, not executed. Exiting."
+ return 1
+fi
+
+# Check if REPO_HOME is set, if not source env_base
+if [ -z "$REPO_HOME" ]; then
+ script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
+ source "${script_path}/env_base"
+fi
+
+PATH="$REPO_HOME/executor:$PATH"
+PROJECT="$PROJECT"_PM
+
+echo "${BASH_SOURCE[0]}" "complete"
--- /dev/null
+#!/usr/bin/env bash
+
+# Check if REPO_HOME is set, if not exit with an error
+if [ -z "$REPO_HOME" ]; then
+ echo "REPO_HOME is not set. Please initialize the environment."
+ exit 1
+fi
+
+# Call install scripts and handle errors
+"$REPO_HOME/executor/install_Java" || { echo "Java installation failed."; }
+"$REPO_HOME/executor/install_ANTLR" || { echo "ANTLR installation failed."; exit 1; }
+
+# Create symbolic link
+ln -sfn "$REPO_HOME/tool/executor" "$REPO_HOME/tool/bin"
+
+echo "All installations complete. Java and ANTLR have been installed successfully."
+++ /dev/null
-#!/usr/bin/env bash
-
-# Call install scripts and handle errors
-./install_Java.sh || { echo "Java installation failed. "; }
-./install_ANTLR.sh || { echo "ANTLR installation failed."; exit 1; }
-
-# Create symbolic link
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-project_root="${script_path%/*}"
-
-ln -sfn "$project_root/tool/executor" "$project_root/tool/bin"
-
-echo "All installations complete. Java and ANTLR have been installed successfully."
--- /dev/null
+#!/usr/bin/env bash
+#
+# GQL_to_Cypher/
+# ├── tool/
+# │ ├── executor/
+# │ │ └── antlr-4.11.1-complete.jar (copied from upstream)
+# │ ├── jdk-22.0.1+8/
+# │ ├── upstream/ (cache of downloaded data)
+# │ │ └── antlr-4.11.1-complete.jar
+# │ └── .gitignore
+# └── ...
+
+
+# Check if REPO_HOME is set, if not exit with an error
+if [ -z "$REPO_HOME" ]; then
+ echo "REPO_HOME is not set. Please initialize the environment."
+ exit 1
+fi
+
+# Define the version and URL for ANTLR, if you change the version be sure to update the URL
+ANTLR_VERSION="4.11.1"
+ANTLR_URL="https://www.antlr.org/download/antlr-4.11.1-complete.jar"
+
+# Create the upstream directory if it doesn't exist
+mkdir -p "$REPO_HOME/tool/upstream"
+mkdir -p "$REPO_HOME/tool/executor"
+
+# Download the ANTLR JAR file to the upstream directory
+antlr_jar="$REPO_HOME/tool/upstream/antlr-$ANTLR_VERSION-complete.jar"
+if [ ! -f "$antlr_jar" ]; then
+ echo "Downloading ANTLR..."
+ curl -L -o "$antlr_jar" "$ANTLR_URL"
+fi
+
+if [ ! -s "$antlr_jar" ]; then
+ echo "ANTLR download failed. Exiting."
+ exit 1
+fi
+
+# Move the ANTLR JAR file to the executor directory
+cp "$antlr_jar" "$REPO_HOME/tool/executor/"
+
+echo "ANTLR installation complete."
+++ /dev/null
-#!/usr/bin/env bash
-
-# Define the version and URL for ANTLR
-ANTLR_VERSION="4.11.1"
-ANTLR_URL="https://github.com/antlr/antlr4/archive/refs/tags/4.11.1.tar.gz"
-
-# Get the project root path by removing 'executor' from the script path
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-project_root="${script_path%/*}"
-
-# Create the upstream directory if it doesn't exist
-mkdir -p "$project_root/tool/upstream"
-
-# Download ANTLR tarball and extract to the upstream directory
-antlr_tar="$project_root/tool/upstream/antlr-$ANTLR_VERSION.tar.gz"
-if [ ! -f "$antlr_tar" ]; then
- echo "Downloading ANTLR..."
- curl -L -o "$antlr_tar" "$ANTLR_URL"
-fi
-
-if [ ! -s "$antlr_tar" ]; then
- echo "ANTLR download failed. Exiting."
- exit 1
-fi
-
-echo "Extracting ANTLR..."
-tar -xzf "$antlr_tar" -C "$project_root/tool/upstream" || { echo "ANTLR extraction failed. Exiting."; exit 1; }
-rm "$antlr_tar"
-
-# Move the ANTLR jar to the executor directory
-antlr_jar="$project_root/tool/upstream/antlr-$ANTLR_VERSION-complete.jar"
-if [ ! -f "$antlr_jar" ]; then
- echo "ANTLR JAR file not found after extraction. Exiting."
- exit 1
-fi
-
-mkdir -p "$project_root/tool/executor"
-mv "$antlr_jar" "$project_root/tool/executor/"
-
-echo "ANTLR installation complete."
--- /dev/null
+#!/usr/bin/env bash
+#
+# GQL_to_Cypher/
+# ├── tool/
+# │ ├── executor/
+# │ │ └── antlr-4.11.1-complete.jar
+# │ ├── jdk-22.0.1+8/
+# │ │ ├── bin/
+# │ │ ├── conf/
+# │ │ ├── include/
+# │ │ ├── jmods/
+# │ │ ├── legal/
+# │ │ ├── lib/
+# │ │ ├── release
+# │ │ └── ...
+# │ ├── upstream/
+# │ │ ├── antlr-4.11.1-complete.jar
+# │ │ └── jdk-22.0.1.tar.gz
+# │ └── .gitignore
+# └── ...
+
+# Check if REPO_HOME is set, if not exit with an error
+if [ -z "$REPO_HOME" ]; then
+ echo "REPO_HOME is not set. Please initialize the environment."
+ exit 1
+fi
+
+# Define the version and URL for the JDK, if you change the version be sure to update the URL
+JDK_VERSION="22.0.1"
+JDK_URL="https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.1%2B8/OpenJDK22U-jdk_x64_linux_hotspot_22.0.1_8.tar.gz"
+
+# Create the upstream directory if it doesn't exist
+mkdir -p "$REPO_HOME/tool/upstream"
+mkdir -p "$REPO_HOME/tool"
+
+# Download the JDK to the upstream directory
+jdk_tar="$REPO_HOME/tool/upstream/jdk-$JDK_VERSION.tar.gz"
+if [ ! -f "$jdk_tar" ]; then
+ echo "Downloading JDK..."
+ curl -L -o "$jdk_tar" "$JDK_URL"
+fi
+
+if [ ! -s "$jdk_tar" ]; then
+ echo "JDK download failed. Exiting."
+ exit 1
+fi
+
+echo "Extracting JDK..."
+tar -xzf "$jdk_tar" -C "$REPO_HOME/tool" || { echo "JDK extraction failed. Exiting."; exit 1; }
+
+# Find the extracted JDK directory
+jdk_dir=$(find "$REPO_HOME/tool" -maxdepth 1 -type d -name "jdk-*" | head -n 1)
+if [ -z "$jdk_dir" ]; then
+ echo "JDK extraction failed. Exiting."
+ exit 1
+fi
+
+# Set JAVA_HOME and update PATH to use the local JDK
+export JAVA_HOME="$jdk_dir"
+export PATH="$JAVA_HOME/bin:$PATH"
+
+# Test Java installation
+if ! java -version > /dev/null 2>&1; then
+ echo "Java version check failed."
+ exit 1
+fi
+
+echo "Java installation complete."
+++ /dev/null
-#!/usr/bin/env bash
-
-# Set the platform type: currently "Debian" or "Fedora"
-PLATFORM="Fedora"
-
-# Define the version and URL for the JDK
-JDK_VERSION="22.0.1"
-JDK_URL="https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.1%2B8/OpenJDK22U-jdk_x64_linux_hotspot_22.0.1_8.tar.gz"
-
-# Get the project root path by removing 'executor' from the script path
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-project_root="${script_path%/*}"
-
-# Create the upstream directory if it doesn't exist
-mkdir -p "$project_root/tool/upstream"
-
-# Download and extract JDK to the upstream directory
-jdk_tar="$project_root/tool/upstream/jdk-$JDK_VERSION.tar.gz"
-if [ ! -f "$jdk_tar" ]; then
- echo "Downloading JDK..."
- curl -L -o "$jdk_tar" "$JDK_URL"
-fi
-
-if [ ! -s "$jdk_tar" ]; then
- echo "JDK download failed. Exiting."
- exit 1
-fi
-
-echo "Extracting JDK..."
-tar -xzf "$jdk_tar" -C "$project_root/tool/upstream" || { echo "JDK extraction failed. Exiting."; exit 1; }
-rm "$jdk_tar"
-
-# Find the extracted JDK directory
-jdk_dir=$(find "$project_root/tool/upstream" -maxdepth 1 -type d -name "jdk-*" | head -n 1)
-if [ -z "$jdk_dir" ]; then
- echo "JDK extraction failed. Exiting."
- exit 1
-fi
-
-# Set JAVA_HOME and update PATH to use the local JDK
-export JAVA_HOME="$jdk_dir"
-export PATH="$JAVA_HOME/bin:$PATH"
-
-# Test Java installation
-if ! java -version > /dev/null 2>&1; then
- echo "Java version check failed."
- exit 1
-fi
-
-echo "Java installation complete."
+++ /dev/null
-#!/usr/bin/env bash
-
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-project_root="${script_path%/*}"
-export PROJECT=$(basename "$project_root")
-
-# Set JAVA_HOME
-export JAVA_HOME="$project_root/tool/jdk-17.0.2+8"
-
-# Set PATH to include tool/executor and JAVA_HOME/bin
-export PATH="$JAVA_HOME/bin:$project_root/tool/executor:$PATH"
-
-# Set environment variables for ANTLR
-export CLASSPATH=".:$project_root/tool/executor/antlr-4.9.2-complete.jar:$CLASSPATH"
-
-alias ls="ls -a"
-cd "$project_root/developer"
-
-echo $0 "complete"
will start a new shell with the proper environment variables setup for the
project, and nothing else.
-A project can also be entered by sourcing `use_tool` by running the command
-`. exector/use_tool` in a shell. `use_tool` is analogous to `activate` in Python.
+A project can also be entered by sourcing `env_dev` by running the command
+`. exector/env_dev` in a shell. `use_tool` is analogous to `activate` in Python.