diff --git a/.scripts/transform_files.py b/.scripts/transform_files.py index e16b96ce..569fb327 100644 --- a/.scripts/transform_files.py +++ b/.scripts/transform_files.py @@ -229,7 +229,7 @@ def update_c4_next_beta_version(): def update_all_includes(): # reference tag version is with starting 'v' - print(f"updating include paths with new tag version {release_version} ...") + print(f"updating include/theme paths with new tag version {release_version} ...") files = glob.glob("./**/*", recursive=True) for file in files: if file.endswith(".puml") or file.endswith(".md"): @@ -239,8 +239,17 @@ def update_all_includes(): "!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/", f"!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/{release_version}/", ) - - print("include paths updated") + replace_in_file( + file, + "from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/", + f"from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/{release_version}/", + ) + replace_in_file( + file, + "](https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/themes/", + f"](https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/{release_version}/themes/", + ) + print(f"include/theme paths updated") def process_url_match(m: re.Match[str]): @@ -254,6 +263,14 @@ def process_url_match(m: re.Match[str]): "!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/", new_path, ) + replaced = replaced.replace( + "from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/", + f"from https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/{release_version}/", + ) + replaced = replaced.replace( + "](https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/themes/", + f"](https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/{release_version}/themes/", + ) if new_path not in replaced: global found_not_replaced_include @@ -370,6 +387,12 @@ def create_plantuml_stdlib_c4_folder(target_path): inclusive_endif, "!include ", ) + replace_first_regex_copy_file( + "C4_Sequence.puml", + os.path.join(target_path, "C4_Sequence.puml"), + inclusive_endif, + "!include ", + ) replace_first_regex_copy_file( "./.scripts/plantuml_stdlib_info.txt", diff --git a/C4.puml b/C4.puml index ec5a0a86..d98649f4 100644 --- a/C4.puml +++ b/C4.puml @@ -4,7 +4,7 @@ ' ################################## !function C4Version() ' 2 spaces and ' are used as unique marker, that the release scripts makes the correct version update - !$c4Version = "2.6.1beta1" + !$c4Version = "2.8.0beta1" !return $c4Version !end function