From 93fa13c44c86861719a8c2438903468a4a9d6f7c Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Mon, 7 Oct 2024 08:15:23 +0000 Subject: [PATCH] adds documnt/groovy_hardfail with transcript --- developer/javac/Build.java | 76 ++++++++++++++++++++++++++++++++++++ developer/jvm/Ariadne.jar | Bin 30833 -> 32775 bytes document/goovy_hardfail.txt | 1 + 3 files changed, 77 insertions(+) create mode 100644 developer/javac/Build.java diff --git a/developer/javac/Build.java b/developer/javac/Build.java new file mode 100644 index 0000000..b0cdab3 --- /dev/null +++ b/developer/javac/Build.java @@ -0,0 +1,76 @@ +import java.util.List; + +public class Build { + + // Function to load the graph class dynamically + public static Class includeAClass(String aClassFp) { + ClassLoader classLoader = Build.class.getClassLoader(); + String className = aClassFp.replace('/', '.').replace(".class", ""); + try { + return classLoader.loadClass(className); + } catch (Exception e) { + System.out.println("Error loading class '" + className + "': " + e.getMessage()); + return null; + } + } + + // Build function + public static void build(String graphDefinitionFp, List rootNodeLabels) { + // Print summary of what we are doing + System.out.println("build:: Building targets for graph '" + graphDefinitionFp + ".class'"); + if (rootNodeLabels.isEmpty()) { + System.out.println("No build targets specified. Please provide root node labels to build."); + System.exit(0); + } + System.out.println("Building targets: " + String.join(", ", rootNodeLabels)); + + // Load the dependency graph class from arg[1] + Class graphDefinitionClass = includeAClass(graphDefinitionFp); + if (graphDefinitionClass != null) { + System.out.println("build:: loaded " + graphDefinitionFp + ".class"); + } else { + System.out.println("build:: failed to load " + graphDefinitionFp + ".class"); + System.exit(1); + } + + // Get the node_map and node_f_list from the graph class + // Assuming these methods are static and return the appropriate types + // Replace with actual method calls if they are different + Object nodeMap = null; + Object nodeFList = null; + try { + nodeMap = graphDefinitionClass.getMethod("getNodeMap").invoke(null); + nodeFList = graphDefinitionClass.getMethod("getNodeFList").invoke(null); + } catch (Exception e) { + System.out.println("Error invoking methods on graphDefinitionClass: " + e.getMessage()); + System.exit(1); + } + System.out.println("node_map: " + nodeMap); + System.out.println("node_f_list: " + nodeFList); + + // Create an instance of AriadneGraph, and run the build scripts + // Assuming AriadneGraph has a constructor that takes nodeMap and nodeFList + // Replace with actual constructor call if it is different + try { + Class ariadneGraphClass = Class.forName("AriadneGraph"); + Object graph = ariadneGraphClass.getConstructor(nodeMap.getClass(), nodeFList.getClass()).newInstance(nodeMap, nodeFList); + ariadneGraphClass.getMethod("runBuildScriptsF", List.class).invoke(graph, rootNodeLabels); + } catch (Exception e) { + System.out.println("Error creating or invoking AriadneGraph: " + e.getMessage()); + System.exit(1); + } + } + + // Entry point when run as a script + public static void main(String[] args) { + if (args.length == 0) { + System.out.println("Usage: ./build [root_node_labels...]"); + System.exit(1); + } + + // Get graph definition file and root node labels + String graphDefinitionFp = args[0]; + List rootNodeLabels = args.length > 1 ? List.of(args).subList(1, args.length) : List.of(); + build(graphDefinitionFp, rootNodeLabels); + } +} diff --git a/developer/jvm/Ariadne.jar b/developer/jvm/Ariadne.jar index c679924ded28a881847f31d45be0fab20301ed06..42313a5a8de3ba938a894ce5a6ca7a07b379eb7f 100644 GIT binary patch delta 2344 zcmY+Gdpr}|AICRr?ny4gq>D9SWGv=rCyTCo>`LRS|Lv& zilIp6n)_Xv+^-oWm(tJl`u%=A=e*8&f6wQ8&Uu~l*Y_is2i~|UB4dvg6;lLANJs!6 zmiJ`LL^ftjTd7-2G zELfYHyj z)_48&gn?$%k-`R{ggExqE3X#^FNZLG4zA6$zga)Pkn6Gg3u9&nRkuwTvq`utqjm5B z|2|H`Zb7kG<>3Y5H6}(a)EH#W9#PzZ-L>~wMsm9($Ih@SN$fnUOUn^uZ`1a6MNwW# zJ6&;G*@bz`D6xv~gdxKf6rHL&LLX);f}JGwbtJ9dQ!#n^TG~d;xBKTEVSh7{*neX^ z@8#@{TyRpT7T?}286$SD@gJk8iG0_Ds4)i~Yq%&0Gx?}ktHH5lvLlvs)yL5&2|aV2=klwAFL( zh3yr|{BU@9PcnZ^^2$yd+XnoAZXJ@l`+|oHlDT6+6Wt)XL}9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4J786WB^uEoTkPF;{Pa*VFZ~S zR%r>MCRSE}DDEmd5anGJ3ZfQ4sGn8gAYM>)Jc!y1p+suHywaLrkl-l@C0`5XmDEOq x1TWS`fGF*{SP<0(pNRE3fLGJUKcU|0RRf$X?Xwu diff --git a/document/goovy_hardfail.txt b/document/goovy_hardfail.txt index a7d221a..0703abc 100644 --- a/document/goovy_hardfail.txt +++ b/document/goovy_hardfail.txt @@ -1,3 +1,4 @@ + Tried many variations, including using 'groovy' instead of java to run it. Also did -cp on the command line. Nothing can convince `java` to find the class created by groovyc. When build is instead made into a script -- 2.20.1