From 92580145b23e70ecc6e563bd4460e52a26e98813 Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Tue, 15 Oct 2024 15:17:54 +0000 Subject: [PATCH] rearranging for block testing --- LICENSE.txt | 153 +----------------- README.md | 19 --- README.txt | 1 + developer/javac/{Build.java => Build.javax} | 0 developer/javac/File.java | 2 +- developer/shell/build | 2 + developer/tool/clean_build_directories | 24 +++ developer/tool/clean_javac | 19 --- developer/tool/clean_javac_output | 17 ++ developer/tool/clean_make | 40 +++-- developer/tool/clean_release | 49 +++--- developer/tool/env | 43 +++-- developer/tool/make | 65 ++++---- developer/tool/release | 97 +++++------ document/license.txt | 152 +++++++++++++++++ document/readme.txt | 19 +++ document/todo.txt | 3 + env_administrator | 4 + env_developer | 5 + env_tester | 5 + release/Ariadne.jar | Bin 0 -> 2741 bytes release/black | 2 - release/blue | 2 - release/build | 2 + release/green | 2 - tester/{ => deprecated}/.githolder | 0 tester/document/about_TestBench.txt | 10 ++ tester/document/what_the_tests_do.txt | 15 +- tester/javac/TestBench.java | 13 +- tester/javac/TestBenchAriadne.java | 53 ++++++ tester/jvm/.githolder | 0 tester/jvm/AriadnaTestBench.jar | Bin 0 -> 2081 bytes tester/jvm/TestBench.jar | Bin 0 -> 2081 bytes tester/scratch_pad/.gitignore | 2 + tester/test2/HelloWorld.java | 5 - .../TestGraph$_get_node_f_list_closure2.class | Bin 1858 -> 0 bytes .../TestGraph$_get_node_f_list_closure3.class | Bin 1854 -> 0 bytes .../TestGraph$_java_to_class_closure1.class | Bin 3090 -> 0 bytes .../TestGraph$_java_to_class_f_closure1.class | Bin 3098 -> 0 bytes tester/test2/TestGraph.class | Bin 4432 -> 0 bytes tester/test2/TestGraph.groovy | 150 ----------------- tester/test2/env_test | 11 -- tester/test2/test.sh | 11 -- tester/tool/clean | 21 +++ tester/tool/env | 45 +++--- tester/tool/make | 21 ++- tester/tool/make_TestBench | 21 +++ tool_shared/bespoke/env | 69 ++++---- tool_shared/bespoke/temp | 24 --- tool_shared/bespoke/vl | 17 ++ .../bespoke/{wipe_replease => wipe_release} | 0 51 files changed, 606 insertions(+), 609 deletions(-) mode change 100644 => 120000 LICENSE.txt delete mode 100644 README.md create mode 120000 README.txt rename developer/javac/{Build.java => Build.javax} (100%) create mode 100755 developer/shell/build create mode 100755 developer/tool/clean_build_directories delete mode 100755 developer/tool/clean_javac create mode 100755 developer/tool/clean_javac_output create mode 100644 document/license.txt create mode 100644 document/readme.txt create mode 100644 document/todo.txt create mode 100644 env_administrator create mode 100644 env_developer create mode 100644 env_tester create mode 100644 release/Ariadne.jar delete mode 100755 release/black delete mode 100755 release/blue create mode 100755 release/build delete mode 100755 release/green rename tester/{ => deprecated}/.githolder (100%) create mode 100644 tester/document/about_TestBench.txt create mode 100644 tester/javac/TestBenchAriadne.java create mode 100644 tester/jvm/.githolder create mode 100644 tester/jvm/AriadnaTestBench.jar create mode 100644 tester/jvm/TestBench.jar create mode 100644 tester/scratch_pad/.gitignore delete mode 100644 tester/test2/HelloWorld.java delete mode 100644 tester/test2/TestGraph$_get_node_f_list_closure2.class delete mode 100644 tester/test2/TestGraph$_get_node_f_list_closure3.class delete mode 100644 tester/test2/TestGraph$_java_to_class_closure1.class delete mode 100644 tester/test2/TestGraph$_java_to_class_f_closure1.class delete mode 100644 tester/test2/TestGraph.class delete mode 100644 tester/test2/TestGraph.groovy delete mode 100644 tester/test2/env_test delete mode 100755 tester/test2/test.sh create mode 100755 tester/tool/clean create mode 100755 tester/tool/make_TestBench delete mode 100644 tool_shared/bespoke/temp create mode 100755 tool_shared/bespoke/vl rename tool_shared/bespoke/{wipe_replease => wipe_release} (100%) diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index e177f6f..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,152 +0,0 @@ -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 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 120000 index 0000000..98f0753 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1 @@ +document/license.txt \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 991e4ee..0000000 --- a/README.md +++ /dev/null @@ -1,19 +0,0 @@ -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. - - - diff --git a/README.txt b/README.txt new file mode 120000 index 0000000..06fa5f4 --- /dev/null +++ b/README.txt @@ -0,0 +1 @@ +document/readme.txt \ No newline at end of file diff --git a/developer/javac/Build.java b/developer/javac/Build.javax similarity index 100% rename from developer/javac/Build.java rename to developer/javac/Build.javax diff --git a/developer/javac/File.java b/developer/javac/File.java index d3cd0b4..b101ea8 100644 --- a/developer/javac/File.java +++ b/developer/javac/File.java @@ -1,4 +1,4 @@ -package Ariadne; +package com.ReasoningTechnology.Ariadne; import java.io.*; import java.nio.file.*; diff --git a/developer/shell/build b/developer/shell/build new file mode 100755 index 0000000..f4d3bbc --- /dev/null +++ b/developer/shell/build @@ -0,0 +1,2 @@ +#!/bin/bash +java com/ReasoningTechnology/Ariadne/build diff --git a/developer/tool/clean_build_directories b/developer/tool/clean_build_directories new file mode 100755 index 0000000..ed9e807 --- /dev/null +++ b/developer/tool/clean_build_directories @@ -0,0 +1,24 @@ +#!/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." + diff --git a/developer/tool/clean_javac b/developer/tool/clean_javac deleted file mode 100755 index 58109d4..0000000 --- a/developer/tool/clean_javac +++ /dev/null @@ -1,19 +0,0 @@ -#!/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." diff --git a/developer/tool/clean_javac_output b/developer/tool/clean_javac_output new file mode 100755 index 0000000..57e64c1 --- /dev/null +++ b/developer/tool/clean_javac_output @@ -0,0 +1,17 @@ +#!/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." diff --git a/developer/tool/clean_make b/developer/tool/clean_make index fbdec11..3d8bceb 100755 --- a/developer/tool/clean_make +++ b/developer/tool/clean_make @@ -1,27 +1,25 @@ #!/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." diff --git a/developer/tool/clean_release b/developer/tool/clean_release index c358078..f5b59c7 100755 --- a/developer/tool/clean_release +++ b/developer/tool/clean_release @@ -1,31 +1,28 @@ #!/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." diff --git a/developer/tool/env b/developer/tool/env index 3b03a8f..3321c60 100644 --- a/developer/tool/env +++ b/developer/tool/env @@ -1,32 +1,27 @@ #!/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\ @@ -38,13 +33,17 @@ export PATH=\ "$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/ diff --git a/developer/tool/make b/developer/tool/make index a345dd9..a8a9022 100755 --- a/developer/tool/make +++ b/developer/tool/make @@ -1,48 +1,49 @@ #!/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." diff --git a/developer/tool/release b/developer/tool/release index 2675ba9..b6b9dbd 100755 --- a/developer/tool/release +++ b/developer/tool/release @@ -1,56 +1,61 @@ #!/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." diff --git a/document/license.txt b/document/license.txt new file mode 100644 index 0000000..e177f6f --- /dev/null +++ b/document/license.txt @@ -0,0 +1,152 @@ +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 diff --git a/document/readme.txt b/document/readme.txt new file mode 100644 index 0000000..9a7500e --- /dev/null +++ b/document/readme.txt @@ -0,0 +1,19 @@ + +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. + diff --git a/document/todo.txt b/document/todo.txt new file mode 100644 index 0000000..429086e --- /dev/null +++ b/document/todo.txt @@ -0,0 +1,3 @@ + +1. extract TestBench as its own project. Perhaps it can replace paintit as the +project skeleton. diff --git a/env_administrator b/env_administrator new file mode 100644 index 0000000..744a861 --- /dev/null +++ b/env_administrator @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +source tool/env + diff --git a/env_developer b/env_developer new file mode 100644 index 0000000..4236627 --- /dev/null +++ b/env_developer @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source tool_shared/bespoke/env +source developer/tool/env + diff --git a/env_tester b/env_tester new file mode 100644 index 0000000..969a5d1 --- /dev/null +++ b/env_tester @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +source tool_shared/bespoke/env +source tester/tool/env + diff --git a/release/Ariadne.jar b/release/Ariadne.jar new file mode 100644 index 0000000000000000000000000000000000000000..74faa320529c62592845fdf8fb42465e54f2d111 GIT binary patch literal 2741 zcma);c{G%39LFa##?nO?lwFoEGxjS>ma+^p!^KFlWg13}Z45)GP;x62jcv+O>;5n&2} zwjD5q$kLixo?0k$DvwSOpe9IpII_(*yTC$0rBk_8S;ex|3rVY&mqDSu5cM#bdimzA zw-e(N3|}^Z^x;o9L0>|T{_bvq6kzh*30Uc~P**pio2!Q>0oyTd(b;3#B43YaX@r@4 z4T44XD{#@o~{AE zphSN`=@Hz{p7X$dp?`cqvj2lNbi-qz82niupTf8gB<@kF=(a|wrN*<;G*)iZsL*Vz7Mw1MX?E9N|_ zRs9;2ayB6sP|h$ah}*K)TfZ3T&qGY^Iy$=%T9d1Kx`FLgv96|5 zS&`NekmSV{mg*A@-3L`N@jZu*HY03bKb=g+u-KY-R5c;Y-r{SMWD*D_RMk7Bcn8JU zsF}%F%wM>&&8p!BD|kOj$sG*bpHq{bn24fW0~i~zKEU`5t75ZoEa4&t2u@iw?TIJO z=Ulnx+qIsdvy_`!D7;?mRCqz#l~?-h-5FFul*Dw_Lz|ak*bf9M$u9FqgwTtmC#>!3 zc8=7~ZGOIWBCN&*nv+fEy5}95G6LgMA>P@?7wbZ9SvFhao8)+vyIIamNM#FalK<3$ z4IB`bPV;#^dMuySHYy-_7277C4mmb~-FAuW139W}9CYm7yi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jK{EWQSt~{MahK-!j|2e=X$a#EysT7UV1OV=MW2is)_x seT4Z%%C4n+|LON$%Z{h)R@(na+qD*R)BW_z1pt`oPY0cB`r@De0RA^J@&Et; literal 0 HcmV?d00001 diff --git a/release/black b/release/black deleted file mode 100755 index d94d9cb..0000000 --- a/release/black +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -java com/ReasoningTechnology/PaintIt/Black diff --git a/release/blue b/release/blue deleted file mode 100755 index 387f82a..0000000 --- a/release/blue +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -java com/ReasoningTechnology/PaintIt/Blue diff --git a/release/build b/release/build new file mode 100755 index 0000000..f4d3bbc --- /dev/null +++ b/release/build @@ -0,0 +1,2 @@ +#!/bin/bash +java com/ReasoningTechnology/Ariadne/build diff --git a/release/green b/release/green deleted file mode 100755 index 9611a51..0000000 --- a/release/green +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -java com/ReasoningTechnology/PaintIt/Green diff --git a/tester/.githolder b/tester/deprecated/.githolder similarity index 100% rename from tester/.githolder rename to tester/deprecated/.githolder diff --git a/tester/document/about_TestBench.txt b/tester/document/about_TestBench.txt new file mode 100644 index 0000000..de27572 --- /dev/null +++ b/tester/document/about_TestBench.txt @@ -0,0 +1,10 @@ + +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. diff --git a/tester/document/what_the_tests_do.txt b/tester/document/what_the_tests_do.txt index 792ac31..3f107d9 100644 --- a/tester/document/what_the_tests_do.txt +++ b/tester/document/what_the_tests_do.txt @@ -1,17 +1,8 @@ -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 diff --git a/tester/javac/TestBench.java b/tester/javac/TestBench.java index 0a9de3d..bd08267 100644 --- a/tester/javac/TestBench.java +++ b/tester/javac/TestBench.java @@ -1,8 +1,19 @@ +package com.reasoningtechnology.TestBench; import java.util.Map; public class TestBench { - public static void runTest_Map(Map 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 test_map){ int totalTest_Map = test_map.size(); int passedTest_Map = 0; int failedTest_Map = 0; diff --git a/tester/javac/TestBenchAriadne.java b/tester/javac/TestBenchAriadne.java new file mode 100644 index 0000000..88a6bd2 --- /dev/null +++ b/tester/javac/TestBenchAriadne.java @@ -0,0 +1,53 @@ +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 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 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 + } + +} + diff --git a/tester/jvm/.githolder b/tester/jvm/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/tester/jvm/AriadnaTestBench.jar b/tester/jvm/AriadnaTestBench.jar new file mode 100644 index 0000000000000000000000000000000000000000..0c16d794f85af273d62beb658e90ca918e52c890 GIT binary patch literal 2081 zcmWIWW@Zs#;Nak3_?F}!$$$hn8CV#6T|*poJ^kGD|D9rBU}gyLX6FE@V1g7%DiU`O~COU!TvTHy%92uIW=p!$Fd zD65yAS(2HamtT~6`BBi7>)z*ePWqfbt?vajNWb@%fgn&BKhz+g7N8G5qXh*EP&PR~ zS07{*b`=s(6-B9u#rb)edFdso$r*Y1Ir-_8cyuY@(G`+fT;i0Pmz)9C4~ZglcNr3; zA8wLfa!z7#aqkr0;NWzTUs4|*>(zU6;Lyum^OwpmcwDljSbxEuh~<%U=1l)@`MmyI z@g)2C>+MM~0vpIvGGGKctCa=(~A_8r`v$#c)RVt=QI{1S_k?Tycsn}a12 zHgpO(v!xqzJU4P-5_~%6V8_7~6C^gpM)PxDtVxXO=&kDZvM@;8{i-NA)$wQWwWh@_ zE1p_7+1OhL&k+1Jb!%wkye(OYS03yU_$s|_!b$%-oARQMwr!jHXi2EH=rUeCi5||C zn_^3K?|ztCkS3m!akxZhdz4Q0{j$|dbLR=3FP`#rTAMfH(Pf*if6&f4!J=Y-q7~1N2?lV4@l?~1Ci z{I8wMK3$u8dx$Id#G4OpmYvZ{iM#nY>gTj?HHu-|_Xj_;?cw$meY14UmJ5^gbE>y& zy0lc5)!FA#UF5P-_L|i-o(9v_{7Nl#Z`Vz0nISFJzU{;9jOi^Yp)WH}XKEabxpCv) zvYoXLSC_60Yguvqf>YVzzPF<5e{EZR`d0WgFHet%Y-8 z%(C>md2Ln71|6CI@poF@nLmEc$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xd>b@mmvsY};SdtgDZLt`8vC@{c z5vQ}R6l+i0m-c#T;Q6)Lr>~Yibg6rvD)w#HHo3xd|AQ-7r#)`+eK?HD=uTXYA5K zw>)1jbw@}@c;5CqD>&_Q)%VTZQg}{WxBOz@*L%DvFMI7D%60~?HvKB~5?UR#y2K}Y6){GFC}=8s=I6o_o{7vcQpB5_f-q;LLPH+gx|%^S6kF1D91{`BBz{Kj?%l{J^79!=gdVbN5z zTb`HB+VwH~?zB5@@Iol_-)sxbU6x)dFH~w>3>xBpU+ds-zPS0~!+oZU4oMj%8e9{M zR@S@o*lmGoi@gEcW7&_UlN#q$IbF65Dp&s0aPIh$<_1ZYZ)-Qp&nr+^;B`IWk$tm% zU7gRa;dta-edVGVuB+#n`DrTitjYWTN2CWewKM= zHTTTKmIu7Sd^?1cfs$Dg1Qo$?Fat9Y;LzZ96uXd z%@cgMw&3>hj!V*6$2FN|7BpM332Ejf1ut#Bd>}EYrl&w{%Hf57RHn@T#|m(uN$jA)mXS$>0kt%O)drvn0~Nq)08sUTtQAyUAeZ5w>H-05flRnoq{;)?1W;Lz zTzG@ZdIUHGWFks_kUlO3>;*TflermT1wC#ZprRfDbfG%17yP(Q0TulSkc`I^c<~La m2v7qbIbuLn0Rk*0$~?HqkcuI|o0Sb@1UnGk0UDqW<^cd`J?pCg literal 0 HcmV?d00001 diff --git a/tester/scratch_pad/.gitignore b/tester/scratch_pad/.gitignore new file mode 100644 index 0000000..120f485 --- /dev/null +++ b/tester/scratch_pad/.gitignore @@ -0,0 +1,2 @@ +* +!/.gitignore diff --git a/tester/test2/HelloWorld.java b/tester/test2/HelloWorld.java deleted file mode 100644 index 74d76d1..0000000 --- a/tester/test2/HelloWorld.java +++ /dev/null @@ -1,5 +0,0 @@ -public class HelloWorld{ - public static void main( String[] args ){ - System.out.println( "Hello, world!" ); - } -} diff --git a/tester/test2/TestGraph$_get_node_f_list_closure2.class b/tester/test2/TestGraph$_get_node_f_list_closure2.class deleted file mode 100644 index 12489c0beb182435da3f573206ce5eae75d9829d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1858 zcma)6TW{1x6#izjjT7T!w^^X27fN9vdr2^%7oeL^$d-hK4Yb_|30^F(cd{{Y#w&Yv zrTl?P{ULp)twbXp`dX>Ksj7O$c3dYh60$U&Idg8`Ip3MT|9$f(fLqvRxU$Vdxf$4_ z-KsU@(h~lFTRWELhSG98KO6`ArUu4P83w*TIWRq249#|YqhX3+$q$C6LuR}7I5ZQj zU@WA&&&^FPcwkFDNG;xDD5o*6$Lb6h-Wr@?HdWU!%TPLzCd1iUz5CLh*l})8`!Bg8 zTL#X+pjg#V+R}B}o*jlAvEwr|y15zi9gpl>Ul6)Px5c1Y7J1leGq4v7)2ps<wussSm95U8NAu&^ zeNIiNREes+h<=3Kj%YFalZ*{EUUhFuVl?OSG|cj$WT94)nlwX zL05*0|Ffs!KrmXO!_iu~y0Hk)pLrr#qOU56~LTr9W`)SK2ac(RwKoPvbm3pcBZ|hqyp@ zYWETC3bg+ipU|q@tkSta|CvVf4I02J+86L7(pEP2BA@4Doz&+Hn#yOnh$Sp1p4Lf6 zd0K3|#up2PU&!Sl?!5X9t#0!#l$7)k_n&uvN2~c7->EiPZ` diff --git a/tester/test2/TestGraph$_get_node_f_list_closure3.class b/tester/test2/TestGraph$_get_node_f_list_closure3.class deleted file mode 100644 index 88475e852a7c2d6585fcd1280c95509594a44c9b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1854 zcma)6ZExFD6n<_R>eh3c(2T)&8G~hOUfP*5U>j*S+OT$E=?0{l1YfKh=O*>)UPrbQ zseb^8AHw$m(x~=5l+&0uV|9khuMEyGpQ>w^XDFRXli^~m-hIZWJkIS&|CzAE zmVpZ}C{{HHdFa?}mj^*d4n2lOH#cK3bji-~B%w=mTMU|Ik%!$j1N)I-cHNOqc#mPZ zc0S^HN&TsTB~)}2agm`I?mGd)^=^vi)g`CMi3jf&3zqU4W2XED zUYolv!;PH$a*9O7RfV%$!H0ABV1`&xU|7wo&-8HYPDYM2r+3Vb92|8dB{$@@&~TO9 z^gS;OLgEp_PubXxoO%bs+!f)zH+ab9z!gEY>v;#0aVvwT7y6DIWhJK!_m0LQdzq+r zvXBx3g}>*7f(Y<2uIcy))zU1kQ*B}ehDWv6>OdyDgi_gPDa)2oTcWbn8T4p&T;3Pd zfJ&8U+KZ@1*m*=LqB$`&J4fji^}BqQ!WwQe%#oYKxN?f-k&r-sf;Al`K4n*>-ZdZ3@oBFj{?4AsO2V- zGhZ6k8H^Kz@pNuv!^a@&uRpK`?%}?U4SW?lPH`F7!m7HUN!C?wVh%FYPgV64>(0=X z;mZFl%2U*^Lo{TaRbR@l@Q6&UDAEgIUy~{K$gpFp3;PkwSZ;Ne5`73Xo3}Sp8V2zqm1SN(- zSyx>G%0HuwH;J`MP7f5VT{_*x41IvsXs-N$w|=E9!!E5?Bk?RQ;cYsBT)l(Kbf%SEhUHSx5Scv^0} zz^$diFXZwVcc1@;R=4>VN=kZ+%^$kIqt$$YuT>z1C$tg~7ym&;!$z6m0k#u=W%{cO nipO}QlvM$~rBx?slra_MyGW{I0pHWE01drF;|86s;KTm_I3N62 diff --git a/tester/test2/TestGraph$_java_to_class_closure1.class b/tester/test2/TestGraph$_java_to_class_closure1.class deleted file mode 100644 index 8deb4f0b3fcddb75b7d70f73c79cdc6f0321c814..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3090 zcma)8*>@9F9R6;aWRDrYTL&;hf~IzxDeqcmBRV`v-vi_(5P>zbtw^u2C3k z%w9AmjjZQn&Ad@8a&(F%S9WL+0;@+|$C;c?z7b1u&hk1VVS^+1ttpYYEG+@z^v257p3WS zwk$rN>5--bJcukMOy+bXkQ>V z(5PV#ZB*LKt#LdifH?LFv@~B>>{{hfz}*=Dyf1;Bc!D_~r=&@Q;@Drql7qnRYEDnm z%hIT2rzQ`idhLB4j^0L^N zcAW82p|ir+(6Wk?1&saE1zCl>w-UIJLB%a&d9qW-VH`=I6HnE}@HFuX2oy{UQnY6d zl?vryo$5G>t|T#GfoPWv%RBD4aU4^}dXhl(&~Z6sc>_kiMErV_OjMq&n$H7;(x`Mb zq$y!ik)6&7tZQCic}PTyPvLX|eK;e~Q7r~@O)F!%R>A9<_M~cSM@NhTW1-=!fNnYy z1;drcE|m%XuCBIF~>MEYg^2DWzf@FVN&-$uwn=8`U0IM}?9X$BT5^ zbS1lHpNe;5wX_Q(Q}V2Qid6LNWn`6xS12`SSb6sCIEDpkrRyqGM_3MA#zB0Rvo6lK zPC>ffw2msWv?) ziOdTs+~*}A(|9$3CcMTsL-pMFSJSi0d!!`YzY4_HNuEJtnIQJLV_%sRc-<`;yIlH|7Tn617__$&kt(AA7na!q;M zQo8E9=K5rCT|@^17G*DqAzB|%uN}adZyo1^iYVvnSdBGoL;TL+%eao?7u=1pC^XL7 zTie?2qG9);+J@TJ>~GlEP&?QVJrrw*somy=*x*m368MtiKGbsDhAnuMvs!KCpAQJf z?fgglm9j#;1>1Z(lyxkGQ0qU`sqSw4j-5l%duSS}Y5f%&?_hVP_8wA0HOY?5P&D~? z<}RL`#j`+P`(XPlP5^3p4yc*I^D`K{g(l7CP7W#h3z?zX+C!e(IH2L7z1 zF%^v@4Fz2UW-$STbTsKJ8npqD|6p<DIxxRP%B z3w7#r1|JNif5DZuJGc>uSMajAto#?NHC(M1_y{*cdG(x?HPIP-u86t9w;U5ZReIt~ m<6Hh|0xR$xR}m)B_ncc9k!QF&fP?;gJe*I4^JqBdaqxcysUbrE diff --git a/tester/test2/TestGraph$_java_to_class_f_closure1.class b/tester/test2/TestGraph$_java_to_class_f_closure1.class deleted file mode 100644 index ba07c8a8527fc0c552ce06dc4346075676787fb4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3098 zcma)8>2nih9Dd$3&4#eh63)sYN1-RgBFa%vY2_%UfTXk*)VSTgX_uzEVY4Z%w}>br z-WTduzvERpb>mL3;|GBqeX{7CaE-!f zWA>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$rL<8v*0`z%U8JLM9eLdKb&= z!wYZQd6fh^@J8`;25+`BnPSW9KB`Z3Ih-NLYE8#C_@-8Me3NCGUlgAcFj&TM?5dk+p<%)n36QS5DplDRpE@ayIFl`ZQs(z zt|VT>JG$F8gby1c6&r5{C0@D@F~!VFB2| zOp(MZcsYUJ;#KDVB1Oyju((*3{+B)8`tki7<5UH@CDT4)as(K$-*! z`fL?WQB`bUy2UvhbRd>WsQd#`Pa=UENFP;mEicnf?sHBi=WG1BgS3s*NKf;3nX%5K zi!WkrX83uo3jC4JBq^{0H)0*>pZM$GN{X}-H(@>Bm89-~i?c%P3gR=k^#a!f{v2_u zGo82%Jt4O^%da>YdW<$><1F3+3>$At&td?`WrmHmIqWXPDX0+3{?S+`JH(!Vw z`}5PdcNRnB&&=W=FpI;$8EEnIh{w)g1y_gZPGJV`I~}c_#%hY7D5I!En0aMgvx;?;c@^n7j2$gbM)+*Qw!bOqIPHS6jyZPvwU{W;Z%XBv~AfujV}ha62ln&!epD= zc0K@MqCT|*h;OC)Kp!E_5YWwpI7^7{AjI2omdX1Xb_VcvhalDAWxEOCeHM2S)Taq= zC%)CFm|dK3)L&1SopU%B#C;miF%9Q%KKlBeN{?%+>F!iq{l^+s6ZS<_yonY3Bcts( z=;;|;xNs2{bD3AsrB-J!Q^>u5i!nQEUBvbHR(%O zTX+TW3&ZIGn*$qzTA4r3Mlht|7eP~4PUllR^mG2M@F(y~{3;TtrgYV2I?@@+P^~3w zBCp8)^> diff --git a/tester/test2/TestGraph.groovy b/tester/test2/TestGraph.groovy deleted file mode 100644 index f1f3913..0000000 --- a/tester/test2/TestGraph.groovy +++ /dev/null @@ -1,150 +0,0 @@ -import AriadneGraph - -class TestGraph { - - static def get_node_map(){ - return [:] - } - - // given label .class returns node to build .class from .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 .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 java_to_class(String node_label) { - System.out.println("java_to_class::"); - - Map target = AriadneGraph.unpack_file_path(node_label); - System.out.println("java_to_class_f:: given target: " + target); - - // This function recognizes .class files - if (target.get("fn") == null || !target.get("fn_ext").equals("class")) { - Map 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 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 result = new HashMap<>(); - result.put("status", "success"); - result.put("output", class_fp); - return result; - } else { - Map result = new HashMap<>(); - result.put("status", "failure"); - result.put("error", new String(process.getErrorStream().readAllBytes())); - return result; - } - } catch (IOException | InterruptedException e) { - Map result = new HashMap<>(); - result.put("status", "failure"); - result.put("error", e.getMessage()); - return result; - } - }); - - return matchedNode; - } - - public static Map 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 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 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 .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) } - ] - ) - } - -} diff --git a/tester/test2/env_test b/tester/test2/env_test deleted file mode 100644 index 78c20df..0000000 --- a/tester/test2/env_test +++ /dev/null @@ -1,11 +0,0 @@ - -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 - diff --git a/tester/test2/test.sh b/tester/test2/test.sh deleted file mode 100755 index 6cd9b04..0000000 --- a/tester/test2/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/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" - diff --git a/tester/tool/clean b/tester/tool/clean new file mode 100755 index 0000000..ff8ac50 --- /dev/null +++ b/tester/tool/clean @@ -0,0 +1,21 @@ +# 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." diff --git a/tester/tool/env b/tester/tool/env index a630a47..f6b871a 100644 --- a/tester/tool/env +++ b/tester/tool/env @@ -1,32 +1,41 @@ #!/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/ diff --git a/tester/tool/make b/tester/tool/make index c9aca35..cdcd57d 100755 --- a/tester/tool/make +++ b/tester/tool/make @@ -1,12 +1,21 @@ #!/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." diff --git a/tester/tool/make_TestBench b/tester/tool/make_TestBench new file mode 100755 index 0000000..dd5daa9 --- /dev/null +++ b/tester/tool/make_TestBench @@ -0,0 +1,21 @@ +#!/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." diff --git a/tool_shared/bespoke/env b/tool_shared/bespoke/env index 1939b29..d38b1bc 100644 --- a/tool_shared/bespoke/env +++ b/tool_shared/bespoke/env @@ -1,46 +1,61 @@ #!/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." + diff --git a/tool_shared/bespoke/temp b/tool_shared/bespoke/temp deleted file mode 100644 index 0a80f78..0000000 --- a/tool_shared/bespoke/temp +++ /dev/null @@ -1,24 +0,0 @@ -#!/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" diff --git a/tool_shared/bespoke/vl b/tool_shared/bespoke/vl new file mode 100755 index 0000000..94fe14d --- /dev/null +++ b/tool_shared/bespoke/vl @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# vl 'vertical list' + +# Check if the command is provided +if [ -z "$1" ]; then + echo "Usage: vl [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 diff --git a/tool_shared/bespoke/wipe_replease b/tool_shared/bespoke/wipe_release similarity index 100% rename from tool_shared/bespoke/wipe_replease rename to tool_shared/bespoke/wipe_release -- 2.20.1