template revision
authorThomas Walker Lynch <xtujpz@reasoningtechnology.com>
Mon, 29 Jul 2024 06:46:03 +0000 (06:46 +0000)
committerThomas Walker Lynch <xtujpz@reasoningtechnology.com>
Mon, 29 Jul 2024 06:46:03 +0000 (06:46 +0000)
.gitignore
developer/.gitignore [new file with mode: 0644]
executor/.githolder [deleted file]
executor/install [deleted file]
executor/install.sh [new file with mode: 0644]
executor/keep_empty_dirs
executor/use_env [deleted file]
executor/use_tool [new file with mode: 0644]
hooks/.githolder [deleted file]
lector/directory_structure.md
lector/for_developers.md

index 109116e..de8f7ec 100644 (file)
@@ -1,8 +1,4 @@
-/env/
-library/
-machine_fodder/
 temporary/
 *~
-*.o
 a.out
 
diff --git a/developer/.gitignore b/developer/.gitignore
new file mode 100644 (file)
index 0000000..66efa89
--- /dev/null
@@ -0,0 +1,2 @@
+/linker/
+/machine/
diff --git a/executor/.githolder b/executor/.githolder
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/executor/install b/executor/install
deleted file mode 100644 (file)
index 1f67f41..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-# Set the platform type: currently "Debian" or "Fedora"
-PLATFORM="Fedora"
-
-# Update package list and install Java based on platform type
-if [ "$PLATFORM" == "Debian" ]; then
-    sudo apt-get update
-    sudo apt-get install -y default-jre
-elif [ "$PLATFORM" == "Fedora" ]; then
-    sudo dnf update -y
-    sudo dnf install -y java-1.8.0-openjdk
-else
-    echo "Unsupported platform type: $PLATFORM"
-    exit 1
-fi
-
-# Download ANTLR jar file and place it in the env directory
-mkdir -p env
-curl -o env/antlr-4.9.2-complete.jar https://www.antlr.org/download/antlr-4.9.2-complete.jar
-
-# Set environment variables for ANTLR
-export CLASSPATH=".:$(pwd)/env/antlr-4.9.2-complete.jar:$CLASSPATH"
-export PATH="$PATH:$(pwd)/env"
-
-echo "Installation complete. Java and ANTLR have been installed."
diff --git a/executor/install.sh b/executor/install.sh
new file mode 100644 (file)
index 0000000..588939a
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Set the platform type: currently "Debian" or "Fedora"
+PLATFORM="Fedora"
+
+# Define the version and URL for the JDK
+JDK_VERSION="17.0.2"
+JDK_URL="https://download.oracle.com/java/17/latest/jdk-$JDK_VERSION_linux-x64_bin.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 tool/executor directory if it doesn't exist
+mkdir -p "$project_root/tool/executor"
+
+# Create a symbolic link tool/bin pointing to tool/executor
+ln -sfn "$project_root/tool/executor" "$project_root/tool/bin"
+
+# Download and extract JDK to the tool directory
+curl -L -o "$project_root/tool/jdk-$JDK_VERSION.tar.gz" "$JDK_URL"
+tar -xzf "$project_root/tool/jdk-$JDK_VERSION.tar.gz" -C "$project_root/tool"
+rm "$project_root/tool/jdk-$JDK_VERSION.tar.gz"
+
+# Set JAVA_HOME and update PATH to use the local JDK
+export JAVA_HOME="$project_root/tool/jdk-$JDK_VERSION"
+export PATH="$JAVA_HOME/bin:$PATH"
+
+# Move the JDK binaries to the tool/executor directory
+mv "$JAVA_HOME/bin/"* "$project_root/tool/executor/"
+rm -rf "$JAVA_HOME/bin"
+
+# Download ANTLR jar file and place it in the tool/executor directory
+curl -o "$project_root/tool/executor/antlr-4.9.2-complete.jar" https://www.antlr.org/download/antlr-4.9.2-complete.jar
+
+# Set environment variables for ANTLR
+export CLASSPATH=".:$project_root/tool/executor/antlr-4.9.2-complete.jar:$CLASSPATH"
+export PATH="$PATH:$project_root/tool/executor"
+
+echo "Installation complete. Java and ANTLR have been installed."
index 0a200b3..dca38b5 100644 (file)
@@ -1,2 +1,2 @@
 # git does not keep empty directories
-find .  -type d -exec touch {}/.githolder \;
+find . -type d -empty -exec sh -c 'touch "$0/.githolder"' {} \;
diff --git a/executor/use_env b/executor/use_env
deleted file mode 100644 (file)
index a3b54b6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
-
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-export PROJECT=$(basename "$script_path")
-export PATH="$script_path"/env/bin:$PATH
-
-# Set environment variables for ANTLR
-export CLASSPATH=".:$script_path/env/antlr-4.9.2-complete.jar:$CLASSPATH"
-export PATH="$PATH:$script_path/env"
-
-cd development
diff --git a/executor/use_tool b/executor/use_tool
new file mode 100644 (file)
index 0000000..e4a18c6
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
+project_root="${script_path%/*}"
+export PROJECT=$(basename "$project_root")
+
+# Set PATH to include tool/executor
+export PATH="$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"
diff --git a/hooks/.githolder b/hooks/.githolder
deleted file mode 100644 (file)
index e69de29..0000000
index 126eb12..cf06004 100644 (file)
@@ -54,5 +54,18 @@ It is a stuffy way to say `processed_by` the `reader`.  At the top level directo
 the lector is typically the project manager. In the developer's directory it is
 typically the developer.  In general it is anyone who reads the docs.
 
+# Hidden Files
+
+In my humble opinion that git uses hidden files is unfortunate. In general I
+find hidden files in shared projects to be a bad idea. The approach of using a
+symbolic link to give hidden files visible names creates a maintenance 
+problem. The idea of setting explicit parameters for git can be used to
+address the git hidden files, but it does not expose other hidden files.
+There is also an issue of coordinating with other team members who want
+hidden files. Hence, a general solution that solves all these issues is
+to alias `ls` to `ls -a`, which is done in the initialization file
+for the project.
+
+
 <!--  LocalWords:  lector
  -->
index 25585f5..fae3ad9 100644 (file)
@@ -3,11 +3,15 @@
 The work area for developers is the `developer` directory. All other subdirectories
 and files found at the top level are for project management.
 
-Run `. development_init` in a shell to setup the development environment and to enter the
-`development` directory.
+The best way to setup the environment and to enter the `developer` directory is
+to use the `repo` command found in RT's `resource` project. The `repo` command
+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.
+
+
 
-`development_init` is analogous to `activate` in Python.
 
-See the `resource` project for the `repo` command and additional tools for entering 
-a directory and setting the bash prompt.