removes the PaintIt package (now its own project) check point before refactorying...
authorThomas Walker Lynch <xtujpz@reasoningtechnology.com>
Fri, 11 Oct 2024 07:31:16 +0000 (07:31 +0000)
committerThomas Walker Lynch <xtujpz@reasoningtechnology.com>
Fri, 11 Oct 2024 07:31:16 +0000 (07:31 +0000)
26 files changed:
developer/javac/Black.java [deleted file]
developer/javac/Blue.java [deleted file]
developer/javac/Graph.java
developer/javac/Green.java [deleted file]
developer/javac/Label.java
developer/javac/Token.java
developer/shell/black [deleted file]
developer/shell/blue [deleted file]
developer/shell/green [deleted file]
developer/tool/#make_PaintIt# [deleted file]
developer/tool/clean [new file with mode: 0755]
developer/tool/clean_all [new file with mode: 0755]
developer/tool/clean_dist [new file with mode: 0755]
developer/tool/env [new file with mode: 0644]
developer/tool/env_build [deleted file]
developer/tool/make
developer/tool/make_PaintIt [deleted file]
developer/tool/release
developer/tool/version [deleted file]
release_candidate/black [new file with mode: 0755]
release_candidate/blue [new file with mode: 0755]
release_candidate/green [new file with mode: 0755]
tool/env_administrator
tool/env_base
tool/env_developer
tool/env_tester

diff --git a/developer/javac/Black.java b/developer/javac/Black.java
deleted file mode 100644 (file)
index d669ac3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.ReasoningTechnology.PaintIt;
-
-public class Black {
-  public static void main(String[] args) {
-    System.out.println("Paint it black.");
-  }
-}
diff --git a/developer/javac/Blue.java b/developer/javac/Blue.java
deleted file mode 100644 (file)
index c6c7a0a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.ReasoningTechnology.PaintIt;
-
-public class Blue {
-  public static void print(){
-    System.out.println("Paint it blue.");
-  }
-  public static void main(String[] args) {
-    print();
-  }
-}
index 573c3e8..3052338 100644 (file)
@@ -1,3 +1,5 @@
+package Ariadne;
+
 import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
diff --git a/developer/javac/Green.java b/developer/javac/Green.java
deleted file mode 100644 (file)
index cf16a88..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.ReasoningTechnology.PaintIt;
-
-public class Green extends Blue  {
-  public static void print(){
-    System.out.println("Paint it green.");
-  }
-}
index ce54096..7802cf8 100644 (file)
@@ -1,3 +1,5 @@
+package Ariadne;
+
 /*
 A node label.
 
index ff19528..1d1c36f 100644 (file)
@@ -1,3 +1,5 @@
+package Ariadne;
+
 /*
 An error token.
 
diff --git a/developer/shell/black b/developer/shell/black
deleted file mode 100755 (executable)
index d94d9cb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Black
diff --git a/developer/shell/blue b/developer/shell/blue
deleted file mode 100755 (executable)
index 387f82a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Blue
diff --git a/developer/shell/green b/developer/shell/green
deleted file mode 100755 (executable)
index 9611a51..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Green
diff --git a/developer/tool/#make_PaintIt# b/developer/tool/#make_PaintIt#
deleted file mode 100755 (executable)
index dbd9959..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/env bash
-
-if [ -z "$ENV_DEV" ]; then
-  echo "make_PaintIt:: script can only be run from the developer environment"
-  return 1
-fi
-
-# Ensure we are in the right directory
-cd "$REPO_HOME"/developer
-
-# Start with a fresh scratch_pad and remove a prior jvm
-# Depending, this is unnecessary and might even be undesirable.
-# Better to clean up the stuff we will rewrite instead of everything.
-# But for testing and in an unstable environment, this is probably best.
-echo "Starting with a clean scratch_pad and jvm directories..."
-rm -rf scratch_pad/*
-rm -rf jvm/PaintIt.jar
-
-# Compile all files (Black.java and Blue.java) with the correct package
-echo "Compiling files..."
-javac -d scratch_pad javac/Black.java javac/Blue.java javac/Green.java
-
-if [ $? -ne 0 ]; then
-  echo "Compilation failed."
-  exit 1
-fi
-
-# Create a JAR file from the compiled class files with correct package structure
-echo "Creating JAR file..."
-mkdir -p jvm
-jar cf jvm/PaintIt.jar -C scratch_pad .
-
-if [ $? -eq 0 ]; then
-  echo "JAR file created successfully: jvm/PaintIt.jar"
-else
-  echo "Failed to create JAR file."
-  exit 1
-fi
-
-# cleanup the scratch_pad
-# Depending, this is unnecessary and might even be undesirable.
-# Would be better to clean up the stuff we wrote instead of everything.
-# But for testing and in an unstable environment, this is probably best.
-echo "Starting with a clean scratch_pad and jvm directories..."
-rm -rf scratch_pad/*
-
-# Create shell wrappers in developer/shell for easy execution
-echo "Creating shell wrappers..."
-mkdir -p shell
-
-cat > shell/black << EOL
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Black
-EOL
-chmod +x shell/black
-
-cat > shell/blue << EOL
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Blue
-EOL
-chmod +x shell/blue
-
-cat > shell/green << EOL
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Green
-EOL
-chmod +x shell/green
-
-echo "Shell wrappers created successfully: black, blue, green"
-
diff --git a/developer/tool/clean b/developer/tool/clean
new file mode 100755 (executable)
index 0000000..f061336
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Ensure REPO_HOME and ENV_DEV_BUILD are set
+if [ -z "$REPO_HOME" ]; then
+  echo "release:: REPO_HOME is not set."
+  exit 1
+fi
+
+if [ -z "$ENV_DEV_BUILD" ]; then
+  echo "release:: ENV_DEV_BUILD is not set."
+  exit 1
+fi
+
+set -x
+cd "$REPO_HOME"/developer
+rm -rf scratch_pad/*
+set +x
+
+echo "clean complete."
diff --git a/developer/tool/clean_all b/developer/tool/clean_all
new file mode 100755 (executable)
index 0000000..79fbc8f
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Ensure REPO_HOME and ENV_DEV_BUILD are set
+if [ -z "$REPO_HOME" ]; then
+  echo "release:: REPO_HOME is not set."
+  exit 1
+fi
+
+if [ -z "$ENV_DEV_BUILD" ]; then
+  echo "release:: ENV_DEV_BUILD is not set."
+  exit 1
+fi
+
+wrapper=build
+
+set -x
+cd "$REPO_HOME"/developer
+rm -rf scratch_pad/*
+rm -f jvm/Ariadne.jar
+rm -f shell/{$wrapper}
+set +x
+
+echo "clean_all complete."
diff --git a/developer/tool/clean_dist b/developer/tool/clean_dist
new file mode 100755 (executable)
index 0000000..91c23c3
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Ensure REPO_HOME and ENV_DEV_BUILD are set
+if [ -z "$REPO_HOME" ]; then
+  echo "release:: REPO_HOME is not set."
+  exit 1
+fi
+
+if [ -z "$ENV_DEV_BUILD" ]; then
+  echo "release:: ENV_DEV_BUILD is not set."
+  exit 1
+fi
+
+# Define release directory
+release_dir="$REPO_HOME"/release_candidate
+wrapper=build
+
+set -x
+cd "$REPO_HOME"/developer
+rm -rf scratch_pad/*
+rm -f jvm/Ariadne.jar
+rm -f shell/"$wrapper"
+rm -f "$release_dir"/Ariadne.jar
+rm -f "$release_dir"/{$wrapper}
+set +x
+
+echo "clean_dist complete."
diff --git a/developer/tool/env b/developer/tool/env
new file mode 100644 (file)
index 0000000..cf656f3
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+
+echo "REOP_HOME/developer/tool/env"
+
+# The build environment. 
+#
+env_error=false
+if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
+  echo "env_build:: This script must be sourced, not executed."
+  env_error=true
+fi
+if [ -z "$ENV_DEVELOPER" ]; then
+  echo "env_build:: script can only be run from the developer environment"
+  env_error=true
+fi
+if [ "$env_error" = true ]; then
+  exit 1
+fi
+
+# goovy use has been deprecated
+# export GROOVY_HOME="$REPO_HOME/tool_shared/third_party/groovy-4.0.9"
+
+# third party tools we will use
+export JAVA_HOME="$REPO_HOME/tool_shared/third_party/jdk-11"
+export PATH=\
+"$JAVA_HOME"/bin\
+:"$PATH"
+
+# where the tool build finds its class files:
+export CLASSPATH=\
+"$REPO_HOME"/developer/jvm\
+:"$REPO_HOME"/developer/jvm/Ariadne.jar\
+:"$JAVA_HOME"/lib\
+:"$CLASSPATH"
+
+# after we building the tool we might want to run it
+# the shell directory holds the bash UI wrappers
+export PATH=\
+"$REPO_HOME"/developer/shell\
+:"$PATH"
+
+export ENV_DEV_BUILD=true
+echo "${BASH_SOURCE[0]}" "complete"
+
+
+
+
diff --git a/developer/tool/env_build b/developer/tool/env_build
deleted file mode 100644 (file)
index 2f35259..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env bash
-
-# The build environment. 
-#
-env_error=false
-if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
-  echo "env_build:: This script must be sourced, not executed."
-  env_error=true
-fi
-if [ -z "$ENV_DEV" ]; then
-  echo "env_build:: script can only be run from the developer environment"
-  env_error=true
-fi
-if [ "$env_error" = true ]; then
-  return 1
-fi
-
-# goovy use has been deprecated
-# export GROOVY_HOME="$REPO_HOME/tool_shared/third_party/groovy-4.0.9"
-
-# third party tools we will use
-export JAVA_HOME="$REPO_HOME/tool_shared/third_party/jdk-11"
-export PATH=\
-"$JAVA_HOME"/bin\
-:"$PATH"
-
-# where the tool build finds its class files:
-export CLASSPATH=\
-"$REPO_HOME"/developer/jvm\
-:"$REPO_HOME"/developer/jvm/PaintIt.jar\
-:"$REPO_HOME"/developer/jvm/Ariadne.jar\
-:"$JAVA_HOME"/lib\
-:"$CLASSPATH"
-
-# after we building the tool we might want to run it
-# the shell directory holds the bash UI wrappers
-export PATH=\
-"$REPO_HOME"/developer/shell\
-:"$PATH"
-
-export ENV_DEV_BUILD=true
-echo "${BASH_SOURCE[0]}" "complete"
index b87d6c3..4040acb 100755 (executable)
@@ -1,35 +1,45 @@
 #!/bin/env bash
 
-if [ -z "$ENV_DEV" ]; then
-  echo "make.sh:: script can only be run from the developer environment"
+if [ -z "$ENV_DEVELOPER" ]; then
+  echo "make_PaintIt:: script can only be run from the developer environment"
   return 1
 fi
 
-# Ensure we are in the right directory
+# work from the developer directory
 cd "$REPO_HOME"/developer
 
-# Clean the scratch_pad and jvm directories
-echo "Cleaning scratch_pad and jvm directories..."
-rm -rf scratch_pad/*
-rm -rf jvm/*
-
-# Compile all files
 echo "Compiling files..."
-javac -sourcepath javac:java_namespace -d scratch_pad javac/Black.java
+javac -d scratch_pad javac/*.java
 
 if [ $? -ne 0 ]; then
   echo "Compilation failed."
   exit 1
 fi
 
-# Create a JAR file from the compiled class files
 echo "Creating JAR file..."
+jar_file=jvm/Ariadne.jar
 mkdir -p jvm
-jar cf jvm/Ariadne.jar -C scratch_pad .
+jar cf $jar_file -C scratch_pad .
 
 if [ $? -eq 0 ]; then
-  echo "JAR file created successfully: jvm/Ariadne.jar"
+  echo "JAR file created successfully: $jar_file"
 else
   echo "Failed to create JAR file."
   exit 1
 fi
+
+# for these to run, the jar file must be in the CLASSPATH
+echo "Creating shell wrappers..."
+mkdir -p shell
+
+wrapper=build
+for file in $wrapper;do
+  cat > shell/$file << EOL
+  #!/bin/bash
+  java com/ReasoningTechnology/Ariadne/$file
+  EOL
+  chmod +x shell/$file
+done
+
+echo "make done"
+
diff --git a/developer/tool/make_PaintIt b/developer/tool/make_PaintIt
deleted file mode 100755 (executable)
index 177dd1c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/env bash
-
-if [ -z "$ENV_DEV" ]; then
-  echo "make_PaintIt:: script can only be run from the developer environment"
-  return 1
-fi
-
-# Ensure we are in the right directory
-cd "$REPO_HOME"/developer
-
-# Start with a fresh scratch_pad and remove a prior jvm
-# Depending, this is unnecessary and might even be undesirable.
-# Better to clean up the stuff we will rewrite instead of everything.
-# But for testing and in an unstable environment, this is probably best.
-echo "Starting with a clean scratch_pad and jvm directories..."
-rm -rf scratch_pad/*
-rm -rf jvm/PaintIt.jar
-
-# Compile all files (Black.java and Blue.java) with the correct package
-echo "Compiling files..."
-javac -d scratch_pad javac/Black.java javac/Blue.java javac/Green.java
-
-if [ $? -ne 0 ]; then
-  echo "Compilation failed."
-  exit 1
-fi
-
-# Create a JAR file from the compiled class files with correct package structure
-echo "Creating JAR file..."
-mkdir -p jvm
-jar cf jvm/PaintIt.jar -C scratch_pad .
-
-if [ $? -eq 0 ]; then
-  echo "JAR file created successfully: jvm/PaintIt.jar"
-else
-  echo "Failed to create JAR file."
-  exit 1
-fi
-
-# cleanup the scratch_pad
-# Depending, this is unnecessary and might even be undesirable.
-# Would be better to clean up the stuff we wrote instead of everything.
-# But for testing and in an unstable environment, this is probably best.
-echo "Starting with a clean scratch_pad and jvm directories..."
-rm -rf scratch_pad/*
-
-# Create shell wrappers in developer/shell for easy execution
-echo "Creating shell wrappers..."
-mkdir -p shell
-
-cat > shell/black << EOL
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Black
-EOL
-chmod +x shell/black
-
-cat > shell/blue << EOL
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Blue
-EOL
-chmod +x shell/blue
-
-cat > shell/green << EOL
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Green
-EOL
-chmod +x shell/green
-
-
-echo "Shell wrappers created successfully: black, blue, green"
-
index aabc46a..1edfafd 100755 (executable)
@@ -1,55 +1,57 @@
-#!/usr/bin/env groovy
-
-// Access the environment variable REPO_HOME
-def repo_home = System.getenv('REPO_HOME')
-def env_dev_build = System.getenv('ENV_DEV_BUILD')
-def arg_error = false
-if (!repo_home) {
-    println "release:: REPO_HOME is not set."
-    arg_error = true
+#!/bin/bash
+
+# Ensure REPO_HOME and ENV_DEV_BUILD are set
+if [ -z "$REPO_HOME" ]; then
+  echo "release:: REPO_HOME is not set."
+  exit 1
+fi
+
+if [ -z "$ENV_DEV_BUILD" ]; then
+  echo "release:: ENV_DEV_BUILD is not set."
+  exit 1
+fi
+
+# Define release directory
+release_dir="$REPO_HOME/release_candidate"
+
+# Create release directory if it doesn't exist
+if [ ! -d "$release_dir" ]; then
+  mkdir -p "$release_dir"
+fi
+
+# Function to copy and set permissions
+install_file() {
+  source_fp="$1"
+  target_dp="$2"
+  perms="$3"
+  
+  target_file="$target_dp/$(basename "$source_fp")"
+
+  if [ ! -f "$source_fp" ]; then
+    echo "install_file:: Source file '$source_fp' does not exist."
+    return 1
+  fi
+
+  if ! install -m "$perms" "$source_fp" "$target_file"; then
+    echo "Error: Failed to install $(basename "$source_fp") to $target_dp"
+    exit 1
+  else
+    echo "Installed $(basename "$source_fp") to $target_dp with permissions $perms"
+  fi
 }
-if (!env_dev_build) {
-    println "release:: ENV_DEV_BUILD is not set."
-    arg_error = true
-}
-if (arg_error) {
-    System.exit(1)
-}
-
-def release_dir = "${repo_home}/release_candidate"
-def release_dir_file = new File(release_dir)
-if (!release_dir_file.exists()) {
-    release_dir_file.mkdirs()
-}
-
-// Function to use 'install' command for copying and setting permissions
-def install_file(source_fp, target_dp, perms) {
-    def target_file = "${target_dp}/${new File(source_fp).name}"
-    try {
-        def cmd = ["install", "-m", perms, source_fp, target_file]
-        def process = cmd.execute()
-        process.waitFor()
-        if (process.exitValue() != 0) {
-            println "Error: Failed to install ${new File(source_fp).name} to ${target_dp}"
-            println process.err.text
-            System.exit(1)
-        }
-        println "Installed ${new File(source_fp).name} to ${target_dp} with permissions ${perms}"
-    } catch (Exception e) {
-        println "Error: ${e.message}"
-        System.exit(1)
-    }
-}
-
-println "Starting release process..."
+echo "Starting release process..."
 
-def build_fp = "${repo_home}/developer/shell/build"
-def ariadne_jar_fp = "${repo_home}/developer/jvm/AriadneGraph.jar"
+# Paths to shell wrappers and JAR file
+shell_dir="$REPO_HOME/developer/shell"
+Ariadne_jar_fp="$REPO_HOME/developer/jvm/Ariadne.jar"
 
-// Install the build script
-install_file(build_fp, release_dir, "ug+r")
+# Install the JAR file
+install_file "$Ariadne_jar_fp" "$release_dir" "ug+r"
 
-// Install the JAR file
-install_file(ariadne_jar_fp, release_dir, "ug+r")
+# Install shell wrappers
+for wrapper in black blue green; do
+  install_file "$shell_dir/$wrapper" "$release_dir" "ug+r+x"
+done
 
-println "Release process completed successfully."
+echo "Release process completed successfully."
diff --git a/developer/tool/version b/developer/tool/version
deleted file mode 100755 (executable)
index 12f7625..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/env bash
-
-# get this from the project management level exector directory
-"$REPO_HOME"/executor/version
\ No newline at end of file
diff --git a/release_candidate/black b/release_candidate/black
new file mode 100755 (executable)
index 0000000..d94d9cb
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+java com/ReasoningTechnology/PaintIt/Black
diff --git a/release_candidate/blue b/release_candidate/blue
new file mode 100755 (executable)
index 0000000..387f82a
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+java com/ReasoningTechnology/PaintIt/Blue
diff --git a/release_candidate/green b/release_candidate/green
new file mode 100755 (executable)
index 0000000..9611a51
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+java com/ReasoningTechnology/PaintIt/Green
index 84ec125..b85bd37 100644 (file)
@@ -13,7 +13,7 @@ fi
 
 ENV_PM=true
 
-PROJECT="$PROJECT"_PMg
+PROJECT="$PROJECT"_administrator
 
 export PATH=\
 "$REPO_HOME"/tool\
index d150193..ff49183 100644 (file)
@@ -10,7 +10,7 @@ fi
 # 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 REPO_HOME="${script_path%/*}/"
 export PROJECT=$(basename "$REPO_HOME")
 
 PPS1="\n[$PROJECT]\n\u@\h§$(pwd)§\n> "
index 7132218..b1c5ffa 100644 (file)
@@ -11,19 +11,20 @@ if [ -z "$ENV_BASE" ]; then
   source "${script_path}/env_base"
 fi
 
-PROJECT="$PROJECT"_DEVELOPER
+PROJECT="$PROJECT"_developer
 
 export PATH=\
-"$REPO_HOME/developer/tool"\
+"$REPO_HOME"/developer/tool/\
+:"$REPO_HOME"/tool_shared/bespoke/\
 :"$PATH"
 
 # so the .gitignore files can be seen:
 alias ls="ls -a"
 
-cd "$REPO_HOME/developer"
+cd "$REPO_HOME"/developer/
+export ENV_DEVELOPER=true
+source tool/env
 
-export ENV_DEV=true
-source "$REPO_HOME"/developer/tool/env_build
 echo "${BASH_SOURCE[0]}" "complete"
 
 
index 51b8e51..7a52fe9 100644 (file)
@@ -15,12 +15,12 @@ fi
 PROJECT="$PROJECT"_TESTER
 
 export PATH=\
-"$REPO_HOME"/tester/executor\
+"$REPO_HOME"/tester/executor/\
+:"$REPO_HOME"/tool_shared/bespoke/\
 :"$PATH"
 
-cd "$REPO_HOME"/tester
-
-
+cd "$REPO_HOME"/tester/
 export ENV_TESTER=true
-source executor/env_tester
+source tool/env
+
 echo "${BASH_SOURCE[0]}" "complete"