From 7ffe5336c451e4e5cafad73518e36638bd6a206e Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Fri, 11 Oct 2024 04:26:46 +0000 Subject: [PATCH] The PaintIt example becomes a skeleton project, initial draft --- .gitignore | 7 + LICENSE.txt | 152 ++++++++++++++++ README.md | 19 ++ developer/deprecated/.githolder | 0 .../#variable_suffix_conventions.txt# | 27 +++ developer/document/RT_code_style.txt | 73 ++++++++ .../document/variable_suffix_conventions.txt | 27 +++ developer/javac/Black.java | 7 + developer/javac/Blue.java | 10 ++ developer/javac/Green.java | 7 + developer/jvm/.gitignore | 2 + developer/scratch_pad/.gitignore | 2 + developer/shell/.githolder | 0 developer/shell/black | 2 + developer/shell/blue | 2 + developer/shell/green | 2 + developer/tool/clean | 16 ++ developer/tool/clean_all | 19 ++ developer/tool/clean_dist | 23 +++ developer/tool/env | 45 +++++ developer/tool/make | 63 +++++++ developer/tool/release | 46 +++++ document/directory_naming.html | 169 ++++++++++++++++++ document/work_flow.txt | 29 +++ release_candidate/.githolder | 0 scratch_pad/.gitignore | 2 + tester/document/.githolder | 0 tester/tool/#make.sh# | 10 ++ tester/tool/env | 29 +++ tester/tool/make.sh | 10 ++ tool/#env_administrator# | 27 +++ tool/env_administrator | 27 +++ tool/env_base | 23 +++ tool/env_developer | 31 ++++ tool/env_tester | 26 +++ tool_shared/bespoke/version | 4 + tool_shared/customized/.githolder | 0 tool_shared/document/#install_java.txt# | 11 ++ tool_shared/document/install_groovy.txt | 29 +++ tool_shared/document/install_java.txt | 11 ++ tool_shared/third_party/.gitignore | 4 + tool_shared/third_party/upstream/.gitignore | 2 + 42 files changed, 995 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 developer/deprecated/.githolder create mode 100644 developer/document/#variable_suffix_conventions.txt# create mode 100644 developer/document/RT_code_style.txt create mode 100644 developer/document/variable_suffix_conventions.txt create mode 100644 developer/javac/Black.java create mode 100644 developer/javac/Blue.java create mode 100644 developer/javac/Green.java create mode 100644 developer/jvm/.gitignore create mode 100644 developer/scratch_pad/.gitignore create mode 100644 developer/shell/.githolder create mode 100755 developer/shell/black create mode 100755 developer/shell/blue create mode 100755 developer/shell/green create mode 100755 developer/tool/clean create mode 100755 developer/tool/clean_all create mode 100755 developer/tool/clean_dist create mode 100644 developer/tool/env create mode 100755 developer/tool/make create mode 100755 developer/tool/release create mode 100644 document/directory_naming.html create mode 100644 document/work_flow.txt create mode 100644 release_candidate/.githolder create mode 100644 scratch_pad/.gitignore create mode 100644 tester/document/.githolder create mode 100755 tester/tool/#make.sh# create mode 100644 tester/tool/env create mode 100755 tester/tool/make.sh create mode 100644 tool/#env_administrator# create mode 100644 tool/env_administrator create mode 100644 tool/env_base create mode 100644 tool/env_developer create mode 100644 tool/env_tester create mode 100755 tool_shared/bespoke/version create mode 100644 tool_shared/customized/.githolder create mode 100644 tool_shared/document/#install_java.txt# create mode 100644 tool_shared/document/install_groovy.txt create mode 100644 tool_shared/document/install_java.txt create mode 100644 tool_shared/third_party/.gitignore create mode 100644 tool_shared/third_party/upstream/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..02b640c --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +#note also the .gitignore files in the tool and developer directories and any +# other directory that might have one. + +#*# +*~ +a.out +.gradle/ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..e177f6f --- /dev/null +++ b/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/README.md b/README.md new file mode 100644 index 0000000..991e4ee --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +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/developer/deprecated/.githolder b/developer/deprecated/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/developer/document/#variable_suffix_conventions.txt# b/developer/document/#variable_suffix_conventions.txt# new file mode 100644 index 0000000..8aca090 --- /dev/null +++ b/developer/document/#variable_suffix_conventions.txt# @@ -0,0 +1,27 @@ +# Suffix Conventions + +## Specify interface used with variable when clarification is useful: + +- `_set`: Indicates that the variable holds a set of items. + +- `_list`: Used for variables that represent a list of items. + +- `_f`: Refers to a function. + +Instead of making a variable name plural, add the interface qualifier: + + e.g. names -> name_set or name_list + +## Always a good idea to use these when working with files: + +- `_fp`: Refers to a file path. The part after the last slash is a file name. + +- `_dp`: Refers to a directory path. By convention, the value ends in a slash. + +- `_fn`: Refers to a file name. Value has no slashes. + +- `_dn`: Refers to a directory name. Value has no slashes. + +- `_fn_base`: The file name without the last dot and subsequent characters. + +- `_fn_ext`: The subsequent characters after the last dot in a file name. diff --git a/developer/document/RT_code_style.txt b/developer/document/RT_code_style.txt new file mode 100644 index 0000000..e142eba --- /dev/null +++ b/developer/document/RT_code_style.txt @@ -0,0 +1,73 @@ +RT code style: + +This has evolved into place after decades of programming in Unix culture projects. +The comma style is unique to RT. + +AI tools we have used are OK with the commas, but have had difficulties +with the padding rules for enclosures. + +1. Enclosures `(...)`, `{...}`, `[...]`, '<...>': + + - No space between the enclosure and the preceding identifier (e.g., `function(arg)`). + + - No space after the enclosure when followed by another enclosure (e.g., `map[key]()`). + + Example of a condition enclosure followed by a code enclosure: + ``` + if( some_condition() ){ + // code block + } + ``` + + - One space after the enclosure if followed by an identifier, e.g., + `function() somethingElse`. + + - When the entire enclosure appears on one line: + -- if not nested, no padding. + -- if nested, pad only the outermost enclosure with one space + e.g.s: + if(x == 3) ; not nested + if( (x > 0) && (y < 5) ) ; nested, pad outermost only + if( f(x) == 3 ) ; nested, pad outermost only + if( x > 2 && a[3] ) ; nested due to the array subscript, pad outermost only + +2. Commas: + + - One space **before** the comma (e.g., `a ,b`). + + - No space **after** the comma (e.g., `a ,b`). + + - **Line break before** the comma when breaking lines, but no line break after (e.g., + ``` + a + ,b + ```). + +3. Variable Naming: + + - Use **snake_case** for function and variable names. + + - Use **PascalCase** for namespaces and types. + +4. Binary Operators: + + - One space around **binary operators** (e.g., `a + b`). + + - One space around **assignment** `=` (e.g., `a = b`). + + - **No space** around **sampling** assignment `=` (typically seen in `if`, `while`, etc.): + + **Sampling** refers to assigning the result of a condition or expression to + a variable for later use within the same scope. + + Example of **sampling** in an `if` statement: + + ``` + if( result=some_condition() ){ + // use result + } + ``` + +5. Two space indentation. + + diff --git a/developer/document/variable_suffix_conventions.txt b/developer/document/variable_suffix_conventions.txt new file mode 100644 index 0000000..e5ef76e --- /dev/null +++ b/developer/document/variable_suffix_conventions.txt @@ -0,0 +1,27 @@ +# Suffix Conventions + +## Specify interface used with variable when clarification is useful + +- `_set`: Indicates that the variable holds a set of items. + +- `_list`: Used for variables that represent a list of items. + +- `_f`: Refers to a function. + +Instead of making a variable name plural, add the interface qualifier. + + e.g. names -> name_set or name_lisst + +## Always a good idea to use these when working with files + +- `_fp`: Refers to a file path. The part after the last slash is a file name. + +- `_dp`: Refers to a directory path. By convention, the value ends in a slash. + +- `_fn`: Refers to a file name. Value has no slashes. + +- `_dn`: Refers to a directory name. Value has no slashes. + +- `_fn_base`: The file name without the last dot and subsequent characters. + +- `_fn_ext`: The subsequent characters after the last dot in a file name. diff --git a/developer/javac/Black.java b/developer/javac/Black.java new file mode 100644 index 0000000..d669ac3 --- /dev/null +++ b/developer/javac/Black.java @@ -0,0 +1,7 @@ +package com.ReasoningTechnology.PaintIt; + +public class Black { + public static void main(String[] args) { + System.out.println("Paint it black."); + } +} diff --git a/developer/javac/Blue.java b/developer/javac/Blue.java new file mode 100644 index 0000000..c6c7a0a --- /dev/null +++ b/developer/javac/Blue.java @@ -0,0 +1,10 @@ +package com.ReasoningTechnology.PaintIt; + +public class Blue { + public static void print(){ + System.out.println("Paint it blue."); + } + public static void main(String[] args) { + print(); + } +} diff --git a/developer/javac/Green.java b/developer/javac/Green.java new file mode 100644 index 0000000..cf16a88 --- /dev/null +++ b/developer/javac/Green.java @@ -0,0 +1,7 @@ +package com.ReasoningTechnology.PaintIt; + +public class Green extends Blue { + public static void print(){ + System.out.println("Paint it green."); + } +} diff --git a/developer/jvm/.gitignore b/developer/jvm/.gitignore new file mode 100644 index 0000000..120f485 --- /dev/null +++ b/developer/jvm/.gitignore @@ -0,0 +1,2 @@ +* +!/.gitignore diff --git a/developer/scratch_pad/.gitignore b/developer/scratch_pad/.gitignore new file mode 100644 index 0000000..120f485 --- /dev/null +++ b/developer/scratch_pad/.gitignore @@ -0,0 +1,2 @@ +* +!/.gitignore diff --git a/developer/shell/.githolder b/developer/shell/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/developer/shell/black b/developer/shell/black new file mode 100755 index 0000000..d94d9cb --- /dev/null +++ b/developer/shell/black @@ -0,0 +1,2 @@ +#!/bin/bash +java com/ReasoningTechnology/PaintIt/Black diff --git a/developer/shell/blue b/developer/shell/blue new file mode 100755 index 0000000..387f82a --- /dev/null +++ b/developer/shell/blue @@ -0,0 +1,2 @@ +#!/bin/bash +java com/ReasoningTechnology/PaintIt/Blue diff --git a/developer/shell/green b/developer/shell/green new file mode 100755 index 0000000..9611a51 --- /dev/null +++ b/developer/shell/green @@ -0,0 +1,2 @@ +#!/bin/bash +java com/ReasoningTechnology/PaintIt/Green diff --git a/developer/tool/clean b/developer/tool/clean new file mode 100755 index 0000000..bd986dd --- /dev/null +++ b/developer/tool/clean @@ -0,0 +1,16 @@ +#!/bin/bash + +# Ensure REPO_HOME and ENV_DEV_BUILD are set +if [ -z "$REPO_HOME" ]; then + echo "release:: REPO_HOME is not set." + exit 1 +fi + +if [ -z "$ENV_DEV_BUILD" ]; then + echo "release:: ENV_DEV_BUILD is not set." + exit 1 +fi + +rm -rf scratch_pad/* + +echo "clean complete." diff --git a/developer/tool/clean_all b/developer/tool/clean_all new file mode 100755 index 0000000..8b7cc21 --- /dev/null +++ b/developer/tool/clean_all @@ -0,0 +1,19 @@ +#!/bin/bash + +# Ensure REPO_HOME and ENV_DEV_BUILD are set +if [ -z "$REPO_HOME" ]; then + echo "release:: REPO_HOME is not set." + exit 1 +fi + +if [ -z "$ENV_DEV_BUILD" ]; then + echo "release:: ENV_DEV_BUILD is not set." + exit 1 +fi + +set -x +rm -rf scratch_pad/* +rm -rf jvm/PaintIt.jar +set +x + +echo "clean_all complete." diff --git a/developer/tool/clean_dist b/developer/tool/clean_dist new file mode 100755 index 0000000..cd35a39 --- /dev/null +++ b/developer/tool/clean_dist @@ -0,0 +1,23 @@ +#!/bin/bash + +# Ensure REPO_HOME and ENV_DEV_BUILD are set +if [ -z "$REPO_HOME" ]; then + echo "release:: REPO_HOME is not set." + exit 1 +fi + +if [ -z "$ENV_DEV_BUILD" ]; then + echo "release:: ENV_DEV_BUILD is not set." + exit 1 +fi + +# Define release directory +release_dir="$REPO_HOME"/release_candidate + +set -x +rm -rf scratch_pad/* +rm -rf jvm/PaintIt.jar +rm -rf "$release_dir" +set +x + +echo "clean_dist complete." diff --git a/developer/tool/env b/developer/tool/env new file mode 100644 index 0000000..0e456f7 --- /dev/null +++ b/developer/tool/env @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +echo "REOP_HOME/developer/tool/env" + + +# The build environment. +# +env_error=false +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "env_build:: This script must be sourced, not executed." + env_error=true +fi +if [ -z "$ENV_DEVELOPER" ]; then + echo "env_build:: script can only be run from the developer environment" + env_error=true +fi +if [ "$env_error" = true ]; then + exit 1 +fi + +# goovy use has been deprecated +# export GROOVY_HOME="$REPO_HOME/tool_shared/third_party/groovy-4.0.9" + +# third party tools we will use +export JAVA_HOME="$REPO_HOME/tool_shared/third_party/jdk-11" +export PATH=\ +"$JAVA_HOME"/bin\ +:"$PATH" + +# where the tool build finds its class files: +export CLASSPATH=\ +"$REPO_HOME"/developer/jvm\ +:"$REPO_HOME"/developer/jvm/PaintIt.jar\ +:"$REPO_HOME"/developer/jvm/Ariadne.jar\ +:"$JAVA_HOME"/lib\ +:"$CLASSPATH" + +# after we building the tool we might want to run it +# the shell directory holds the bash UI wrappers +export PATH=\ +"$REPO_HOME"/developer/shell\ +:"$PATH" + +export ENV_DEV_BUILD=true +echo "${BASH_SOURCE[0]}" "complete" diff --git a/developer/tool/make b/developer/tool/make new file mode 100755 index 0000000..7c6291e --- /dev/null +++ b/developer/tool/make @@ -0,0 +1,63 @@ +#!/bin/env bash + +if [ -z "$ENV_DEVELOPER" ]; then + echo "make_PaintIt:: script can only be run from the developer environment" + return 1 +fi + +# Ensure we are in the right directory +cd "$REPO_HOME"/developer + +# Start with a fresh scratch_pad and remove a prior jvm +# Depending, this is unnecessary and might even be undesirable. +# Better to clean up the stuff we will rewrite instead of everything. +# But for testing and in an unstable environment, this is probably best. +echo "Starting with a clean scratch_pad and jvm directories..." +rm -rf scratch_pad/* +rm -rf jvm/PaintIt.jar + +# Compile all files (Black.java and Blue.java) with the correct package +echo "Compiling files..." +javac -d scratch_pad javac/Black.java javac/Blue.java javac/Green.java + +if [ $? -ne 0 ]; then + echo "Compilation failed." + exit 1 +fi + +# Create a JAR file from the compiled class files with correct package structure +echo "Creating JAR file..." +mkdir -p jvm +jar cf jvm/PaintIt.jar -C scratch_pad . + +if [ $? -eq 0 ]; then + echo "JAR file created successfully: jvm/PaintIt.jar" +else + echo "Failed to create JAR file." + exit 1 +fi + +# Create shell wrappers in developer/shell for easy execution +echo "Creating shell wrappers..." +mkdir -p shell + +cat > shell/black << EOL +#!/bin/bash +java com/ReasoningTechnology/PaintIt/Black +EOL +chmod +x shell/black + +cat > shell/blue << EOL +#!/bin/bash +java com/ReasoningTechnology/PaintIt/Blue +EOL +chmod +x shell/blue + +cat > shell/green << EOL +#!/bin/bash +java com/ReasoningTechnology/PaintIt/Green +EOL +chmod +x shell/green + +echo "Shell wrappers created successfully: black, blue, green" + diff --git a/developer/tool/release b/developer/tool/release new file mode 100755 index 0000000..5c76606 --- /dev/null +++ b/developer/tool/release @@ -0,0 +1,46 @@ +#!/bin/bash + +# Ensure REPO_HOME and ENV_DEV_BUILD are set +if [ -z "$REPO_HOME" ]; then + echo "release:: REPO_HOME is not set." + exit 1 +fi + +if [ -z "$ENV_DEV_BUILD" ]; then + echo "release:: ENV_DEV_BUILD is not set." + exit 1 +fi + +# Define release directory +release_dir="$REPO_HOME/release_candidate" + +# Create release directory if it doesn't exist +if [ ! -d "$release_dir" ]; then + mkdir -p "$release_dir" +fi + +# Function to copy and set permissions +install_file() { + source_fp="$1" + target_dp="$2" + perms="$3" + + target_file="$target_dp/$(basename $source_fp)" + + if ! 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..." + +# Paths to build script and JAR file +PaintIt_jar_fp="$REPO_HOME/developer/jvm/PaintIt.jar" + +# Install the JAR file +install_file "$PaintIt_jar_fp" "$release_dir" "ug+r" + +echo "Release process completed successfully." diff --git a/document/directory_naming.html b/document/directory_naming.html new file mode 100644 index 0000000..105bbc3 --- /dev/null +++ b/document/directory_naming.html @@ -0,0 +1,169 @@ + + + + + + Directory Structure Description + + + + +
+

Directory Naming

+ +

Reference

+ + + + +

Name origin and rationale

+ +

Typically, developers and project administrators do not employ a semantic + system for naming directories, but more commonly use conventional + placeholder names. The intended purpose of files in a directory with a + placeholder name then must be inferred from experience or inspection of + the files, or learned from other people or from documents.

+ +

For example, a directory named 'exe/' probably derives its name from the + fact that the contained files have their executable permission bit set; + however, such a directory will not contain all such files. There might + even be some files in an `exe/` directory that do not have their + executable permission bit set. The two concepts being an `exe/` file + (i.e. being a file in an `exe/` directory) and being an executable file + are not identical. The actual intended meaning of being an `exe/` file + will sometimes be that the contained files are applications available to a + user, or that they are tools available for use in a project. +

+ +

The directory names in this project resulted from an exploration of a + property-based file system. In such a system a number of files and + agents are defined. Then we can ask questions about their relationships. + Files with a relationship to the developer are collected, and this + becomes the `developer/` directory. In a similar manner we get the + directories, `tester/', and `javac/`. In this latter case the + agent is a compiler rather than a role. +

+ +

However, when attempting applying this method in practice it became + apparent that the recognition of relationships was insufficient. Consider + the directories `deprecated` and `scratch_pad`. There is no + 'Mr. Deprecated' or 'Mr. Scratch_Pad' who the contained files are + for. (And this conclusion is not for the lack of trying. Even mythological + beings did not suffice as agents.) Rather than saying a file has a + relationship with an agent, these properties (directory names) are states + imposed by decree by an agent on a file. Perhaps the developer, has + decreed that a file is now deprecated, or a build script has decreed that + it is a scratch_pad file. Such decrees are typically more dynamic than the + relationship properties. Also, these properties are disconnected from the + contents of the file. When, for example, we say a file is for the java + compiler we can surmise something about its contents. However when we say + a file is `deprecated` we can surmise nothing about its contents. +

+ +

To understand a directory name within this system, one can imagine + reading said name as part of a sentence that integrates the + property. Consider two property names: 'is-a' and 'is-for'. For example, + "Each file in the document/ directory is a document," or + "Each file in the developer/ directory is for the developer." + Although the property name is not carried over to the conventional file + system, we can typically infer what it must be. It is beyond the scope of + discussion here, but in actuality, our collections are defined by + predicates that are given a file's properties and relationships as + arguments, where the predicate resolves to true if and only if the file + belongs to the collection. Now wouldn't that be interesting if we + instead derived a probability? +

+ +

It is uncommon for a property value to be plural. While it is not + disallowed, it rarely occurs in practice. This is true independent of + whether we are discussing a relationship property or a state + property. Hence when we make a file collection based on a shared property, + then carry that over as a directory name in a conventional file system, + the resulting directory name will often be singular. This pattern can be + observed in the case of the `document/` directory, as shown in the prior + paragraph. +

+ +
+ + + diff --git a/document/work_flow.txt b/document/work_flow.txt new file mode 100644 index 0000000..81257f8 --- /dev/null +++ b/document/work_flow.txt @@ -0,0 +1,29 @@ + +Work Flow + +1. Development + + 1.1. developer makes edits + 1.2. developer uses 'release' which will copy relevant files to the $REPO_HOME/release_candidate + 1.3. tester will test the candidate + +2. Release + + 2.1. Upon completion of testing, project manager will make a new branch for release + named release_. Version has a major and minor number. + +2.2. on the new branch the 'release_candidate' directory is renamed 'release_'. + +3. Release specific fixes + + 3.1.the 'release_candidate' directory is recreated + 3.2 steps 1.1 - 1.33 are repeated + 3.3 when testing is complete, 'release_candidate' is renamed 'release_version' + with the minor version incremented. + +4. Major release + + Development continues on the `core_developer_branch` even after creation of a + `release_version` branch. For a next major release, increment the major release + number and do as described in steps 2 then 3. + diff --git a/release_candidate/.githolder b/release_candidate/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/scratch_pad/.gitignore b/scratch_pad/.gitignore new file mode 100644 index 0000000..120f485 --- /dev/null +++ b/scratch_pad/.gitignore @@ -0,0 +1,2 @@ +* +!/.gitignore diff --git a/tester/document/.githolder b/tester/document/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/tester/tool/#make.sh# b/tester/tool/#make.sh# new file mode 100755 index 0000000..d11729a --- /dev/null +++ b/tester/tool/#make.sh# @@ -0,0 +1,10 @@ +#!/bin/env bash + +# Ensure the script is sourced +if [ -z "$ENV_TESTER" ]; then + echo "env_build:: script can only be run in the tester environment" + return 1 +fi + +cd "$REPO_HOME"/tester/test0 +groovyc TestGraph.groovy diff --git a/tester/tool/env b/tester/tool/env new file mode 100644 index 0000000..252b8c6 --- /dev/null +++ b/tester/tool/env @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# environment common to all tests +# each test directory also has an environment + +echo "REOP_HOME/tester/tool/env" + +# The build environment. +# +env_error=false +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "env:: This script must be sourced, not executed." + env_error=true +fi +if [ -z "$ENV_DEV" ]; then + echo "env:: script can only be run from the developer environment" + env_error=true +fi +if [ "$env_error" = true ]; then + echo "in REOP_HOME/tester/tool" + exit 1 +fi + + +export JAVA_HOME="$REPO_HOME/tool/jdk-11" + +export PATH=\ +"$REPO_HOME"/release_candidate\ +:"$JAVA_HOME"/bin\ +:"$PATH" diff --git a/tester/tool/make.sh b/tester/tool/make.sh new file mode 100755 index 0000000..4ecb729 --- /dev/null +++ b/tester/tool/make.sh @@ -0,0 +1,10 @@ +#!/bin/env bash + +if [ -z "$ENV_TESTER" ]; then + echo "make.sh:: script can only be run in the tester environment" + env_error=true +fi + +set -x + +groovyc TestGraph.groovy diff --git a/tool/#env_administrator# b/tool/#env_administrator# new file mode 100644 index 0000000..e6bddc4 --- /dev/null +++ b/tool/#env_administrator# @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Ensure the script is sourced +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "This script must be sourced, not executed. Exiting." + exit 1 +fi + +if [ -z "$ENV_BASE" ]; then + script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" + source "${script_path}/env_base" +fi + +ENV_ADMINISTRATOR=true + +PROJECT="$PROJECT"_administrator + +export PATH=\ +"$REPO_HOME"/tool\ +:"$PATH" + +# no sneaky hidden files +alias ls="ls -a" + + +export ENV_ADMINISTRATOR=true +jecho "${BASH_SOURCE[0]}" "complete" diff --git a/tool/env_administrator b/tool/env_administrator new file mode 100644 index 0000000..a333a7f --- /dev/null +++ b/tool/env_administrator @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Ensure the script is sourced +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "This script must be sourced, not executed. Exiting." + exit 1 +fi + +if [ -z "$ENV_BASE" ]; then + script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" + source "${script_path}/env_base" +fi + +ENV_ADMINISTRATOR=true + +PROJECT="$PROJECT"_administrator + +export PATH=\ +"$REPO_HOME"/tool\ +:"$PATH" + +# no sneaky hidden files +alias ls="ls -a" + + +export ENV_ADMINISTRATOR=true +echo "${BASH_SOURCE[0]}" "complete" diff --git a/tool/env_base b/tool/env_base new file mode 100644 index 0000000..e0e865d --- /dev/null +++ b/tool/env_base @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# Ensure the script is sourced +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "This script must be sourced, not executed. Exiting." + exit 1 +fi + +# These are things set by the `repo` command found in the `resource` project, +# but if you don't have that, then source this into the environment. + +script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" +export REPO_HOME="${script_path%/*}" +export PROJECT=$(basename "$REPO_HOME") + +PPS1="\n[$PROJECT]\n\u@\h§$(pwd)§\n> " +PPS2=">> " + +echo REPO_HOME "$REPO_HOME" +echo PROJECT "$PROJECT" +echo "${BASH_SOURCE[0]}" "complete" + +export ENV_BASE=true diff --git a/tool/env_developer b/tool/env_developer new file mode 100644 index 0000000..b5abd91 --- /dev/null +++ b/tool/env_developer @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# Ensure the script is sourced +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "This script must be sourced, not executed. Exiting." + exit 1 +fi + +if [ -z "$ENV_BASE" ]; then + script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" + source "${script_path}/env_base" +fi + +PROJECT="$PROJECT"_developer + +export PATH=\ +"$REPO_HOME"/developer/tool\ +:"$REPO_HOME"/tool_shared/bespoke/\ +:"$PATH" + +# so the .gitignore files can be seen: +alias ls="ls -a" + +cd "$REPO_HOME"/developer/ +export ENV_DEVELOPER=true +source tool/env + +echo "${BASH_SOURCE[0]}" "complete" + + + diff --git a/tool/env_tester b/tool/env_tester new file mode 100644 index 0000000..db62c9f --- /dev/null +++ b/tool/env_tester @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Ensure the script is sourced +if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then + echo "This script must be sourced, not executed. Exiting." + exit 1 +fi + +# Check if REPO_HOME is set, if not source env_base +if [ -z "$ENV_BASE" ]; then + script_path="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" + source "${script_path}/env_base" +fi + +PROJECT="$PROJECT"_tester + +export PATH=\ +"$REPO_HOME"/tester/executor/\ +:"$REPO_HOME"/tool_shared/bespoke/\ +:"$PATH" + +cd "$REPO_HOME"/tester/ +export ENV_TESTER=true +source tool/env + +echo "${BASH_SOURCE[0]}" "complete" diff --git a/tool_shared/bespoke/version b/tool_shared/bespoke/version new file mode 100755 index 0000000..6e696ef --- /dev/null +++ b/tool_shared/bespoke/version @@ -0,0 +1,4 @@ +#!/bin/env bash + +echo 0.1 + diff --git a/tool_shared/customized/.githolder b/tool_shared/customized/.githolder new file mode 100644 index 0000000..e69de29 diff --git a/tool_shared/document/#install_java.txt# b/tool_shared/document/#install_java.txt# new file mode 100644 index 0000000..0091eac --- /dev/null +++ b/tool_shared/document/#install_java.txt# @@ -0,0 +1,11 @@ + +#1. downlaod + +cd "$REPO_HOME/tool/upstream" +curl -C - -o OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.16+8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz + +#2. extract + +cd "$REPO_HOME/tool" +mkdir -p jdk-11 +tar -xzf "$REPO_HOME/tool/upstream/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz" -C jdk-11 --strip-components 1 diff --git a/tool_shared/document/install_groovy.txt b/tool_shared/document/install_groovy.txt new file mode 100644 index 0000000..76ec07e --- /dev/null +++ b/tool_shared/document/install_groovy.txt @@ -0,0 +1,29 @@ + +1. Docs + https://groovy-lang.org/documentation.html + +2. Install from source + + # 1.1 Download + + # https://dlcdn.apache.org/groovy/ + + cd $REPO_HOME/toolsmith/upstream + wget https://dlcdn.apache.org/groovy/4.0.23/sources/apache-groovy-src-4.0.23.zip + + # 1.2 then build them ;-) + +2. Install binaries + + #!/usr/bin/env bash + + # Define version of Groovy to be installed + version="4.0.9" + + # 2.1 Download using curl + cd "$REPO_HOME/toolsmith/upstream" + curl -o apache-groovy-binary-${version}.zip https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-${version}.zip + + # 2.2 Extract + cd "$REPO_HOME/tools" + unzip "$REPO_HOME/tools/upstream/apache-groovy-binary-${version}.zip" -d . diff --git a/tool_shared/document/install_java.txt b/tool_shared/document/install_java.txt new file mode 100644 index 0000000..c9e5743 --- /dev/null +++ b/tool_shared/document/install_java.txt @@ -0,0 +1,11 @@ + +#1. downlaod + +cd "$REPO_HOME/tool/upstream" +curl -C - -o OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.16+8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz + +#2. extract + +cd "$REPO_HOME/tool" +mkdir jdk-11 +tar -xzf "$REPO_HOME/tool/upstream/OpenJDK11U-jdk_x64_linux_hotspot_11.0.16_8.tar.gz" -C jdk-11 --strip-components 1 diff --git a/tool_shared/third_party/.gitignore b/tool_shared/third_party/.gitignore new file mode 100644 index 0000000..525ec6b --- /dev/null +++ b/tool_shared/third_party/.gitignore @@ -0,0 +1,4 @@ +* +!/.gitignore +# upstream has a .gitignore file in it, edit to keep anything precious +!/upstream diff --git a/tool_shared/third_party/upstream/.gitignore b/tool_shared/third_party/upstream/.gitignore new file mode 100644 index 0000000..120f485 --- /dev/null +++ b/tool_shared/third_party/upstream/.gitignore @@ -0,0 +1,2 @@ +* +!/.gitignore -- 2.20.1