diff --git a/calexium_lib b/calexium_lib index 891e24c..b3734f8 160000 --- a/calexium_lib +++ b/calexium_lib @@ -1 +1 @@ -Subproject commit 891e24cfc2eca3152e2cf33c5963979d963b7bae +Subproject commit b3734f8f0b4bf27ade1712f3c159380ddd828acb diff --git a/densaku_lib b/densaku_lib index e19a5e6..fedd3d9 160000 --- a/densaku_lib +++ b/densaku_lib @@ -1 +1 @@ -Subproject commit e19a5e659e24d4bf9c97e5a4f313f80a86414f5e +Subproject commit fedd3d949174b60ead3215c6aea0f8bf3e73e053 diff --git a/src/generation/files.anubis b/src/generation/files.anubis index 46daf21..9714bae 100644 --- a/src/generation/files.anubis +++ b/src/generation/files.anubis @@ -35,7 +35,7 @@ public define Maybe(One) println("Destination dir: "+destination_dir); with ini = loadIniFile(destination_dir+"/densaku.ini"), - with types_SHA1 = "::", //readString(ini, "TYPES", "SHA1", "N/A"), + with types_SHA1 = readString(ini, "TYPES", "SHA1", "N/A"), with messages_SHA1 = readString(ini, "MESSAGES", "SHA1", "N/A"), println("Saved Types SHA1 = "+types_SHA1); @@ -55,25 +55,26 @@ public define Maybe(One) { failure then failure, success(_) then - println("Generating types and message files"); make_all_types(output_dir, file_name, types, destination_dir); - + println("Generating messages collection"); make_all_messages(messages, destination_dir); - + println("Generating graphviz"); - forget(make_graphviz_types(types, destination_dir)); - - writeString(ini, "TYPES", "SHA1", current_types_SHA1); - writeString(ini, "MESSAGES", "SHA1", current_messages_SHA1); - writeIniInfo(ini); + forget(make_graphviz_types(output_dir, file_name, types, destination_dir)); + success(unique) }, type_files) is { failure then failure, - success(_) then success(unique) + success(_) then + forget(make_graphviz_types(relative_path(""), auto, get_all_types(type_files), destination_dir)); + writeString(ini, "TYPES", "SHA1", current_types_SHA1); + writeString(ini, "MESSAGES", "SHA1", current_messages_SHA1); + writeIniInfo(ini); + success(unique) } . diff --git a/src/generation/graphviz/graphviz_main.anubis b/src/generation/graphviz/graphviz_main.anubis index 44a01b3..a5afbd4 100644 --- a/src/generation/graphviz/graphviz_main.anubis +++ b/src/generation/graphviz/graphviz_main.anubis @@ -8,6 +8,7 @@ read tools/basis.anubis read tools/streams.anubis +read system/string.anubis read densaku_lib/types/densaku.anubis read generation/graphviz/graphviz_header.anubis read generation/graphviz/graphviz_type.anubis @@ -15,11 +16,25 @@ read generation/graphviz/graphviz_type.anubis public define Maybe(One) make_graphviz_types ( - List(DS_Type) types, - String destination_dir + DS_Type_File_Output_Dir out_dir, + DS_Type_File_Output_Name output_file_name, + List(DS_Type) types, + String destination_dir )= - with file_name = destination_dir+"types/generated/graphviz.gv", + with final_destination_dir = + if out_dir is + { + auto then destination_dir + "types/generated/", + relative_path(path) then destination_dir + path + "/", + absolute_path(path) then path + }, + with file_name = if output_file_name is + { + auto then final_destination_dir+"graphviz.gv", + name(_file_name) then final_destination_dir+to_lower(_file_name)+".gv", + }, + if file(file_name, new) is { failure then println("can't create file "+file_name);failure, diff --git a/src/generation/types.anubis b/src/generation/types.anubis index d2d5c88..6d0fe7d 100644 --- a/src/generation/types.anubis +++ b/src/generation/types.anubis @@ -82,7 +82,18 @@ define String join("\n", map((String intermediate) |-> - "public type "+intermediate+":..." + "public type "+intermediate+":...\n\n"+ + "public define Maybe("+intermediate+")\n"+ +" from_Message\n"+ +" (\n"+ +" Message _"+to_lower(intermediate)+"_message\n"+ +" )\n"+ +".\n\n"+ +"public define Message\n"+ +" to_Message\n"+ +" (\n"+ +" "+intermediate+" _"+to_lower(intermediate)+"\n"+ +" ).\n" , final_list ) @@ -206,7 +217,7 @@ public define One types) name(_file_name) then - with file_name = final_destination_dir+_file_name+".anubis", + with file_name = final_destination_dir+to_lower(_file_name)+".anubis", with header = generate_header, with file_parts = -- libgit2 0.21.4