+++ /dev/null
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that
-entity. For the purposes of this definition, "control" means (i) the power,
-direct or indirect, to cause the direction or management of such entity, whether
-by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of
-the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this
-License, each Contributor hereby grants to You a perpetual, worldwide,
-non-exclusive, no-charge, royalty-free, irrevocable copyright license to
-reproduce, prepare Derivative Works of, publicly display, publicly perform,
-sublicense, and distribute the Work and such Derivative Works in Source or
-Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License,
-each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
-no-charge, royalty-free, irrevocable (except as stated in this section) patent
-license to make, have made, use, offer to sell, sell, import, and otherwise
-transfer the Work, where such license applies only to those patent claims
-licensable by such Contributor that are necessarily infringed by their
-Contribution(s) alone or by combination of their Contribution(s) with the Work
-to which such Contribution(s) was submitted. If You institute patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Work or a Contribution incorporated within the Work
-constitutes direct or contributory patent infringement, then any patent licenses
-granted to You under this License for that Work shall terminate as of the date
-such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or
-Derivative Works thereof in any medium, with or without modifications, and in
-Source or Object form, provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and You must cause any modified files to carry prominent notices
-stating that You changed the files; and You must retain, in the Source form of
-any Derivative Works that You distribute, all copyright, patent, trademark, and
-attribution notices from the Source form of the Work, excluding those notices
-that do not pertain to any part of the Derivative Works; and If the Work
-includes a "NOTICE" text file as part of its distribution, then any Derivative
-Works that You distribute must include a readable copy of the attribution
-notices contained within such NOTICE file, excluding those notices that do not
-pertain to any part of the Derivative Works, in at least one of the following
-places: within a NOTICE text file distributed as part of the Derivative Works;
-within the Source form or documentation, if provided along with the Derivative
-Works; or, within a display generated by the Derivative Works, if and wherever
-such third-party notices normally appear. The contents of the NOTICE file are
-for informational purposes only and do not modify the License. You may add Your
-own attribution notices within Derivative Works that You distribute, alongside
-or as an addendum to the NOTICE text from the Work, provided that such
-additional attribution notices cannot be construed as modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any
-Contribution intentionally submitted for inclusion in the Work by You to the
-Licensor shall be under the terms and conditions of this License, without any
-additional terms or conditions. Notwithstanding the above, nothing herein shall
-supersede or modify the terms of any separate license agreement you may have
-executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names,
-trademarks, service marks, or product names of the Licensor, except as required
-for reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
-writing, Licensor provides the Work (and each Contributor provides its
-Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied, including, without limitation, any warranties
-or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-PARTICULAR PURPOSE. You are solely responsible for determining the
-appropriateness of using or redistributing the Work and assume any risks
-associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in
-tort (including negligence), contract, or otherwise, unless required by
-applicable law (such as deliberate and grossly negligent acts) or agreed to in
-writing, shall any Contributor be liable to You for damages, including any
-direct, indirect, special, incidental, or consequential damages of any character
-arising as a result of this License or out of the use or inability to use the
-Work (including but not limited to damages for loss of goodwill, work stoppage,
-computer failure or malfunction, or any and all other commercial damages or
-losses), even if such Contributor has been advised of the possibility of such
-damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing the Work or
-Derivative Works thereof, You may choose to offer, and charge a fee for,
-acceptance of support, warranty, indemnity, or other liability obligations
-and/or rights consistent with this License. However, in accepting such
-obligations, You may act only on Your own behalf and on Your sole
-responsibility, not on behalf of any other Contributor, and only if You agree to
-indemnify, defend, and hold each Contributor harmless for any liability incurred
-by, or claims asserted against, such Contributor by reason of your accepting any
-such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
--- /dev/null
+document/license.txt
\ No newline at end of file
+++ /dev/null
-Ariadne feared for the life of Theseus, who she had fallen in love with, because
-he was to enter the maze designed by Daedalus. She saved him by giving him
-a ball of string.
-
-Building experimental code for GQL_to_Cypher has proven to be as complex as
-navigating Daedalus's maze. As it turns out, `make` does not
-backward-chain pattern rules. Gradle/Groovy tends to build projects in
-layers.
-
-To use the Ariadne build tool, a developer writes their dependency graph in
-Groovy, utilizing a map and a set of regular expression matching
-functions. Then, to build or clean up the project, the developer invokes
-Ariadne.
-
-Ariadne was originally written in Groovy because it evolved incrementally as
-part of a Gradle script.
-
-
-
--- /dev/null
+document/readme.txt
\ No newline at end of file
+++ /dev/null
-import java.util.List;
-
-public class Build {
-
- // Function to load the graph class dynamically
- public static Class<?> includeAClass(String aClassFp) {
- ClassLoader classLoader = Build.class.getClassLoader();
- String className = aClassFp.replace('/', '.').replace(".class", "");
- try {
- return classLoader.loadClass(className);
- } catch (Exception e) {
- System.out.println("Error loading class '" + className + "': " + e.getMessage());
- return null;
- }
- }
-
- // Build function
- public static void build(String graphDefinitionFp, List<String> rootNodeLabels) {
- // Print summary of what we are doing
- System.out.println("build:: Building targets for graph '" + graphDefinitionFp + ".class'");
- if (rootNodeLabels.isEmpty()) {
- System.out.println("No build targets specified. Please provide root node labels to build.");
- System.exit(0);
- }
- System.out.println("Building targets: " + String.join(", ", rootNodeLabels));
-
- // Load the dependency graph class from arg[1]
- Class<?> graphDefinitionClass = includeAClass(graphDefinitionFp);
- if (graphDefinitionClass != null) {
- System.out.println("build:: loaded " + graphDefinitionFp + ".class");
- } else {
- System.out.println("build:: failed to load " + graphDefinitionFp + ".class");
- System.exit(1);
- }
-
- // Get the node_map and node_f_list from the graph class
- // Assuming these methods are static and return the appropriate types
- // Replace with actual method calls if they are different
- Object nodeMap = null;
- Object nodeFList = null;
- try {
- nodeMap = graphDefinitionClass.getMethod("getNodeMap").invoke(null);
- nodeFList = graphDefinitionClass.getMethod("getNodeFList").invoke(null);
- } catch (Exception e) {
- System.out.println("Error invoking methods on graphDefinitionClass: " + e.getMessage());
- System.exit(1);
- }
- System.out.println("node_map: " + nodeMap);
- System.out.println("node_f_list: " + nodeFList);
-
- // Create an instance of AriadneGraph, and run the build scripts
- // Assuming AriadneGraph has a constructor that takes nodeMap and nodeFList
- // Replace with actual constructor call if it is different
- try {
- Class<?> ariadneGraphClass = Class.forName("AriadneGraph");
- Object graph = ariadneGraphClass.getConstructor(nodeMap.getClass(), nodeFList.getClass()).newInstance(nodeMap, nodeFList);
- ariadneGraphClass.getMethod("runBuildScriptsF", List.class).invoke(graph, rootNodeLabels);
- } catch (Exception e) {
- System.out.println("Error creating or invoking AriadneGraph: " + e.getMessage());
- System.exit(1);
- }
- }
-
- // Entry point when run as a script
- public static void main(String[] args) {
- if (args.length == 0) {
- System.out.println("Usage: ./build <graph_definition.class> [root_node_labels...]");
- System.exit(1);
- }
-
- // Get graph definition file and root node labels
- String graphDefinitionFp = args[0];
- List<String> rootNodeLabels = args.length > 1 ? List.of(args).subList(1, args.length) : List.of();
- build(graphDefinitionFp, rootNodeLabels);
- }
-}
--- /dev/null
+import java.util.List;
+
+public class Build {
+
+ // Function to load the graph class dynamically
+ public static Class<?> includeAClass(String aClassFp) {
+ ClassLoader classLoader = Build.class.getClassLoader();
+ String className = aClassFp.replace('/', '.').replace(".class", "");
+ try {
+ return classLoader.loadClass(className);
+ } catch (Exception e) {
+ System.out.println("Error loading class '" + className + "': " + e.getMessage());
+ return null;
+ }
+ }
+
+ // Build function
+ public static void build(String graphDefinitionFp, List<String> rootNodeLabels) {
+ // Print summary of what we are doing
+ System.out.println("build:: Building targets for graph '" + graphDefinitionFp + ".class'");
+ if (rootNodeLabels.isEmpty()) {
+ System.out.println("No build targets specified. Please provide root node labels to build.");
+ System.exit(0);
+ }
+ System.out.println("Building targets: " + String.join(", ", rootNodeLabels));
+
+ // Load the dependency graph class from arg[1]
+ Class<?> graphDefinitionClass = includeAClass(graphDefinitionFp);
+ if (graphDefinitionClass != null) {
+ System.out.println("build:: loaded " + graphDefinitionFp + ".class");
+ } else {
+ System.out.println("build:: failed to load " + graphDefinitionFp + ".class");
+ System.exit(1);
+ }
+
+ // Get the node_map and node_f_list from the graph class
+ // Assuming these methods are static and return the appropriate types
+ // Replace with actual method calls if they are different
+ Object nodeMap = null;
+ Object nodeFList = null;
+ try {
+ nodeMap = graphDefinitionClass.getMethod("getNodeMap").invoke(null);
+ nodeFList = graphDefinitionClass.getMethod("getNodeFList").invoke(null);
+ } catch (Exception e) {
+ System.out.println("Error invoking methods on graphDefinitionClass: " + e.getMessage());
+ System.exit(1);
+ }
+ System.out.println("node_map: " + nodeMap);
+ System.out.println("node_f_list: " + nodeFList);
+
+ // Create an instance of AriadneGraph, and run the build scripts
+ // Assuming AriadneGraph has a constructor that takes nodeMap and nodeFList
+ // Replace with actual constructor call if it is different
+ try {
+ Class<?> ariadneGraphClass = Class.forName("AriadneGraph");
+ Object graph = ariadneGraphClass.getConstructor(nodeMap.getClass(), nodeFList.getClass()).newInstance(nodeMap, nodeFList);
+ ariadneGraphClass.getMethod("runBuildScriptsF", List.class).invoke(graph, rootNodeLabels);
+ } catch (Exception e) {
+ System.out.println("Error creating or invoking AriadneGraph: " + e.getMessage());
+ System.exit(1);
+ }
+ }
+
+ // Entry point when run as a script
+ public static void main(String[] args) {
+ if (args.length == 0) {
+ System.out.println("Usage: ./build <graph_definition.class> [root_node_labels...]");
+ System.exit(1);
+ }
+
+ // Get graph definition file and root node labels
+ String graphDefinitionFp = args[0];
+ List<String> rootNodeLabels = args.length > 1 ? List.of(args).subList(1, args.length) : List.of();
+ build(graphDefinitionFp, rootNodeLabels);
+ }
+}
-package Ariadne;
+package com.ReasoningTechnology.Ariadne;
import java.io.*;
import java.nio.file.*;
--- /dev/null
+#!/bin/bash
+java com/ReasoningTechnology/Ariadne/build
--- /dev/null
+#!/bin/bash
+
+# Removes all files found in the build directories. It asks no questions as to
+# how or why the files got there. Be especially careful with the 'shell' directory
+# if you added scripts to it for release with the project they will be deleted.
+# consider adding a `shell-leaf` directory instead of adding scripts to `shell`.
+
+# input guards
+ env_must_be="developer/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
+
+# remove files
+ set -x
+ cd "$REPO_HOME"/developer
+ rm -r scratch_pad/*
+ rm jvm/*
+ rm shell/*
+ set +x
+
+echo "$(script_fn) done."
+
+++ /dev/null
-#!/bin/bash
-# remove all files created by make's call to `javac`
-
-script_name=$(basename ${BASH_SOURCE[0]})
-if [ -z "$REPO_HOME" ]; then
- echo "$script_name:: REPO_HOME is not set."
- exit 1
-fi
-if [ -z "$ENV_DEVELOPER_LOCAL" ]; 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 "$script_name done."
--- /dev/null
+#!/bin/bash
+# remove all files created by make's call to `javac`
+
+# input guards
+ env_must_be="developer/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
+
+# remove files
+ set -x
+ cd "$REPO_HOME"/developer
+ rm -r scratch_pad/com/ReasoningTechnology/Ariadne
+ set +x
+
+echo "$(script_fn) done."
#!/bin/bash
# remove all files made by `make`
-script_name=$(basename ${BASH_SOURCE[0]})
-error=false
-if [ -z "$REPO_HOME" ]; then
- echo "$script_name:: REPO_HOME is not set."
- error=true
-fi
-if [ -z "$ENV_DEVELOPER_LOCAL" ]; then
- echo "$script_name:: ENV_DEV_BUILD is not set."
- error=true
-fi
-if [ error ]; then
- exit 1
-fi
+# input guards
-wrapper=build
+ env_must_be="developer/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
-set -x
-cd "$REPO_HOME"/developer
-rm -rf scratch_pad/*
-rm -f jvm/Ariadne.jar
-rm -f shell/{$wrapper}
-set +x
+# wrappers to clean (this list space separated list will grow)
-echo "$script_name done."
+ wrapper=build
+
+# remove files
+
+ set -x
+ cd "$REPO_HOME"/developer
+ rm -r scratch_pad/com/ReasoningTechnology/Ariadne
+ rm jvm/Ariadne.jar
+ rm shell/{$wrapper}
+ set +x
+
+echo "$(script_fn) done."
#!/bin/bash
-# remove file made by `make` and by `release`
+# remove files made by `make` and by `release`
-script_name=$(basename ${BASH_SOURCE[0]})
-error=false
-if [ -z "$REPO_HOME" ]; then
- echo "$script_name:: REPO_HOME is not set."
- error=true
-fi
-if [ -z "$ENV_DEVELOPER_LOCAL" ]; then
- echo "$script_name:: ENV_DEV_BUILD is not set."
- error=true
-fi
-if [ error ]; then
- exit 1
-fi
+# input guards
-# Define release directory
-release_dir="$REPO_HOME"/release_candidate
-wrapper=build
+ env_must_be="developer/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
-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
+# things to clean
+
+ release_dir="$REPO_HOME"/release
+ wrapper=build
+
+# remove files
+ set -x
+ cd "$REPO_HOME"/developer
+ rm -r scratch_pad/com/ReasoningTechnology/Ariadne
+ rm jvm/Ariadne.jar
+ rm shell/{$wrapper}
+ rm -f "$release_dir"/Ariadne.jar
+ rm -f "$release_dir"/{$wrapper}
+ set +x
+
+echo "$(script_fn) done."
-echo "$script_name done."
#!/usr/bin/env bash
-## input guards
+# input guards
-# instead of bailing, we will go fetch what we need
-env_should_be="tool_shared/bespoke/env"
-if [ "$ENV" != "$env_should_be" ]; then
- source "$REPO_HOME"/"$env_should_be"
-fi
+ env_must_be="tool_shared/bespoke/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
-if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
- echo "$script_name:: This script must be sourced, not executed."
- exit 1
-fi
+ if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
+ echo "$script_name:: This script must be sourced, not executed."
+ exit 1
+ fi
-## so we can do the build
-
-cd "$REPO_HOME"/developer/
-
-export ENV=$(script_fp)
-export PROJECT="$PROJECT"_developer
+# so we can do the build
export PATH=\
"$REPO_HOME"/developer/tool/\
:"$REPO_HOME"/tool_shared/bespoke/\
-"$JAVA_HOME"/bin\
+:"$JAVA_HOME"/bin\
:"$PATH"
-## so we can run locally the stuff we built,
+# so we can run the stuff we built locally.
export CLASSPATH=\
"$REPO_HOME"/developer/jvm\
"$REPO_HOME"/developer/shell\
:"$PATH"
-## misc
+# misc
-# make .githolder and .gitignore visible
-alias ls="ls -a"
+ # make .githolder and .gitignore visible
+ alias ls="ls -a"
-echo "$ENV complete."
+# some feedback to show all went well
+ export PROJECT="$PROJECT"_developer
+ export ENV=$(script_fp)
+ echo ENV "$ENV"
+ cd "$REPO_HOME"/developer/
#!/bin/env bash
-script_name=$(basename ${BASH_SOURCE[0]})
-if [ -z "$ENV_DEVELOPER_LOCAL" ]; then
- echo "$script_name:: script can only be run from the developer environment"
- return 1
-fi
+# input guards
-# work from the developer directory
-cd "$REPO_HOME"/developer
+ env_must_be="developer/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
-echo "Compiling files..."
-javac -d scratch_pad javac/*.java
+ cd "$REPO_HOME"/developer
-if [ $? -ne 0 ]; then
- echo "Compilation failed."
- exit 1
-fi
+echo "Compiling files..."
+ set -x
+ javac -d scratch_pad javac/*.java
+ set +x
+ if [ $? -ne 0 ]; then
+ echo "Compilation failed."
+ exit 1
+ fi
echo "Creating JAR file..."
-jar_file=jvm/Ariadne.jar
-mkdir -p jvm
-jar cf $jar_file -C scratch_pad .
-
-if [ $? -eq 0 ]; then
- 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
+ set -x
+ jar_file=jvm/Ariadne.jar
+ mkdir -p jvm
+ jar cf $jar_file -C scratch_pad .
+ set +x
+ if [ $? -eq 0 ]; then
+ echo "JAR file created successfully: $jar_file"
+ else
+ echo "Failed to create JAR file."
+ exit 1
+ fi
-wrapper=build
-for file in $wrapper;do
+echo "Creating shell wrappers..."
+ mkdir -p shell
+ wrapper=build
+ for file in $wrapper;do
-cat > shell/$file << EOL
+ cat > shell/$file << EOL
#!/bin/bash
java com/ReasoningTechnology/Ariadne/$file
EOL
-chmod +x shell/$file
+ chmod +x shell/$file
done
-echo "$script_name done."
+echo "$(script_fp) done."
#!/bin/bash
-script_name=$(basename ${BASH_SOURCE[0]})
-if [ -z "$REPO_HOME" ]; then
- echo "$script_name:: REPO_HOME is not set."
- exit 1
-fi
-
-if [ -z "$ENV_LOCAL_DEVELOPER" ]; then
- echo "$script_name:: ENV_DEV_BUILD is not set."
- exit 1
-fi
-
-release_dir="$REPO_HOME/release"
-shell_dir="$REPO_HOME/developer/shell"
-Ariadne_jar_fp="$REPO_HOME/developer/jvm/Ariadne.jar"
-wrapper=build
-
-
-
-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
+# input guards
+
+ if [ -z "$REPO_HOME" ]; then
+ echo "$(script_fp):: REPO_HOME is not set."
+ exit 1
fi
- if ! install -m "$perms" "$source_fp" "$target_file"; then
- echo "Error: Failed to install $(basename "$source_fp") to $target_dp"
+ env_must_be="developer/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
exit 1
- else
- echo "Installed $(basename "$source_fp") to $target_dp with permissions $perms"
fi
-}
+
+# script local environment
+
+ release_dir="$REPO_HOME/release"
+ shell_dir="$REPO_HOME/developer/shell"
+ Ariadne_jar_fp="$REPO_HOME/developer/jvm/Ariadne.jar"
+ wrapper=build
+
+
+ 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
+ }
-echo "Starting release process..."
+# do the release
+
+ echo "Starting release process..."
-# 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 $wrapper; do
- install_file "$shell_dir/$wrapper" "$release_dir" "ug+r+x"
-done
+ # Install shell wrappers
+ for wrapper in $wrapper; do
+ install_file "$shell_dir/$wrapper" "$release_dir" "ug+r+x"
+ done
-echo "$script_name done."
+echo "$(script_fp) done."
--- /dev/null
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that
+entity. For the purposes of this definition, "control" means (i) the power,
+direct or indirect, to cause the direction or management of such entity, whether
+by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of
+the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+"Object" form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+"submitted" means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this
+License, each Contributor hereby grants to You a perpetual, worldwide,
+non-exclusive, no-charge, royalty-free, irrevocable copyright license to
+reproduce, prepare Derivative Works of, publicly display, publicly perform,
+sublicense, and distribute the Work and such Derivative Works in Source or
+Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License,
+each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
+no-charge, royalty-free, irrevocable (except as stated in this section) patent
+license to make, have made, use, offer to sell, sell, import, and otherwise
+transfer the Work, where such license applies only to those patent claims
+licensable by such Contributor that are necessarily infringed by their
+Contribution(s) alone or by combination of their Contribution(s) with the Work
+to which such Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Work or a Contribution incorporated within the Work
+constitutes direct or contributory patent infringement, then any patent licenses
+granted to You under this License for that Work shall terminate as of the date
+such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or
+Derivative Works thereof in any medium, with or without modifications, and in
+Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of
+this License; and You must cause any modified files to carry prominent notices
+stating that You changed the files; and You must retain, in the Source form of
+any Derivative Works that You distribute, all copyright, patent, trademark, and
+attribution notices from the Source form of the Work, excluding those notices
+that do not pertain to any part of the Derivative Works; and If the Work
+includes a "NOTICE" text file as part of its distribution, then any Derivative
+Works that You distribute must include a readable copy of the attribution
+notices contained within such NOTICE file, excluding those notices that do not
+pertain to any part of the Derivative Works, in at least one of the following
+places: within a NOTICE text file distributed as part of the Derivative Works;
+within the Source form or documentation, if provided along with the Derivative
+Works; or, within a display generated by the Derivative Works, if and wherever
+such third-party notices normally appear. The contents of the NOTICE file are
+for informational purposes only and do not modify the License. You may add Your
+own attribution notices within Derivative Works that You distribute, alongside
+or as an addendum to the NOTICE text from the Work, provided that such
+additional attribution notices cannot be construed as modifying the License.
+You may add Your own copyright statement to Your modifications and may provide
+additional or different license terms and conditions for use, reproduction, or
+distribution of Your modifications, or for any such Derivative Works as a whole,
+provided Your use, reproduction, and distribution of the Work otherwise complies
+with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any
+Contribution intentionally submitted for inclusion in the Work by You to the
+Licensor shall be under the terms and conditions of this License, without any
+additional terms or conditions. Notwithstanding the above, nothing herein shall
+supersede or modify the terms of any separate license agreement you may have
+executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names,
+trademarks, service marks, or product names of the Licensor, except as required
+for reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
+writing, Licensor provides the Work (and each Contributor provides its
+Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied, including, without limitation, any warranties
+or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any risks
+associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in
+tort (including negligence), contract, or otherwise, unless required by
+applicable law (such as deliberate and grossly negligent acts) or agreed to in
+writing, shall any Contributor be liable to You for damages, including any
+direct, indirect, special, incidental, or consequential damages of any character
+arising as a result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill, work stoppage,
+computer failure or malfunction, or any and all other commercial damages or
+losses), even if such Contributor has been advised of the possibility of such
+damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or
+Derivative Works thereof, You may choose to offer, and charge a fee for,
+acceptance of support, warranty, indemnity, or other liability obligations
+and/or rights consistent with this License. However, in accepting such
+obligations, You may act only on Your own behalf and on Your sole
+responsibility, not on behalf of any other Contributor, and only if You agree to
+indemnify, defend, and hold each Contributor harmless for any liability incurred
+by, or claims asserted against, such Contributor by reason of your accepting any
+such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
--- /dev/null
+
+Building a project can be like finding your way out of Daedalus's impossible to
+solve maze. Ariadne hands you a ball of string.
+
+Ariadne is a graph based build tool.
+
+Each graph node represents either a build target or symbolic objective.
+
+Nodes have properties, and among these properties is a block of code that
+presumably either builds the target or accomplishes the symbolic objective.
+
+Edges that link the nodes represent dependencies.
+
+The build tool is given a graph. It traverses down to leaf dependencies then
+follows the string it laid out during the traversal, and works its way back up
+to achieve the root objectives.
+
+The build tool recognizes and skips over cycles and build failures.
+
--- /dev/null
+
+1. extract TestBench as its own project. Perhaps it can replace paintit as the
+project skeleton.
--- /dev/null
+#!/usr/bin/env bash
+
+source tool/env
+
--- /dev/null
+#!/usr/bin/env bash
+
+source tool_shared/bespoke/env
+source developer/tool/env
+
--- /dev/null
+#!/usr/bin/env bash
+
+source tool_shared/bespoke/env
+source tester/tool/env
+
+++ /dev/null
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Black
+++ /dev/null
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Blue
--- /dev/null
+#!/bin/bash
+java com/ReasoningTechnology/Ariadne/build
+++ /dev/null
-#!/bin/bash
-java com/ReasoningTechnology/PaintIt/Green
--- /dev/null
+
+javac/TestBench does not belong here. It should have its own project.
+
+Currently it must be made first using `make_TestBench`. It will be made again,
+redundantly as part of `make` because it is in the javac directory. This does
+not hurt anything.
+
+Later we will use an earlier version of the build tool to build the build tool,
+and cases and `make_TestBench` can be handled more gracefully if it is still
+here.
-Normally I would test individual subroutines/methods, then
-combinations. However, this code was copied over from a Gradle script. So
-instead, the tests are graded in complexity.
+test0 - see if the tool will compile when given an empty graph.
-test0 - tests that the code will compile. The test itself consists
-of an empty graph. This was also the first test to make use of the
-directory structure and work flow.
+test1 - see what happens with a single symbolic node
-test1 - The test graph has a single symbolic node. The question is if
-the build code will run. The build code prints a message, said to
-be the title of the graph.
-
-test2 - The test graph consists of a single node abstraction function
-that builds nodes on the fly given a recognized target input.
+Remaining tests are compiled into javac/TestBenchAriande
+package com.reasoningtechnology.TestBench;
import java.util.Map;
public class TestBench {
- public static void runTest_Map(Map<String, Boolean> test_map){
+ // typically used to gather results before a return
+ public static boolean all(boolean[] conditions){
+ for( boolean condition : conditions ){
+ if( !condition ){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public static void run(Map<String, Boolean> test_map){
int totalTest_Map = test_map.size();
int passedTest_Map = 0;
int failedTest_Map = 0;
--- /dev/null
+package com.ReasoningTechnology.Ariadne.TestBench;
+import com.reasoningtechnology.Ariadna.*;
+import com.reasoningtechnology.TestBench.*;
+import java.util.Map;
+import java.util.HashMap;
+
+public class TestBenchAriadne extends TestBench{
+
+ public static boolean test_File_unpack_file_path_0(){
+ boolean[] conditions = new boolean[5];
+ int i = 0;
+
+ // Test input
+ String test_fp = "/home/user/test.txt";
+
+ // Expected output
+ String expected_dp = "/home/user/";
+ String expected_fn = "test.txt";
+ String expected_fn_base = "test";
+ String expected_fn_ext = "txt";
+
+ // Actual output
+ Map<String, String> result = File.unpack_file_path( test_fp );
+
+ conditions[i++] = result.get("dp").equals( expected_dp );
+ conditions[i++] = result.get("fn").equals( expected_fn );
+ conditions[i++] = result.get("fn_base").equals( expected_fn_base );
+ conditions[i++] = result.get("fn_ext").equals( expected_fn_ext );
+ conditions[i++] = result.size() == 4;
+
+ // Return true if all conditions are met
+ return all( conditions );
+ }
+
+ // Method to run all tests
+ public static void test_Ariadne(){
+ Map<String, Boolean> test_map = new HashMap<>();
+
+ // Adding tests to the map
+ test_map.put( "File_unpack_file_path_0", test_File_unpack_file_path_0() );
+
+ // Run the tests using TestBench
+ TestBench.run( test_map );
+ }
+
+ // Main function to provide a shell interface for running tests
+ public static void main(String[] args){
+ System.out.println("Running Ariadne tests...");
+ test_Ariadne(); // Calls the method to run all tests
+ }
+
+}
+
--- /dev/null
+*
+!/.gitignore
+++ /dev/null
-public class HelloWorld{
- public static void main( String[] args ){
- System.out.println( "Hello, world!" );
- }
-}
+++ /dev/null
-import AriadneGraph
-
-class TestGraph {
-
- static def get_node_map(){
- return [:]
- }
-
- // given label <x>.class returns node to build <x>.class from <x>.java
- static java_to_class( node_label ){
- println("java_to_class::")
-
- def target=AriadneGraph.unpack_file_path(node_label)
- println("java_to_class_f:: given target: ${target}")
-
- // this function recognizes <x>.class files:
- if( !target.fn || target.fn_ext != 'class' ) return [status: 'no_match']
- println("java_to_class_f:: node_label ${node_label} matched")
-
- def class_fp = node_label
- def java_fp = target.dp + target.fn_base + '.java'
-
- return [
- status: 'matched'
- ,label: class_fp
- ,type: 'path'
- ,neighbor: [java_fp] // The corresponding .java file
- ,build: {
- def process="javac ${java_fp}".execute()
- process.waitFor()
- if( process.exitValue() == 0 ){
- return [status: 'success' ,output: class_fp]
- } else {
- return [status: 'failure' ,error: process.err.text]
- }
- }
- ]
- }
- /*
- import java.util.HashMap;
- import java.util.Map;
- import java.io.IOException;
-
- public class AriadneGraph {
-
- public static Map<String, Object> java_to_class(String node_label) {
- System.out.println("java_to_class::");
-
- Map<String, String> target = AriadneGraph.unpack_file_path(node_label);
- System.out.println("java_to_class_f:: given target: " + target);
-
- // This function recognizes <x>.class files
- if (target.get("fn") == null || !target.get("fn_ext").equals("class")) {
- Map<String, Object> noMatch = new HashMap<>();
- noMatch.put("status", "no_match");
- return noMatch;
- }
-
- System.out.println("java_to_class_f:: node_label " + node_label + " matched");
-
- String class_fp = node_label;
- String java_fp = target.get("dp") + target.get("fn_base") + ".java";
-
- // Create the node to return
- Map<String, Object> matchedNode = new HashMap<>();
- matchedNode.put("status", "matched");
- matchedNode.put("label", class_fp);
- matchedNode.put("type", "path");
-
- // List of neighbors
- matchedNode.put("neighbor", List.of(java_fp)); // The corresponding .java file
-
- // Define the build function as a lambda
- matchedNode.put("build", (Runnable) () -> {
- try {
- Process process = Runtime.getRuntime().exec("javac " + java_fp);
- process.waitFor();
-
- if (process.exitValue() == 0) {
- Map<String, Object> result = new HashMap<>();
- result.put("status", "success");
- result.put("output", class_fp);
- return result;
- } else {
- Map<String, Object> result = new HashMap<>();
- result.put("status", "failure");
- result.put("error", new String(process.getErrorStream().readAllBytes()));
- return result;
- }
- } catch (IOException | InterruptedException e) {
- Map<String, Object> result = new HashMap<>();
- result.put("status", "failure");
- result.put("error", e.getMessage());
- return result;
- }
- });
-
- return matchedNode;
- }
-
- public static Map<String, String> unpack_file_path(String node_label) {
- // Stub implementation to mimic the unpack_file_path method
- // This should return a Map containing keys like "fn", "fn_ext", "dp", and "fn_base"
- Map<String, String> filePathMap = new HashMap<>();
- filePathMap.put("fn", "ExampleFile");
- filePathMap.put("fn_ext", "class");
- filePathMap.put("dp", "/path/to/");
- filePathMap.put("fn_base", "ExampleFileBase");
-
- return filePathMap;
- }
-
- public static void main(String[] args) {
- // Example usage
- Map<String, Object> node = java_to_class("ExampleFile.class");
- System.out.println(node);
- }
-}
-*/
- static java_leaf( node_label ){
- println("java_to_leaf::")
-
- def target = AriadneGraph.unpack_file_path( node_label )
- println("java_to_class_f:: given target: ${target}")
-
- // This function recognizes <x>.java files:
- if( !target.fn || target.fn_ext != 'java' ) return [status: 'no_match']
- println("java_to_class_f:: node_label ${node_label} matched")
-
- def java_fp = node_label
-
- return [
- status: 'matched'
- ,label: java_fp
- ,type: 'leaf'
- ,neighbor: [] // Leaf nodes have no dependencies
- ]
- }
-
- // Static method to define the function list
- static def get_node_f_list(){
- return (
- [
- { node_label -> java_to_class(node_label) }
- ,{ node_label -> java_leaf(node_label) }
- ]
- )
- }
-
-}
+++ /dev/null
-
-if [ -z "$ENV_TESTER" ]; then
- echo "env_test0:: script can only be run in the tester environment"
- env_error=true
-fi
-
-export CLASSPATH=\
-"$REPO_HOME"/release_candidate\
-:"$REPO_HOME"/tester/test2\
-:$CLASSPATH
-
+++ /dev/null
-#!/bin/env bash
-
-# smoke test, and yes, there was a lot of smoke
-set -x
-
-source env_test
-echo $CLASSPATH
-build TestGraph HelloWorld.class
-
-echo "test complete"
-
--- /dev/null
+# input guards
+
+ env_must_be="tester/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
+
+# Paths
+BUILD_DIR="$REPO_HOME/tester/scratch_pad"
+JAR_OUTPUT_DIR="$REPO_HOME/tester/jvm"
+
+# Clean the scratch_pad directory
+echo "Cleaning up scratch_pad directory..."
+rm -rf "$BUILD_DIR"/*
+
+# Optionally clean the jar output as well
+echo "Cleaning up jvm directory..."
+rm -f "$JAR_OUTPUT_DIR"/*.jar
+
+echo "$script_name done."
#!/usr/bin/env bash
-## input guards
+# input guards
-# instead of bailing, we will go fetch what we need
-env_should_be="tool_shared/bespoke/env"
-if [ "$ENV" != "$env_should_be" ]; then
- source "$REPO_HOME"/"$env_should_be"
-fi
+ env_must_be="tool_shared/bespoke/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
-if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
- echo "$script_name:: This script must be sourced, not executed."
- exit 1
-fi
+ if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
+ echo "$script_name:: This script must be sourced, not executed."
+ exit 1
+ fi
-cd "$REPO_HOME"/tester/
-
-export ENV=$(script_fp)
-export PROJECT="$PROJECT"_tester
+# so we can do testing
export PATH=\
"$REPO_HOME"/tester/tool/\
:"$REPO_HOME"/tool_shared/bespoke/\
-"$JAVA_HOME"/bin\
+:"$JAVA_HOME"/bin\
:"$PATH"
export CLASSPATH=\
-:"$REPO_HOME"/developer/release/Ariadne.jar\
-:"$JAVA_HOME"/lib\
+"$JAVA_HOME"/lib\
+:"$REPO_HOME"/release/Ariadne.jar\
+:"$REPO_HOME"/tester/jvm/TestBench.jar\
+:"$REPO_HOME"/tester/jvm/AriadneTestBench.jar\
:"$CLASSPATH"
-echo "$ENV complete."
+# misc
+
+ # make .githolder and .gitignore visible
+ alias ls="ls -a"
+
+# some feedback to show all went well
+
+ export PROJECT="$PROJECT"_tester
+ export ENV=$(script_fp)
+ echo ENV "$ENV"
+ cd "$REPO_HOME"/tester/
#!/bin/env bash
-script_name=$(basename ${BASH_SOURCE[0]})
-if [ -z "$ENV_TESTER_LOCAL" ]; then
- echo "make.sh:: script can only be run in the tester environment"
- env_error=true
-fi
+# input guards
+ env_must_be="tester/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
+# the build
+set -x
+ cd $REPO_HOME/tester
-echo "$script_name done."
+ javac -d scratch_pad javac/*.java
+ jar cf jvm/AriadnaTestBench.jar -C scratch_pad .
+
+set +x
+
+echo "$(script_fp) done."
--- /dev/null
+#!/bin/env bash
+
+# input guards
+
+ env_must_be="tester/tool/env"
+ if [ "$ENV" != "$env_must_be" ]; then
+ echo "$(script_fp):: error: must be run in the $env_must_be environment"
+ exit 1
+ fi
+
+# the build
+set -x
+
+ cd $REPO_HOME/tester
+
+ javac -d scratch_pad javac/TestBench.java
+ jar cf jvm/TestBench.jar -C scratch_pad .
+
+set +x
+
+echo "$(script_fp) done."
#!/usr/bin/env bash
# environment shared by entire project
-# Path to this script
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
+# number one task, establish REPO_HOME
+# this is specific to this script being in the .../tools_shared/env directory
+ script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
+ export REPO_HOME="${script_path%/*/*}/"
+ export PROJECT=$(basename "$REPO_HOME")
+ ## set the shell prompt to show the project
+ PPS1="\n[$PROJECT]\n\u@\h§$(pwd)§\n> "
+ PPS2=">> "
-# Path to the repo is two directories up
-export REPO_HOME="${script_path%/*/*}/"
+# some useful functions for environment scripts
-# script name and path relative to the top of the project
-script_fn(){
- echo "$(basename ${BASH_SOURCE[0]})"
-}
-script_fp(){
- echo "$(realpath --relative-to="$REPO_HOME" "$script_path")/$(script_fn)"
-}
-export -f script_fn script_fp
+ ## path to script file
+ script_fp() {
+ eval "
+ local script_dp=\$(dirname \$(realpath \${BASH_SOURCE[1]}))
+ echo \$(realpath --relative-to=\"$REPO_HOME\" \"\$script_dp\")/\$(script_fn)
+ "
+ }
-# REPO_HOME relative file path to this script
-# Calling the function correctly without braces
-export ENV=$(script_fp)
+ ## path to script directory
+ script_dp() {
+ eval "
+ local script_dp=\$(dirname \$(realpath \${BASH_SOURCE[1]}))
+ echo \$(realpath --relative-to=\"$REPO_HOME\" \"\$script_dp\")
+ "
+ }
-# this script must be sourced, sort of like Python activate
-if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
- echo "$ENV must be sourced, not executed. Exiting."
- exit 1
-fi
+ ## an env script will be in workspace/tool/env, so
+ workspace(){
+ eval "echo \$(dirname \$(script_dp))"
+ }
-export PROJECT=$(basename "$REPO_HOME")
+ ## script's filename
+ script_fn() {
+ eval "echo \$(basename \${BASH_SOURCE[1]})"
+ }
+
+ export -f script_fp script_dp script_fn workspace
+
+# note to the programs which environment they are running.
+
+ export ENV=$(script_fp)
+
+# The project administrator setup these tools and environment settings for all
+# on the project to use:
-# Third party tool(s) that the project admin kindly installed.
-# The developer and tester should use these links to find them.
export JAVA_HOME="$REPO_HOME/tool_shared/third_party/jdk-11"
-# set the shell prompt to show the project
-PPS1="\n[$PROJECT]\n\u@\h§$(pwd)§\n> "
-PPS2=">> "
+# some feedback to show all went well
echo ENV "$ENV"
echo REPO_HOME "$REPO_HOME"
echo PROJECT "$PROJECT"
-echo "$ENV completed."
+
+++ /dev/null
-#!/usr/bin/env bash
-
-# Path to this script
-script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
-
-# Path to the repo is two directories up
-export REPO_HOME="${script_path%/*/*}/"
-
-# script name and path relative to the top of the project
-script_fn(){
- echo "$(basename ${BASH_SOURCE[0]})"
-}
-script_fp(){
- echo "$(realpath --relative-to="$REPO_HOME" "$script_path")/$(script_fn)"
-}
-
-# REPO_HOME relative file path to this script
-# Calling the function correctly without braces
-export ENV=$(script_fp)
-
-# Output the values
-echo "Script path: $script_path"
-echo "Repo home: $REPO_HOME"
-echo "ENV: $ENV"
--- /dev/null
+#!/usr/bin/env bash
+# vl 'vertical list'
+
+# Check if the command is provided
+if [ -z "$1" ]; then
+ echo "Usage: vl <command> [args...]"
+ exit 1
+fi
+
+# Capture the command and its arguments
+cmd=$1
+shift
+
+# Run the command with the remaining arguments and replace colons or spaces with newlines
+"$cmd" "$@" | tr ' :' '\n'
+
+exit 0
--- /dev/null
+#!/bin/bash
+# remove all files in the release directory
+set -e
+
+script_name=$(basename ${BASH_SOURCE[0]})
+if [ -z "$REPO_HOME" ]; then
+ echo "$script_name:: REPO_HOME is not set."
+ exit 1
+fi
+
+set -x
+cd "$REPO_HOME"
+rm -rf release/*
+set +x
+
+echo "$script_name done."
+
+++ /dev/null
-#!/bin/bash
-# remove all files in the release directory
-set -e
-
-script_name=$(basename ${BASH_SOURCE[0]})
-if [ -z "$REPO_HOME" ]; then
- echo "$script_name:: REPO_HOME is not set."
- exit 1
-fi
-
-set -x
-cd "$REPO_HOME"
-rm -rf release/*
-set +x
-
-echo "$script_name done."
-