From: Thomas Walker Lynch Date: Sun, 6 Oct 2024 07:29:44 +0000 (+0000) Subject: test1 passes X-Git-Url: https://git.reasoningtechnology.com/usr/lib/python2.7/encodings/iso8859_13.py?a=commitdiff_plain;h=7d05631f7130c8a98c96eda12120102d37d391ed;p=Ariadne test1 passes --- diff --git a/README.md b/README.md index 8202030..991e4ee 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,11 @@ -Theseus volunteered to enter the inescapable maze designed by Daedalus to slay -the Minotaur and put an end to the Athenian sacrifices. Ariadne, fearing for his -life and desperate to help, thinks to give him a ball of string, which Theseus -then uses to trace his way out of the maze thus saving his life. +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. The traditional build tool `make` does not +navigating Daedalus's maze. As it turns out, `make` does not backward-chain pattern rules. Gradle/Groovy tends to build projects in -layers. However, in experimental code, it is often the case that -no complete layer will build without errors. - -Ariandne will attempt to build all that is buildable, no matter where in -a the dependency graph the buildable node is found, while leaving other -parts untouched. +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 @@ -19,9 +13,7 @@ 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. While there are plans to port the build tool to other -languages, Groovy has proven to be a practical language for this purpose, so this -is currently not a priority. +part of a Gradle script. + -Ariadne is a project in progress. diff --git a/developer/groovy/build b/developer/groovy/build index 1acf09b..2fb7a39 100755 --- a/developer/groovy/build +++ b/developer/groovy/build @@ -10,9 +10,18 @@ def include_a_class( a_class_fp ){ } } -// Main build function for the Shell UI -def build(graph_definition_fp){ - // Load the graph class dynamically +// Shell User Interface to the build function +def build(graph_definition_fp, root_node_labels){ + + // Print summary of what we are doing + println "Summary: Building targets for graph '${graph_definition_fp}.class'" + if (root_node_labels.isEmpty()) { + println "No build targets specified. Please provide root node labels to build." + System.exit(0) + } + println "Building targets: ${root_node_labels.join(', ')}" + + // Load the dependency graph class from arg[1] def graph_definition_class = include_a_class(graph_definition_fp) if(graph_definition_class){ println "build:: loaded ${graph_definition_fp}.class" @@ -24,20 +33,23 @@ def build(graph_definition_fp){ // Get the node_map and node_f_list from the graph class def node_map = graph_definition_class.get_node_map() def node_f_list = graph_definition_class.get_node_f_list() - // println "node_map: ${node_map}" - // println "node_f_list: ${node_f_list}" + println "node_map: ${node_map}" + println "node_f_list: ${node_f_list}" - graph = new AriadneGraph(node_map ,node_f_list) - - // Call the build function in AriadneGraph - // AriadneGraph.run_build_scripts_f(node_map ,node_f_list) + // Create an instance of AriadneGraph, and run the build scripts + def graph = new AriadneGraph(node_map ,node_f_list) + graph.run_build_scripts_f(root_node_labels) } // Entry point for the script if(args.length == 0){ - println "Usage: ./build " + println "Usage: ./build [root_node_labels...]" System.exit(1) } +// Get graph definition file and root node labels def graph_definition_fp = args[0] -build( graph_definition_fp ) +def root_node_labels = args.length > 1 ? args[1..-1] : [] + +build(graph_definition_fp, root_node_labels) + diff --git a/developer/groovyc/AriadneGraph$_all_DAG_DF_closure7.class b/developer/groovyc/AriadneGraph$_all_DAG_DF_closure7.class index 4231e36..8857e4d 100644 Binary files a/developer/groovyc/AriadneGraph$_all_DAG_DF_closure7.class and b/developer/groovyc/AriadneGraph$_all_DAG_DF_closure7.class differ diff --git a/developer/groovyc/AriadneGraph$_all_DAG_DF_closure8.class b/developer/groovyc/AriadneGraph$_all_DAG_DF_closure8.class index a0125cf..48d0c81 100644 Binary files a/developer/groovyc/AriadneGraph$_all_DAG_DF_closure8.class and b/developer/groovyc/AriadneGraph$_all_DAG_DF_closure8.class differ diff --git a/developer/groovyc/AriadneGraph$_all_DAG_DF_closure9.class b/developer/groovyc/AriadneGraph$_all_DAG_DF_closure9.class index 799d4d7..7be96ed 100644 Binary files a/developer/groovyc/AriadneGraph$_all_DAG_DF_closure9.class and b/developer/groovyc/AriadneGraph$_all_DAG_DF_closure9.class differ diff --git a/developer/groovyc/AriadneGraph$_good_dependency_q_closure10.class b/developer/groovyc/AriadneGraph$_good_dependency_q_closure10.class index e02400f..b4b33ad 100644 Binary files a/developer/groovyc/AriadneGraph$_good_dependency_q_closure10.class and b/developer/groovyc/AriadneGraph$_good_dependency_q_closure10.class differ diff --git a/developer/groovyc/AriadneGraph$_mark_node_form_closure3.class b/developer/groovyc/AriadneGraph$_mark_node_form_closure3.class new file mode 100644 index 0000000..9d962ba Binary files /dev/null and b/developer/groovyc/AriadneGraph$_mark_node_form_closure3.class differ diff --git a/developer/groovyc/AriadneGraph$_mark_the_wellformed_f_closure3$_closure13.class b/developer/groovyc/AriadneGraph$_mark_the_wellformed_f_closure3$_closure13.class deleted file mode 100644 index 1df2a60..0000000 Binary files a/developer/groovyc/AriadneGraph$_mark_the_wellformed_f_closure3$_closure13.class and /dev/null differ diff --git a/developer/groovyc/AriadneGraph$_mark_the_wellformed_f_closure3.class b/developer/groovyc/AriadneGraph$_mark_the_wellformed_f_closure3.class deleted file mode 100644 index 0740586..0000000 Binary files a/developer/groovyc/AriadneGraph$_mark_the_wellformed_f_closure3.class and /dev/null differ diff --git a/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure4.class b/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure4.class index 761a9b6..062667b 100644 Binary files a/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure4.class and b/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure4.class differ diff --git a/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure5.class b/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure5.class index 0ee5256..5d177fd 100644 Binary files a/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure5.class and b/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure5.class differ diff --git a/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure6.class b/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure6.class index 408e316..1b72f75 100644 Binary files a/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure6.class and b/developer/groovyc/AriadneGraph$_markup_graph_f_descend_closure6.class differ diff --git a/developer/groovyc/AriadneGraph$_newer_than_all_closure11.class b/developer/groovyc/AriadneGraph$_newer_than_all_closure11.class index 97d5002..ecf40dd 100644 Binary files a/developer/groovyc/AriadneGraph$_newer_than_all_closure11.class and b/developer/groovyc/AriadneGraph$_newer_than_all_closure11.class differ diff --git a/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure12.class b/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure12.class index 6129294..00e7821 100644 Binary files a/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure12.class and b/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure12.class differ diff --git a/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure13.class b/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure13.class new file mode 100644 index 0000000..d9301b8 Binary files /dev/null and b/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure13.class differ diff --git a/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure14.class b/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure14.class new file mode 100644 index 0000000..f0205aa Binary files /dev/null and b/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure14.class differ diff --git a/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure3.class b/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure3.class deleted file mode 100644 index 7cea6d1..0000000 Binary files a/developer/groovyc/AriadneGraph$_run_build_scripts_f_closure3.class and /dev/null differ diff --git a/developer/groovyc/AriadneGraph.class b/developer/groovyc/AriadneGraph.class index 1b538ca..c064680 100644 Binary files a/developer/groovyc/AriadneGraph.class and b/developer/groovyc/AriadneGraph.class differ diff --git a/developer/groovyc/AriadneGraph.groovy b/developer/groovyc/AriadneGraph.groovy index b65c1bc..93c7d12 100644 --- a/developer/groovyc/AriadneGraph.groovy +++ b/developer/groovyc/AriadneGraph.groovy @@ -143,85 +143,84 @@ class AriadneGraph { This must be run on the graph for `lookup_marked_good` to work. */ - /* - Given a node label list. Applies well_formed_q to each node and marks the - node accordingly. Returns 'all_wellformed' or 'exists_malformed'. - */ - def mark_the_wellformed_f(node_label_list ,boolean verbose = true){ - def all_wellformed = true - - def neighbors = node_label_list.collect{ neighbor_label -> - def neighbor_node = lookup(neighbor_label) - def form_errors = wellformed_q(neighbor_node) - if(form_errors.isEmpty()){ - neighbor_node.mark = neighbor_node.mark ?: [] as Set - neighbor_node.mark << 'wellformed' + def mark_node_form(node ,verbose = true){ + println("mark_node_form::node: ${node}") + + def form_errors = wellformed_q(node) + + if( form_errors.isEmpty() ){ + set_mark(node ,'wellformed'); + return 'wellformed' + } + + if(verbose){ + if(node.label && node.label.length() > 0){ + print("node ${neighbor_node.label} is malformed due to:") } else { - all_wellformed = false - if(verbose){ - if(neighbor_node.label && neighbor_node.label.length() > 0){ - print("node ${neighbor_node.label} is malformed due to:") - } else { - print("anonymous node is malformed due to:") - } - form_errors.each { error -> print(" ${error}") } - println("") - } + print("anonymous node is malformed due to:") } - neighbor_label + form_errors.each { error -> print(" ${error}") } + println("") } - return all_wellformed ? 'all_wellformed' : 'exists_malformed' + return 'malformed' } + /* Given a path stack initialized with the path root ,descends to a leaf node while looking for cycles. Marks nodes as 'cycle_member' if a cycle is detected. Marks nodes as `wellformed` if `wellformed_q`. Returns a set of - tokens indicating the status: 'cycle_found' ,'defacto_leaf_node' ,and + tokens indicating the status: 'cycle_found' ,'defacto_leaf' ,and 'exists_malformed'. + + the de-fact leaf node test .. + // a 'de-facto' leaf node test .. subtleties here because we have not yet + // determined if the nodes we are wellformed. This is purposeful ,as + // this function does not know about the relationships between the + // possible error marks. + + */ def markup_graph_f_descend(path_stack ,boolean verbose = true){ def ret_value = [] as Set + if( path_stack.isEmpty() ){ + println( "markup_graph_f_descend:: given null to descend from") + return ret_value + } def local_path = path_stack.collect{ it[0] } def local_node_label = local_path[-1] def cycle_start_index do{ + // Check for a cycle in the local path - cycle_start_index = local_path[0..-2].findIndexOf{ it == local_node_label } - if(cycle_start_index != -1){ // Cycle detected - ret_value << 'cycle_found' - if(verbose) print "markup_graph_f_descend:: dependency cycle found:" - local_path[cycle_start_index..-1].each{ cycle_node_label -> - def cycle_node = lookup(cycle_node_label) - if(verbose) print " ${cycle_node.label}" - cycle_node.mark = cycle_node.mark ?: [] as Set // Initialize mark set if needed - cycle_node.mark << 'cycle_member' + if( local_path.size() > 1){ + cycle_start_index = local_path[0..-2].findIndexOf{ it == local_node_label } + if(cycle_start_index != -1){ // Cycle detected + ret_value << 'cycle_found' + if(verbose) print "markup_graph_f_descend:: dependency cycle found:" + local_path[cycle_start_index..-1].each{ cycle_node_label -> + def cycle_node = lookup(cycle_node_label) + if(verbose) print " ${cycle_node.label}" + cycle_node.mark = cycle_node.mark ?: [] as Set // Initialize mark set if needed + cycle_node.mark << 'cycle_member' + } + if(verbose) println "" + // we can not continue searching after the loop so ,we pop back to treat + // the first node in the loop as though a leaf node. + path_stack = path_stack[0..cycle_start_index] + return ret_value } - if(verbose) println "" - // we can not continue searching after the loop so ,we pop back to treat - // the first node in the loop as though a leaf node. - path_stack = path_stack[0..cycle_start_index] - return ret_value } - // a 'de-facto' leaf node test subtleties here because we have not yet - // determined if the nodes we are wellformed. This is purposeful ,as - // this function does not know about the relationships between the - // possible error marks. def local_node = lookup(local_node_label) - if(local_node.neighbor.isEmpty()){ - ret_value << 'defacto_leaf_node' + if( mark_node_form(local_node) == 'malformed' ) ret_value << 'exists_malformed' + if( local_node.neighbor.isEmpty() ){ + ret_value << 'defacto_leaf' // might not be `type:leaf` return ret_value } - // Mark the wellformed nodes and get the result - def result = mark_the_wellformed_f(local_node.neighbor ,verbose) - if(result == 'exists_malformed'){ - ret_value << 'exists_malformed' - } - // Descend further into the tree. path_stack << local_node.neighbor.clone() local_node_label = local_node.neighbor[0] @@ -230,26 +229,22 @@ class AriadneGraph { } /* - Given root_node_labels ,marks up the graph and returns a set possibly + Given root_node_label_list ,marks up the graph and returns a set possibly containing 'all_wellformed' and 'cycles_exist'. Marks potentially added to each node include 'cycle_member' ,'wellformed'. Note that these marks are independent. */ - def wellformed_graph_q(root_node_labels ,boolean verbose = true){ + def wellformed_graph_q(root_node_label_list ,boolean verbose = true){ def ret_value = [] as Set def exists_malformed = false; def result // used variously - // check the root nodes - result = mark_the_wellformed_f(root_node_labels ,verbose) - if(result == 'exists_malformed'){ - ret_value << 'exists_malformed' - } - + if( root_node_label_list.isEmpty() ) return ret_value + // Initialize the DFS tree iterator. def path_stack = [] - path_stack << root_node_labels.clone() + path_stack << root_node_label_list.clone() // iterate over left side tree descent ,not ideal as it starts at the // root each time ,but avoids complexity in the cycle detection logic. @@ -280,11 +275,12 @@ class AriadneGraph { Graph traversal */ - Map lookup( String node_label ,boolean verbose = false ){ - def lookup_node = node_map[ node_label ] - if( !lookup_node ){ + Map lookup(String node_label ,boolean verbose = true){ + def lookup_node = this.node_map[node_label] + if(!lookup_node){ + if(verbose) println "lookup:: Node ${node_label} could not be found." def match_result - for( func in node_f_list ){ + for( func in this.node_f_list ){ match_result = func( node_label ) if( match_result.status == "matched" ){ lookup_node = match_result @@ -292,13 +288,13 @@ class AriadneGraph { } } } - - if( !lookup_node && verbose ) println "lookup:: Node ${node_label} could not be found." + lookup_node.label = node_label + if(verbose) println("lookup::node: ${lookup_node}") return lookup_node } // mark aware lookup function - def lookup_marked_good(node_label ,verbose = false){ + def lookup_marked_good(node_label ,verbose = true){ def node = lookup(node_label ,verbose) if( node && marked_good_q(node) ) return node; return null; @@ -306,36 +302,56 @@ class AriadneGraph { /* - Given `root_node_labels` of a DAG. Applies `node_function` to each node in a + Given `root_node_label_list` of a DAG. Applies `node_function` to each node in a depth-first traversal order. Returns a set of error tokens encountered during traversal. `wellformed_graph_q` must be run on the DAG before this function is called ,or `lookup_marked_good` will not function correctly. */ - def all_DAG_DF(root_node_labels ,node_function ,boolean verbose = true) { + def all_DAG_DF(root_node_label_list ,node_function ,boolean verbose = true) { + if(verbose) println("all_DAG_DF::") + def error_token_set = [] as Set - if (root_node_labels.isEmpty()) return error_token_set + def accept_arg_list = true + if( !node_function ){ + error_token_set << 'null_node_function' + accept_arg_list = false + } + if( !(node_function instanceof Closure) ){ + error_token_set << 'nod_function_not_a_function' + accept_arg_list = false + } + if( !root_node_label_list ){ + error_token_set << 'null_root_node_label_list' + accept_arg_list = false + } + if( root_node_label_list.isEmpty() ){ + error_token_set << 'empty_root_node_label_list' + accept_arg_list = false + } + if( !accept_arg_list ) return error_token_set def visited = [] as Set def in_traversal_order = [] - def stack = [] - root_node_labels.each { root_label -> + def stack = [] + root_node_label_list.each { root_label -> stack << root_label } do { + if( stack.isEmpty() ) break def node_label = stack.pop() def node = lookup_marked_good(node_label ,verbose) - if (!node) { + if(!node){ error_token_set << 'lookup_fail' continue } - if (node.label in visited) continue + if(node.label in visited) continue visited << node.label in_traversal_order << node @@ -343,10 +359,10 @@ class AriadneGraph { node.neighbor.each { neighbor_label -> stack << neighbor_label } - } while (!stack.isEmpty()) + } while(true) in_traversal_order.reverse().each { node -> - node_function(node ,error_token_set ,verbose) + node_function(node ,error_token_set) } return error_token_set @@ -415,48 +431,69 @@ class AriadneGraph { return false } - void run_build_scripts_f( List root_node_labels ,boolean verbose = true ){ - if( root_node_labels.isEmpty() ) return + void run_build_scripts_f( List root_node_label_list ,boolean verbose = true ){ + + if( root_node_label_list.isEmpty() ) return + Set error_token_set // used to catch return values - def node_function = { node ,error_token_set -> + println( "run_build_script:: Checking if graph is well formed." ) + error_token_set = wellformed_graph_q(root_node_label_list) + if( error_token_set && !error_token_set.isEmpty() ){ + println( "Graph is not well-formed. Expect build problems. Errors:" ) + error_token_set.each { token -> + println( " - ${token}" ) + } + } else { + println( "Graph is well-formed. Proceeding with build." ) + } + + def node_function = { node ,error_token_set_2 -> if( !can_be_built_q( node ) ){ - println( "Skipping build for ${node.label} due to dependency problems" ) + println( "run_build_scripts_f:: Skipping build for ${node.label} due to problems with dependencies." ) return } if( !should_be_built_q( node ) ){ - if( verbose ) println( "${node.label} already up to date" ) + if( verbose ) println( "run_build_scripts_f:: ${node.label} already up to date" ) return } - println( "Running build script for ${node.label}" ) - node.build( node ,node.neighbor ) + // build the target + println( "run_build_scripts_f:: Running build script for ${node.label}" ) + node.build() - if( should_be_built_q( node ) ){ - println( "Build failed for ${node.label}" ) - set_mark( node ,'build_failed' ) + // for path nodes, check if the build updated the target at path + if( node.type == 'path' && should_be_built_q( node ) ){ + println( "run_build_scripts_f:: Build failed for ${node.label}" ) + set_mark(node ,'build_failed') } + } - println( "run_build_scripts_f:: running ..." ) - all_DAG_DF( root_node_labels ,node_function ,verbose ) + println("run_build_scripts_f:: running ...") + error_token_set = all_DAG_DF(root_node_label_list, node_function, verbose) + if( error_token_set ){ + error_token_set.each { error -> + println("run_build_scripts_f::all_DAG_DF:: ${error}") + } + } + } - // Add the rest of your methods here as instance/static methods based on whether they depend on the graph instance } /* def clean(nodes_to_clean) { - def all_dependencies = node_map["all"].neighbor.clone() + def all_dependencies = this.node_map["all"].neighbor.clone() nodes_to_clean.each { node -> all_dependencies.remove(node) } def must_have_nodes = [] all_dependencies.each { node -> - def node_info = node_map[node] + def node_info = this.node_map[node] if (node_info.must_have) { must_have_nodes += node_info.must_have } @@ -464,13 +501,13 @@ class AriadneGraph { def to_clean_list = [] nodes_to_clean.each { node -> - if (!must_have_nodes.contains(node) && node_map[node].type == "path") { + if (!must_have_nodes.contains(node) && this.node_map[node].type == "path") { to_clean_list += node } } to_clean_list.each { node -> - def file_path = node_map[node].label + def file_path = this.node_map[node].label def file = new File(file_path) if (file.exists()) { file.delete() diff --git a/release_candidate/AriadneGraph$_all_DAG_DF_closure7.class b/release_candidate/AriadneGraph$_all_DAG_DF_closure7.class index 4231e36..8857e4d 100644 Binary files a/release_candidate/AriadneGraph$_all_DAG_DF_closure7.class and b/release_candidate/AriadneGraph$_all_DAG_DF_closure7.class differ diff --git a/release_candidate/AriadneGraph$_all_DAG_DF_closure8.class b/release_candidate/AriadneGraph$_all_DAG_DF_closure8.class index a0125cf..48d0c81 100644 Binary files a/release_candidate/AriadneGraph$_all_DAG_DF_closure8.class and b/release_candidate/AriadneGraph$_all_DAG_DF_closure8.class differ diff --git a/release_candidate/AriadneGraph$_all_DAG_DF_closure9.class b/release_candidate/AriadneGraph$_all_DAG_DF_closure9.class index 799d4d7..7be96ed 100644 Binary files a/release_candidate/AriadneGraph$_all_DAG_DF_closure9.class and b/release_candidate/AriadneGraph$_all_DAG_DF_closure9.class differ diff --git a/release_candidate/AriadneGraph$_good_dependency_q_closure10.class b/release_candidate/AriadneGraph$_good_dependency_q_closure10.class index e02400f..b4b33ad 100644 Binary files a/release_candidate/AriadneGraph$_good_dependency_q_closure10.class and b/release_candidate/AriadneGraph$_good_dependency_q_closure10.class differ diff --git a/release_candidate/AriadneGraph$_mark_node_form_closure3.class b/release_candidate/AriadneGraph$_mark_node_form_closure3.class new file mode 100644 index 0000000..9d962ba Binary files /dev/null and b/release_candidate/AriadneGraph$_mark_node_form_closure3.class differ diff --git a/release_candidate/AriadneGraph$_mark_the_wellformed_f_closure3$_closure13.class b/release_candidate/AriadneGraph$_mark_the_wellformed_f_closure3$_closure13.class deleted file mode 100644 index 1df2a60..0000000 Binary files a/release_candidate/AriadneGraph$_mark_the_wellformed_f_closure3$_closure13.class and /dev/null differ diff --git a/release_candidate/AriadneGraph$_mark_the_wellformed_f_closure3.class b/release_candidate/AriadneGraph$_mark_the_wellformed_f_closure3.class deleted file mode 100644 index 0740586..0000000 Binary files a/release_candidate/AriadneGraph$_mark_the_wellformed_f_closure3.class and /dev/null differ diff --git a/release_candidate/AriadneGraph$_markup_graph_f_descend_closure4.class b/release_candidate/AriadneGraph$_markup_graph_f_descend_closure4.class index 761a9b6..062667b 100644 Binary files a/release_candidate/AriadneGraph$_markup_graph_f_descend_closure4.class and b/release_candidate/AriadneGraph$_markup_graph_f_descend_closure4.class differ diff --git a/release_candidate/AriadneGraph$_markup_graph_f_descend_closure5.class b/release_candidate/AriadneGraph$_markup_graph_f_descend_closure5.class index 0ee5256..5d177fd 100644 Binary files a/release_candidate/AriadneGraph$_markup_graph_f_descend_closure5.class and b/release_candidate/AriadneGraph$_markup_graph_f_descend_closure5.class differ diff --git a/release_candidate/AriadneGraph$_markup_graph_f_descend_closure6.class b/release_candidate/AriadneGraph$_markup_graph_f_descend_closure6.class index 408e316..1b72f75 100644 Binary files a/release_candidate/AriadneGraph$_markup_graph_f_descend_closure6.class and b/release_candidate/AriadneGraph$_markup_graph_f_descend_closure6.class differ diff --git a/release_candidate/AriadneGraph$_newer_than_all_closure11.class b/release_candidate/AriadneGraph$_newer_than_all_closure11.class index 97d5002..ecf40dd 100644 Binary files a/release_candidate/AriadneGraph$_newer_than_all_closure11.class and b/release_candidate/AriadneGraph$_newer_than_all_closure11.class differ diff --git a/release_candidate/AriadneGraph$_run_build_scripts_f_closure12.class b/release_candidate/AriadneGraph$_run_build_scripts_f_closure12.class index 6129294..00e7821 100644 Binary files a/release_candidate/AriadneGraph$_run_build_scripts_f_closure12.class and b/release_candidate/AriadneGraph$_run_build_scripts_f_closure12.class differ diff --git a/release_candidate/AriadneGraph$_run_build_scripts_f_closure13.class b/release_candidate/AriadneGraph$_run_build_scripts_f_closure13.class new file mode 100644 index 0000000..d9301b8 Binary files /dev/null and b/release_candidate/AriadneGraph$_run_build_scripts_f_closure13.class differ diff --git a/release_candidate/AriadneGraph$_run_build_scripts_f_closure14.class b/release_candidate/AriadneGraph$_run_build_scripts_f_closure14.class new file mode 100644 index 0000000..f0205aa Binary files /dev/null and b/release_candidate/AriadneGraph$_run_build_scripts_f_closure14.class differ diff --git a/release_candidate/AriadneGraph$_run_build_scripts_f_closure3.class b/release_candidate/AriadneGraph$_run_build_scripts_f_closure3.class deleted file mode 100644 index 7cea6d1..0000000 Binary files a/release_candidate/AriadneGraph$_run_build_scripts_f_closure3.class and /dev/null differ diff --git a/release_candidate/AriadneGraph.class b/release_candidate/AriadneGraph.class index 1b538ca..c064680 100644 Binary files a/release_candidate/AriadneGraph.class and b/release_candidate/AriadneGraph.class differ diff --git a/release_candidate/build b/release_candidate/build index 1acf09b..2fb7a39 100755 --- a/release_candidate/build +++ b/release_candidate/build @@ -10,9 +10,18 @@ def include_a_class( a_class_fp ){ } } -// Main build function for the Shell UI -def build(graph_definition_fp){ - // Load the graph class dynamically +// Shell User Interface to the build function +def build(graph_definition_fp, root_node_labels){ + + // Print summary of what we are doing + println "Summary: Building targets for graph '${graph_definition_fp}.class'" + if (root_node_labels.isEmpty()) { + println "No build targets specified. Please provide root node labels to build." + System.exit(0) + } + println "Building targets: ${root_node_labels.join(', ')}" + + // Load the dependency graph class from arg[1] def graph_definition_class = include_a_class(graph_definition_fp) if(graph_definition_class){ println "build:: loaded ${graph_definition_fp}.class" @@ -24,20 +33,23 @@ def build(graph_definition_fp){ // Get the node_map and node_f_list from the graph class def node_map = graph_definition_class.get_node_map() def node_f_list = graph_definition_class.get_node_f_list() - // println "node_map: ${node_map}" - // println "node_f_list: ${node_f_list}" + println "node_map: ${node_map}" + println "node_f_list: ${node_f_list}" - graph = new AriadneGraph(node_map ,node_f_list) - - // Call the build function in AriadneGraph - // AriadneGraph.run_build_scripts_f(node_map ,node_f_list) + // Create an instance of AriadneGraph, and run the build scripts + def graph = new AriadneGraph(node_map ,node_f_list) + graph.run_build_scripts_f(root_node_labels) } // Entry point for the script if(args.length == 0){ - println "Usage: ./build " + println "Usage: ./build [root_node_labels...]" System.exit(1) } +// Get graph definition file and root node labels def graph_definition_fp = args[0] -build( graph_definition_fp ) +def root_node_labels = args.length > 1 ? args[1..-1] : [] + +build(graph_definition_fp, root_node_labels) + diff --git a/tester/test0/env_test b/tester/test0/env_test new file mode 100644 index 0000000..31113a7 --- /dev/null +++ b/tester/test0/env_test @@ -0,0 +1,11 @@ + +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/test0\ +:$CLASSPATH + diff --git a/tester/test0/env_test0 b/tester/test0/env_test0 deleted file mode 100644 index 31113a7..0000000 --- a/tester/test0/env_test0 +++ /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/test0\ -:$CLASSPATH - diff --git a/tester/test0/test.sh b/tester/test0/test.sh new file mode 100755 index 0000000..39be135 --- /dev/null +++ b/tester/test0/test.sh @@ -0,0 +1,8 @@ +#!/bin/env bash + +# smoke test, and yes, there was a lot of smoke + +source env_test +build TestGraph +echo "test0 complete" + diff --git a/tester/test0/test0.sh b/tester/test0/test0.sh deleted file mode 100755 index 8e43b74..0000000 --- a/tester/test0/test0.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/env bash - -# smoke test, and yes, there was a lot of smoke - -source env_test0 -build TestGraph -echo "test0 complete" - diff --git a/tester/test1/TestGraph.groovy b/tester/test1/TestGraph.groovy new file mode 100644 index 0000000..660d182 --- /dev/null +++ b/tester/test1/TestGraph.groovy @@ -0,0 +1,21 @@ + +class TestGraph{ + + static def get_node_map(){ + return [ + 'title': [ + type: 'symbol' + ,neighbor: [] + ,build: { + println "TestGraph for test1" + } + ]] + } + + // Static method to define the function list + static def get_node_f_list(){ + return [] + } +} + +// LocalWords: TestGraph diff --git a/tester/test1/env_test b/tester/test1/env_test new file mode 100644 index 0000000..cdf0612 --- /dev/null +++ b/tester/test1/env_test @@ -0,0 +1,11 @@ + +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/test1\ +:$CLASSPATH + diff --git a/tester/test1/test.sh b/tester/test1/test.sh new file mode 100755 index 0000000..340a6d1 --- /dev/null +++ b/tester/test1/test.sh @@ -0,0 +1,16 @@ +#!/bin/env bash + +# smoke test, and yes, there was a lot of smoke + +source env_test + +echo "test 0 will complain there are no build targets" +build TestGraph +echo "" + +echo "test 1 will print the graph title" +build TestGraph title +echo "" + +echo "test complete" + diff --git a/tester/test1/transcript_dev.txt b/tester/test1/transcript_dev.txt new file mode 100644 index 0000000..7ee5492 --- /dev/null +++ b/tester/test1/transcript_dev.txt @@ -0,0 +1,78 @@ +2024-10-06T07:23:25Z[] +Thomas-developer@Blossac§/var/user_data/Thomas-developer§ +> repo Ariadne +REPO_HOME /var/user_data/Thomas-developer/Ariadne +PROJECT Ariadne +/var/user_data/Thomas-developer/Ariadne/executor/env_base complete +/var/user_data/Thomas-developer/Ariadne/developer/executor/env_build complete +/var/user_data/Thomas-developer/Ariadne/executor/env_dev complete + +2024-10-06T07:23:34Z[Ariadne] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/developer§ +> ls +. .. deprecated document executor groovy groovyc scratch_pad + +2024-10-06T07:23:37Z[Ariadne] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/developer§ +> ls groovy +. .. build + +2024-10-06T07:23:40Z[Ariadne] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/developer§ +> ls groovyc +. .. AriadneGraph.groovy + +2024-10-06T07:23:44Z[Ariadne] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/developer§ +> make.sh + +2024-10-06T07:23:53Z[Ariadne] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/developer§ +> ls groovy +. .. build + +2024-10-06T07:23:56Z[Ariadne] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/developer§ +> ls groovyc/ + . + .. +'AriadneGraph$_all_DAG_DF_closure7.class' +'AriadneGraph$_all_DAG_DF_closure8.class' +'AriadneGraph$_all_DAG_DF_closure9.class' +'AriadneGraph$_good_dependency_q_closure10.class' +'AriadneGraph$_mark_node_form_closure3.class' +'AriadneGraph$_markup_graph_f_descend_closure4.class' +'AriadneGraph$_markup_graph_f_descend_closure5.class' +'AriadneGraph$_markup_graph_f_descend_closure6.class' +'AriadneGraph$_newer_than_all_closure11.class' +'AriadneGraph$_run_build_scripts_f_closure12.class' +'AriadneGraph$_run_build_scripts_f_closure13.class' +'AriadneGraph$_run_build_scripts_f_closure14.class' +'AriadneGraph$_wellformed_q_closure1.class' +'AriadneGraph$_wellformed_q_closure2.class' + AriadneGraph.class + AriadneGraph.groovy + +2024-10-06T07:23:59Z[Ariadne] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/developer§ +> release +Installed build to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r,ug+x +Installed AriadneGraph.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_wellformed_q_closure1.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_wellformed_q_closure2.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_mark_node_form_closure3.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_markup_graph_f_descend_closure4.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_markup_graph_f_descend_closure5.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_markup_graph_f_descend_closure6.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_all_DAG_DF_closure7.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_all_DAG_DF_closure8.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_all_DAG_DF_closure9.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_good_dependency_q_closure10.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_newer_than_all_closure11.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_run_build_scripts_f_closure12.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_run_build_scripts_f_closure13.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r +Installed AriadneGraph$_run_build_scripts_f_closure14.class to /var/user_data/Thomas-developer/Ariadne/release_candidate with permissions ug+r + +2024-10-06T07:24:08Z[Ariadne] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/developer§ +> diff --git a/tester/test1/transcript_tester.txt b/tester/test1/transcript_tester.txt new file mode 100644 index 0000000..9ccc393 --- /dev/null +++ b/tester/test1/transcript_tester.txt @@ -0,0 +1,54 @@ +2024-10-06T07:25:26Z[] +Thomas-developer@Blossac§/var/user_data/Thomas-developer§ +> cd Ariadne + +2024-10-06T07:25:41Z[] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne§ +> source executor/env_tester +REPO_HOME /var/user_data/Thomas-developer/Ariadne +PROJECT Ariadne +/var/user_data/Thomas-developer/Ariadne/executor/env_base complete +executor/env_tester complete + +2024-10-06T07:25:49Z[Ariadne_TESTER] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/tester§ +> cd test1 + +2024-10-06T07:25:55Z[Ariadne_TESTER] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/tester/test1§ +> ls +. .. env_test TestGraph.groovy test.sh + +2024-10-06T07:25:56Z[Ariadne_TESTER] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/tester/test1§ +> make.sh + +2024-10-06T07:26:28Z[Ariadne_TESTER] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/tester/test1§ +> ./test.sh +test 0 will complain there are no build targets +Summary: Building targets for graph 'TestGraph.class' +No build targets specified. Please provide root node labels to build. + +test 1 will print the graph title +Summary: Building targets for graph 'TestGraph.class' +Building targets: title +build:: loaded TestGraph.class +node_map: [title:[type:symbol, neighbor:[], build:TestGraph$_get_node_map_closure1@3fae596]] +node_f_list: [] +run_build_script:: Checking if graph is well formed. +lookup::node: [type:symbol, neighbor:[], build:TestGraph$_get_node_map_closure1@3fae596, label:title] +mark_node_form::node: [type:symbol, neighbor:[], build:TestGraph$_get_node_map_closure1@3fae596, label:title] +Graph is not well-formed. Expect build problems. Errors: + - all_wellformed +run_build_scripts_f:: running ... +all_DAG_DF:: +lookup::node: [type:symbol, neighbor:[], build:TestGraph$_get_node_map_closure1@3fae596, label:title, mark:[wellformed]] +run_build_scripts_f:: Running build script for title +TestGraph for test1 + +test complete + +2024-10-06T07:26:37Z[Ariadne_TESTER] +Thomas-developer@Blossac§/var/user_data/Thomas-developer/Ariadne/tester/test1§ +>