Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions .scripts/transform_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand All @@ -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]):
Expand All @@ -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
Expand Down Expand Up @@ -370,6 +387,12 @@ def create_plantuml_stdlib_c4_folder(target_path):
inclusive_endif,
"!include <C4/C4_Component>",
)
replace_first_regex_copy_file(
"C4_Sequence.puml",
os.path.join(target_path, "C4_Sequence.puml"),
inclusive_endif,
"!include <C4/C4_Component>",
)

replace_first_regex_copy_file(
"./.scripts/plantuml_stdlib_info.txt",
Expand Down
2 changes: 1 addition & 1 deletion C4.puml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down