From 1639d4114640502162764aca5a95e8c54a21df90 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Sun, 15 Sep 2024 22:42:49 -0500 Subject: [PATCH 01/12] chore: set CLI as first project in solution Because Visual Studio stores the startup project in the user settings for a solution, when one is not set up yet -- such as after cloning the repo locally and running it for the first time -- it will default to the first project listed in the .sln file. Since the CLI project is the end goal, switching up the order in the file to fit this behavior. #100 --- C4InterFlow.sln | 4 +++- Samples/dotnet.eShop/DotNetEShop.sln | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/C4InterFlow.sln b/C4InterFlow.sln index 6a4a53e12..bac9919b1 100644 --- a/C4InterFlow.sln +++ b/C4InterFlow.sln @@ -3,11 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.4.33110.190 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "C4InterFlow.Cli", "C4InterFlow.Cli\C4InterFlow.Cli.csproj", "{EB78BBEC-4D8A-456C-90F1-920E45FFF982}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "C4InterFlow", "C4InterFlow\C4InterFlow.csproj", "{B047B5AE-FA9A-453E-B522-F53ED61A0C80}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "C4InterFlow.Automation", "C4InterFlow.Automation\C4InterFlow.Automation.csproj", "{5DD6985D-35AC-4154-B09B-2186AB9AA3AD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C4InterFlow.Cli", "C4InterFlow.Cli\C4InterFlow.Cli.csproj", "{EB78BBEC-4D8A-456C-90F1-920E45FFF982}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B5B62581-615E-45C5-8A4A-3FEC83B827F6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Samples/dotnet.eShop/DotNetEShop.sln b/Samples/dotnet.eShop/DotNetEShop.sln index 6b9115ffe..9ac0f5101 100644 --- a/Samples/dotnet.eShop/DotNetEShop.sln +++ b/Samples/dotnet.eShop/DotNetEShop.sln @@ -3,10 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34309.116 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetEShop", "DotNetEShop\DotNetEShop.csproj", "{F18C0E05-2B41-4508-B91D-3B84E0535E99}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetEShop.Cli", "DotNetEShop.Cli\DotNetEShop.Cli.csproj", "{0DEABC5C-3A2C-42FE-91B6-E326BA6CF65D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetEShop", "DotNetEShop\DotNetEShop.csproj", "{F18C0E05-2B41-4508-B91D-3B84E0535E99}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "C4InterFlow", "..\..\C4InterFlow\C4InterFlow.csproj", "{C7E5280A-0FD1-4916-BB13-7F57A5E5274B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "C4InterFlow.Automation", "..\..\C4InterFlow.Automation\C4InterFlow.Automation.csproj", "{E47ACFF1-7BAC-4538-9558-D7AA04939546}" From 95548b6a1e71ab86a529b09b4ae8cb9cceb19641 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Sun, 15 Sep 2024 23:03:14 -0500 Subject: [PATCH 02/12] chore: update launchSettings to target E-Commerce Platform It makes sense that the default execution should be against something that already exists in the repository. Tried to make this match the 'draw-diagrams.bat' file in the directory, the output doesn't quite match any more. #100 --- C4InterFlow.Cli/Properties/launchSettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4InterFlow.Cli/Properties/launchSettings.json b/C4InterFlow.Cli/Properties/launchSettings.json index cb7bfcb80..a8b55f818 100644 --- a/C4InterFlow.Cli/Properties/launchSettings.json +++ b/C4InterFlow.Cli/Properties/launchSettings.json @@ -1,8 +1,8 @@ { "profiles": { "C4InterFlow.Cli": { - "commandName": "Project", - "commandLineArgs": "draw-diagrams --interfaces ECommercePlatform.SoftwareSystems.*.Interfaces.* ECommercePlatform.SoftwareSystems.*.Containers.*.Interfaces.* ECommercePlatform.SoftwareSystems.*.Containers.*.Components.*.Interfaces.* ECommercePlatform.*.SoftwareSystems.*.Interfaces.* ECommercePlatform.*.SoftwareSystems.*.Containers.*.Interfaces.* ECommercePlatform.*.SoftwareSystems.*.Containers.*.Components.*.Interfaces.* --namespaces ECommercePlatform ECommercePlatform.FrontEnd --levels-of-details context container --scopes namespace namespace-software-systems --types c4-static --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"C:\\C4InterFlow\\Samples\\Temp\\Architecture\" --output-dir \"C:\\C4InterFlow\\Samples\\Temp\\Diagrams\"" + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces ..SoftwareSystems.*.Interfaces.* ..SoftwareSystems.*.Containers.*.Interfaces.* --business-processes ECommercePlatform.BusinessProcesses.* --levels-of-details context container --scopes namespace namespace-software-systems --types c4-static --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\E-Commerce Platform\\Yaml\\Architecture\" --output-dir \"$(ProjectDir)\\..\\Samples\\E-Commerce Platform\\Yaml\\Diagrams\"" } } } \ No newline at end of file From e1ae79b8ebe15259df06b630eb75bbc8930134a1 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Sun, 15 Sep 2024 23:03:56 -0500 Subject: [PATCH 03/12] doc: add the start of the CONTRIBUTING document #100 --- CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..04f12d01e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing to C4InterFlow + +## As a Developer + +C4InterFlow is developed on dotnet core, and so far development has been done on a Windows machine with Visual Studio. +Editor files have been put in place to enforce consistency where applicable. + +### Environment Prerequisites + +* Windows environment + * All testing scripts are currently utilizing Windows Batch files. +* Visual Studio (able to support dotnet 6 or later) +* Java JRE + * Necessary to execute the `plantuml.jar` file to render diagrams + +## As a tester + +## All Others \ No newline at end of file From ff67c5ad3e0de43630cf00a10b9e268474d48459 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Mon, 16 Sep 2024 00:04:25 -0500 Subject: [PATCH 04/12] chore: establish EditorConfig settings This helps bring in a consistent set of settings that apply to the codebase as a whole, and do not depend on the individual's IDE settings. This also helps be explicit on what analyzer settings are enforced vs. what ones the project does not wish to adhere to. #100 --- .editorconfig | 609 +++++++++++++++++++++++++++ C4InterFlow.sln | 3 + Samples/dotnet.eShop/DotNetEShop.sln | 13 +- 3 files changed, 621 insertions(+), 4 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..4184e1343 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,609 @@ + +[*.{cs,vb}] +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = silent +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = silent +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = silent +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_code_quality_unused_parameters = all:suggestion +dotnet_diagnostic.CA1000.severity = silent +dotnet_diagnostic.CA1001.severity = silent +dotnet_diagnostic.CA1002.severity = suggestion +dotnet_diagnostic.CA1003.severity = suggestion +dotnet_diagnostic.CA1005.severity = suggestion +dotnet_diagnostic.CA1008.severity = suggestion +dotnet_diagnostic.CA1010.severity = silent +dotnet_diagnostic.CA1012.severity = suggestion +dotnet_diagnostic.CA1014.severity = suggestion +dotnet_diagnostic.CA1016.severity = suggestion +dotnet_diagnostic.CA1017.severity = warning +dotnet_diagnostic.CA1018.severity = suggestion +dotnet_diagnostic.CA1019.severity = suggestion +dotnet_diagnostic.CA1021.severity = suggestion +dotnet_diagnostic.CA1024.severity = suggestion +dotnet_diagnostic.CA1027.severity = warning +dotnet_diagnostic.CA1028.severity = warning +dotnet_diagnostic.CA1030.severity = warning +dotnet_diagnostic.CA1031.severity = suggestion +dotnet_diagnostic.CA1033.severity = warning +dotnet_diagnostic.CA1034.severity = suggestion +dotnet_diagnostic.CA1036.severity = silent +dotnet_diagnostic.CA1040.severity = warning +dotnet_diagnostic.CA1041.severity = suggestion +dotnet_diagnostic.CA1043.severity = warning +dotnet_diagnostic.CA1044.severity = warning +dotnet_diagnostic.CA1045.severity = warning +dotnet_diagnostic.CA1046.severity = warning +dotnet_diagnostic.CA1050.severity = suggestion +dotnet_diagnostic.CA1051.severity = silent +dotnet_diagnostic.CA1052.severity = suggestion +dotnet_diagnostic.CA1054.severity = warning +dotnet_diagnostic.CA1055.severity = warning +dotnet_diagnostic.CA1056.severity = warning +dotnet_diagnostic.CA1058.severity = warning +dotnet_diagnostic.CA1060.severity = warning +dotnet_diagnostic.CA1061.severity = suggestion +dotnet_diagnostic.CA1062.severity = suggestion +dotnet_diagnostic.CA1063.severity = suggestion +dotnet_diagnostic.CA1064.severity = warning +dotnet_diagnostic.CA1065.severity = warning +dotnet_diagnostic.CA1066.severity = warning +dotnet_diagnostic.CA1067.severity = suggestion +dotnet_diagnostic.CA1068.severity = suggestion +dotnet_diagnostic.CA1069.severity = suggestion +dotnet_diagnostic.CA1303.severity = suggestion +dotnet_diagnostic.CA1304.severity = silent +dotnet_diagnostic.CA1305.severity = silent +dotnet_diagnostic.CA1307.severity = suggestion +dotnet_diagnostic.CA1308.severity = suggestion +dotnet_diagnostic.CA1310.severity = silent +dotnet_diagnostic.CA1401.severity = suggestion +dotnet_diagnostic.CA1416.severity = warning +dotnet_diagnostic.CA1417.severity = warning +dotnet_diagnostic.CA1418.severity = warning +dotnet_diagnostic.CA1419.severity = suggestion +dotnet_diagnostic.CA1420.severity = warning +dotnet_diagnostic.CA1421.severity = suggestion +dotnet_diagnostic.CA1422.severity = warning +dotnet_diagnostic.CA1501.severity = warning +dotnet_diagnostic.CA1502.severity = suggestion +dotnet_diagnostic.CA1505.severity = warning +dotnet_diagnostic.CA1506.severity = warning +dotnet_diagnostic.CA1509.severity = warning +dotnet_diagnostic.CA1510.severity = suggestion +dotnet_diagnostic.CA1511.severity = suggestion +dotnet_diagnostic.CA1512.severity = suggestion +dotnet_diagnostic.CA1513.severity = suggestion +dotnet_diagnostic.CA1700.severity = warning +dotnet_diagnostic.CA1707.severity = silent +dotnet_diagnostic.CA1708.severity = silent +dotnet_diagnostic.CA1710.severity = silent +dotnet_diagnostic.CA1711.severity = silent +dotnet_diagnostic.CA1712.severity = silent +dotnet_diagnostic.CA1713.severity = warning +dotnet_diagnostic.CA1715.severity = silent +dotnet_diagnostic.CA1716.severity = silent +dotnet_diagnostic.CA1720.severity = silent +dotnet_diagnostic.CA1721.severity = warning +dotnet_diagnostic.CA1724.severity = suggestion +dotnet_diagnostic.CA1725.severity = silent +dotnet_diagnostic.CA1727.severity = silent +dotnet_diagnostic.CA1806.severity = suggestion +dotnet_diagnostic.CA1810.severity = warning +dotnet_diagnostic.CA1813.severity = suggestion +dotnet_diagnostic.CA1814.severity = warning +dotnet_diagnostic.CA1815.severity = warning +dotnet_diagnostic.CA1816.severity = suggestion +dotnet_diagnostic.CA1819.severity = suggestion +dotnet_diagnostic.CA1821.severity = suggestion +dotnet_diagnostic.CA1822.severity = suggestion +dotnet_diagnostic.CA1823.severity = warning +dotnet_diagnostic.CA1826.severity = warning +dotnet_diagnostic.CA1827.severity = suggestion +dotnet_diagnostic.CA1828.severity = suggestion +dotnet_diagnostic.CA1829.severity = suggestion +dotnet_diagnostic.CA1830.severity = suggestion +dotnet_diagnostic.CA1831.severity = warning +dotnet_diagnostic.CA1832.severity = suggestion +dotnet_diagnostic.CA1833.severity = suggestion +dotnet_diagnostic.CA1834.severity = suggestion +dotnet_diagnostic.CA1835.severity = suggestion +dotnet_diagnostic.CA1836.severity = suggestion +dotnet_diagnostic.CA1837.severity = suggestion +dotnet_diagnostic.CA1838.severity = silent +dotnet_diagnostic.CA1839.severity = suggestion +dotnet_diagnostic.CA1840.severity = suggestion +dotnet_diagnostic.CA1842.severity = suggestion +dotnet_diagnostic.CA1843.severity = suggestion +dotnet_diagnostic.CA1844.severity = suggestion +dotnet_diagnostic.CA1846.severity = suggestion +dotnet_diagnostic.CA1847.severity = suggestion +dotnet_diagnostic.CA1848.severity = silent +dotnet_diagnostic.CA1849.severity = suggestion +dotnet_diagnostic.CA1850.severity = suggestion +dotnet_diagnostic.CA1852.severity = silent +dotnet_diagnostic.CA1853.severity = suggestion +dotnet_diagnostic.CA1854.severity = suggestion +dotnet_diagnostic.CA1858.severity = suggestion +dotnet_diagnostic.CA1859.severity = suggestion +dotnet_diagnostic.CA1860.severity = suggestion +dotnet_diagnostic.CA1861.severity = suggestion +dotnet_diagnostic.CA1862.severity = suggestion +dotnet_diagnostic.CA1863.severity = silent +dotnet_diagnostic.CA1864.severity = suggestion +dotnet_diagnostic.CA1868.severity = suggestion +dotnet_diagnostic.CA1869.severity = suggestion +dotnet_diagnostic.CA2000.severity = suggestion +dotnet_diagnostic.CA2002.severity = warning +dotnet_diagnostic.CA2007.severity = suggestion +dotnet_diagnostic.CA2008.severity = warning +dotnet_diagnostic.CA2009.severity = warning +dotnet_diagnostic.CA2011.severity = suggestion +dotnet_diagnostic.CA2012.severity = suggestion +dotnet_diagnostic.CA2013.severity = warning +dotnet_diagnostic.CA2015.severity = warning +dotnet_diagnostic.CA2017.severity = warning +dotnet_diagnostic.CA2018.severity = warning +dotnet_diagnostic.CA2019.severity = suggestion +dotnet_diagnostic.CA2021.severity = warning +dotnet_diagnostic.CA2100.severity = warning +dotnet_diagnostic.CA2101.severity = suggestion +dotnet_diagnostic.CA2119.severity = warning +dotnet_diagnostic.CA2153.severity = warning +dotnet_diagnostic.CA2200.severity = warning +dotnet_diagnostic.CA2201.severity = silent +dotnet_diagnostic.CA2207.severity = warning +dotnet_diagnostic.CA2208.severity = suggestion +dotnet_diagnostic.CA2211.severity = suggestion +dotnet_diagnostic.CA2213.severity = warning +dotnet_diagnostic.CA2214.severity = warning +dotnet_diagnostic.CA2215.severity = silent +dotnet_diagnostic.CA2216.severity = warning +dotnet_diagnostic.CA2217.severity = warning +dotnet_diagnostic.CA2219.severity = warning +dotnet_diagnostic.CA2225.severity = suggestion +dotnet_diagnostic.CA2226.severity = warning +dotnet_diagnostic.CA2227.severity = suggestion +dotnet_diagnostic.CA2231.severity = suggestion +dotnet_diagnostic.CA2235.severity = warning +dotnet_diagnostic.CA2237.severity = warning +dotnet_diagnostic.CA2241.severity = suggestion +dotnet_diagnostic.CA2242.severity = suggestion +dotnet_diagnostic.CA2243.severity = warning +dotnet_diagnostic.CA2245.severity = suggestion +dotnet_diagnostic.CA2247.severity = suggestion +dotnet_diagnostic.CA2248.severity = suggestion +dotnet_diagnostic.CA2249.severity = suggestion +dotnet_diagnostic.CA2250.severity = suggestion +dotnet_diagnostic.CA2251.severity = silent +dotnet_diagnostic.CA2253.severity = warning +dotnet_diagnostic.CA2254.severity = warning +dotnet_diagnostic.CA2256.severity = warning +dotnet_diagnostic.CA2257.severity = warning +dotnet_diagnostic.CA2258.severity = warning +dotnet_diagnostic.CA2259.severity = warning +dotnet_diagnostic.CA2261.severity = warning +dotnet_diagnostic.CA2300.severity = warning +dotnet_diagnostic.CA2301.severity = warning +dotnet_diagnostic.CA2302.severity = warning +dotnet_diagnostic.CA2305.severity = warning +dotnet_diagnostic.CA2310.severity = warning +dotnet_diagnostic.CA2311.severity = warning +dotnet_diagnostic.CA2312.severity = warning +dotnet_diagnostic.CA2315.severity = warning +dotnet_diagnostic.CA2321.severity = warning +dotnet_diagnostic.CA2322.severity = warning +dotnet_diagnostic.CA2326.severity = warning +dotnet_diagnostic.CA2327.severity = warning +dotnet_diagnostic.CA2328.severity = warning +dotnet_diagnostic.CA2329.severity = warning +dotnet_diagnostic.CA2330.severity = warning +dotnet_diagnostic.CA2350.severity = warning +dotnet_diagnostic.CA2351.severity = warning +dotnet_diagnostic.CA2361.severity = warning +dotnet_diagnostic.CA3001.severity = warning +dotnet_diagnostic.CA3002.severity = warning +dotnet_diagnostic.CA3003.severity = warning +dotnet_diagnostic.CA3004.severity = warning +dotnet_diagnostic.CA3005.severity = warning +dotnet_diagnostic.CA3006.severity = warning +dotnet_diagnostic.CA3007.severity = warning +dotnet_diagnostic.CA3008.severity = warning +dotnet_diagnostic.CA3009.severity = warning +dotnet_diagnostic.CA3010.severity = warning +dotnet_diagnostic.CA3011.severity = warning +dotnet_diagnostic.CA3012.severity = warning +dotnet_diagnostic.CA3061.severity = silent +dotnet_diagnostic.CA3075.severity = silent +dotnet_diagnostic.CA3076.severity = silent +dotnet_diagnostic.CA3077.severity = silent +dotnet_diagnostic.CA3147.severity = silent +dotnet_diagnostic.CA5350.severity = silent +dotnet_diagnostic.CA5351.severity = silent +dotnet_diagnostic.CA5358.severity = warning +dotnet_diagnostic.CA5359.severity = silent +dotnet_diagnostic.CA5360.severity = silent +dotnet_diagnostic.CA5361.severity = warning +dotnet_diagnostic.CA5362.severity = warning +dotnet_diagnostic.CA5363.severity = silent +dotnet_diagnostic.CA5364.severity = silent +dotnet_diagnostic.CA5365.severity = silent +dotnet_diagnostic.CA5366.severity = silent +dotnet_diagnostic.CA5367.severity = warning +dotnet_diagnostic.CA5368.severity = silent +dotnet_diagnostic.CA5369.severity = silent +dotnet_diagnostic.CA5370.severity = silent +dotnet_diagnostic.CA5371.severity = silent +dotnet_diagnostic.CA5372.severity = silent +dotnet_diagnostic.CA5373.severity = silent +dotnet_diagnostic.CA5374.severity = silent +dotnet_diagnostic.CA5375.severity = warning +dotnet_diagnostic.CA5376.severity = warning +dotnet_diagnostic.CA5377.severity = warning +dotnet_diagnostic.CA5378.severity = warning +dotnet_diagnostic.CA5379.severity = silent +dotnet_diagnostic.CA5380.severity = warning +dotnet_diagnostic.CA5381.severity = warning +dotnet_diagnostic.CA5382.severity = warning +dotnet_diagnostic.CA5383.severity = warning +dotnet_diagnostic.CA5384.severity = silent +dotnet_diagnostic.CA5385.severity = silent +dotnet_diagnostic.CA5386.severity = warning +dotnet_diagnostic.CA5387.severity = warning +dotnet_diagnostic.CA5388.severity = warning +dotnet_diagnostic.CA5389.severity = warning +dotnet_diagnostic.CA5390.severity = warning +dotnet_diagnostic.CA5391.severity = warning +dotnet_diagnostic.CA5392.severity = warning +dotnet_diagnostic.CA5393.severity = warning +dotnet_diagnostic.CA5394.severity = warning +dotnet_diagnostic.CA5395.severity = warning +dotnet_diagnostic.CA5396.severity = warning +dotnet_diagnostic.CA5397.severity = silent +dotnet_diagnostic.CA5398.severity = warning +dotnet_diagnostic.CA5399.severity = warning +dotnet_diagnostic.CA5400.severity = warning +dotnet_diagnostic.CA5401.severity = warning +dotnet_diagnostic.CA5402.severity = warning +dotnet_diagnostic.CA5403.severity = warning +dotnet_diagnostic.CA5404.severity = warning +dotnet_diagnostic.CA5405.severity = warning +dotnet_diagnostic.RS1001.severity = warning +dotnet_diagnostic.RS1004.severity = warning +dotnet_diagnostic.RS1007.severity = warning +dotnet_diagnostic.RS1009.severity = error +dotnet_diagnostic.RS1010.severity = suggestion +dotnet_diagnostic.RS1011.severity = suggestion +dotnet_diagnostic.RS1015.severity = warning +dotnet_diagnostic.RS1016.severity = suggestion +dotnet_diagnostic.RS1017.severity = warning +dotnet_diagnostic.RS1018.severity = warning +dotnet_diagnostic.RS1019.severity = warning +dotnet_diagnostic.RS1020.severity = warning +dotnet_diagnostic.RS1021.severity = warning +dotnet_diagnostic.RS1024.severity = warning +dotnet_diagnostic.RS1025.severity = warning +dotnet_diagnostic.RS1026.severity = warning +dotnet_diagnostic.RS1027.severity = warning +dotnet_diagnostic.RS1028.severity = warning +dotnet_diagnostic.RS1029.severity = warning +dotnet_diagnostic.RS1030.severity = warning +dotnet_diagnostic.RS1031.severity = warning +dotnet_diagnostic.RS1032.severity = warning +dotnet_diagnostic.RS1033.severity = warning +dotnet_diagnostic.RS2000.severity = warning +dotnet_diagnostic.RS2001.severity = warning +dotnet_diagnostic.RS2002.severity = warning +dotnet_diagnostic.RS2003.severity = warning +dotnet_diagnostic.RS2004.severity = warning +dotnet_diagnostic.RS2005.severity = warning +dotnet_diagnostic.RS2006.severity = warning +dotnet_diagnostic.RS2007.severity = warning +dotnet_diagnostic.RS2008.severity = warning +dotnet_style_allow_multiple_blank_lines_experimental = true:silent +dotnet_style_allow_statement_immediately_after_block_experimental = true:silent +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_namespace_match_folder = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_object_initializer = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_qualification_for_event = false:silent +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_property = false:silent +dotnet_style_readonly_field = true:suggestion +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent +end_of_line = crlf +indent_size = 4 +indent_style = space +insert_final_newline = false +tab_width = 4 + +[*.cs] +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true +csharp_prefer_braces = true:silent +csharp_prefer_simple_default_expression = true:suggestion +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_static_anonymous_function = true:suggestion +csharp_prefer_static_local_function = true:suggestion +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent +csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent +csharp_style_conditional_delegate_call = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_namespace_declarations = block_scoped:silent +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_prefer_extended_property_pattern = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_local_over_anonymous_function = true:suggestion +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_not_pattern = true:suggestion +csharp_style_prefer_null_check_over_type_check = true:suggestion +csharp_style_prefer_pattern_matching = true:silent +csharp_style_prefer_primary_constructors = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_prefer_readonly_struct = true:suggestion +csharp_style_prefer_readonly_struct_member = true:suggestion +csharp_style_prefer_switch_expression = true:suggestion +csharp_style_prefer_top_level_statements = true:silent +csharp_style_prefer_tuple_swap = true:suggestion +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion +csharp_style_var_elsewhere = false:silent +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent +csharp_using_directive_placement = outside_namespace:silent +dotnet_diagnostic.CA1032.severity = suggestion +dotnet_diagnostic.CA1047.severity = warning +dotnet_diagnostic.CA1070.severity = suggestion +dotnet_diagnostic.CA1200.severity = silent +dotnet_diagnostic.CA1309.severity = silent +dotnet_diagnostic.CA1311.severity = silent +dotnet_diagnostic.CA1507.severity = suggestion +dotnet_diagnostic.CA1508.severity = suggestion +dotnet_diagnostic.CA1802.severity = suggestion +dotnet_diagnostic.CA1805.severity = silent +dotnet_diagnostic.CA1812.severity = warning +dotnet_diagnostic.CA1820.severity = warning +dotnet_diagnostic.CA1824.severity = suggestion +dotnet_diagnostic.CA1825.severity = suggestion +dotnet_diagnostic.CA1841.severity = suggestion +dotnet_diagnostic.CA1845.severity = suggestion +dotnet_diagnostic.CA1851.severity = suggestion +dotnet_diagnostic.CA1855.severity = suggestion +dotnet_diagnostic.CA1856.severity = error +dotnet_diagnostic.CA1857.severity = warning +dotnet_diagnostic.CA1865.severity = suggestion +dotnet_diagnostic.CA1866.severity = suggestion +dotnet_diagnostic.CA1867.severity = error +dotnet_diagnostic.CA1870.severity = suggestion +dotnet_diagnostic.CA2014.severity = warning +dotnet_diagnostic.CA2016.severity = suggestion +dotnet_diagnostic.CA2020.severity = suggestion +dotnet_diagnostic.CA2234.severity = warning +dotnet_diagnostic.CA2244.severity = warning +dotnet_diagnostic.CA2246.severity = warning +dotnet_diagnostic.CA2252.severity = error +dotnet_diagnostic.CA2255.severity = warning +dotnet_diagnostic.CA2260.severity = warning +dotnet_diagnostic.CA2352.severity = warning +dotnet_diagnostic.CA2353.severity = warning +dotnet_diagnostic.CA2354.severity = warning +dotnet_diagnostic.CA2355.severity = warning +dotnet_diagnostic.CA2356.severity = warning +dotnet_diagnostic.CA2362.severity = warning +# CS0219: The variable is assigned but its value is never used +dotnet_diagnostic.CS0219.severity = suggestion +# CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. +dotnet_diagnostic.CS1998.severity = suggestion +# CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). +dotnet_diagnostic.CS8509.severity = suggestion +# CS8600: Converting null literal or possible null value to non-nullable type. +dotnet_diagnostic.CS8600.severity = silent +# CS8601: Possible null reference assignment. +dotnet_diagnostic.CS8601.severity = silent +# CS8602: Dereference of a possibly null reference. +dotnet_diagnostic.CS8602.severity = silent +# CS8603: Possible null reference return. +dotnet_diagnostic.CS8603.severity = silent +# CS8604: Possible null reference argument for parameter in type. +dotnet_diagnostic.CS8604.severity = silent +# CS8618: Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable. +dotnet_diagnostic.CS8618.severity = silent +# CS8619: Nullability of reference types in generic value type does not match target +dotnet_diagnostic.CS8619.severity = silent +# CS8620: Argument type cannot be used for parameter due to differences in the nullability of reference types. +dotnet_diagnostic.CS8620.severity = suggestion +# CS8625: Cannot convert null literal to non-nullable reference type. +dotnet_diagnostic.CS8625.severity = silent +# CS8629: Nullable value type may be null +dotnet_diagnostic.CS8629.severity = suggestion +# CS8765: Nullability of parameter does not match overridden member (possibly because of nullability attributes). +dotnet_diagnostic.CS8765.severity = silent +# CS8767: Nullability of reference types in parameter does not match implicitly implmemented member (possibly because of nullability attributes). +dotnet_diagnostic.CS8767.severity = suggestion +dotnet_diagnostic.IL2026.severity = warning +dotnet_diagnostic.IL2032.severity = warning +dotnet_diagnostic.IL2041.severity = warning +dotnet_diagnostic.IL2043.severity = warning +dotnet_diagnostic.IL2046.severity = warning +dotnet_diagnostic.IL2050.severity = warning +dotnet_diagnostic.IL2055.severity = warning +dotnet_diagnostic.IL2057.severity = warning +dotnet_diagnostic.IL2058.severity = warning +dotnet_diagnostic.IL2059.severity = warning +dotnet_diagnostic.IL2060.severity = warning +dotnet_diagnostic.IL2062.severity = warning +dotnet_diagnostic.IL2063.severity = warning +dotnet_diagnostic.IL2064.severity = warning +dotnet_diagnostic.IL2065.severity = warning +dotnet_diagnostic.IL2066.severity = warning +dotnet_diagnostic.IL2067.severity = warning +dotnet_diagnostic.IL2068.severity = warning +dotnet_diagnostic.IL2069.severity = warning +dotnet_diagnostic.IL2070.severity = warning +dotnet_diagnostic.IL2071.severity = warning +dotnet_diagnostic.IL2072.severity = warning +dotnet_diagnostic.IL2073.severity = warning +dotnet_diagnostic.IL2074.severity = warning +dotnet_diagnostic.IL2075.severity = warning +dotnet_diagnostic.IL2076.severity = warning +dotnet_diagnostic.IL2077.severity = warning +dotnet_diagnostic.IL2078.severity = warning +dotnet_diagnostic.IL2079.severity = warning +dotnet_diagnostic.IL2080.severity = warning +dotnet_diagnostic.IL2081.severity = warning +dotnet_diagnostic.IL2082.severity = warning +dotnet_diagnostic.IL2083.severity = warning +dotnet_diagnostic.IL2084.severity = warning +dotnet_diagnostic.IL2085.severity = warning +dotnet_diagnostic.IL2086.severity = warning +dotnet_diagnostic.IL2087.severity = warning +dotnet_diagnostic.IL2088.severity = warning +dotnet_diagnostic.IL2089.severity = warning +dotnet_diagnostic.IL2090.severity = warning +dotnet_diagnostic.IL2091.severity = warning +dotnet_diagnostic.IL2092.severity = warning +dotnet_diagnostic.IL2093.severity = warning +dotnet_diagnostic.IL2094.severity = warning +dotnet_diagnostic.IL2095.severity = warning +dotnet_diagnostic.IL2096.severity = warning +dotnet_diagnostic.IL2097.severity = warning +dotnet_diagnostic.IL2098.severity = warning +dotnet_diagnostic.IL2099.severity = warning +dotnet_diagnostic.IL2103.severity = warning +dotnet_diagnostic.IL2106.severity = warning +dotnet_diagnostic.IL2109.severity = warning +dotnet_diagnostic.IL2110.severity = warning +dotnet_diagnostic.IL2111.severity = warning +dotnet_diagnostic.IL2116.severity = warning +dotnet_diagnostic.IL3000.severity = warning +dotnet_diagnostic.IL3001.severity = warning +dotnet_diagnostic.IL3002.severity = warning +dotnet_diagnostic.IL3003.severity = warning +dotnet_diagnostic.IL3004.severity = warning +dotnet_diagnostic.IL3050.severity = suggestion +dotnet_diagnostic.IL3051.severity = suggestion +dotnet_diagnostic.IL3056.severity = suggestion +dotnet_diagnostic.RS1002.severity = warning +dotnet_diagnostic.RS1003.severity = warning +dotnet_diagnostic.RS1005.severity = warning +dotnet_diagnostic.RS1006.severity = warning +dotnet_diagnostic.RS1008.severity = warning +dotnet_diagnostic.RS1012.severity = warning +dotnet_diagnostic.RS1013.severity = warning +dotnet_diagnostic.RS1014.severity = suggestion +dotnet_diagnostic.RS1022.severity = warning +dotnet_diagnostic.RS1023.severity = warning + diff --git a/C4InterFlow.sln b/C4InterFlow.sln index bac9919b1..03efcb920 100644 --- a/C4InterFlow.sln +++ b/C4InterFlow.sln @@ -10,6 +10,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "C4InterFlow.Automation", "C4InterFlow.Automation\C4InterFlow.Automation.csproj", "{5DD6985D-35AC-4154-B09B-2186AB9AA3AD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B5B62581-615E-45C5-8A4A-3FEC83B827F6}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Samples/dotnet.eShop/DotNetEShop.sln b/Samples/dotnet.eShop/DotNetEShop.sln index 9ac0f5101..9ffd4b82f 100644 --- a/Samples/dotnet.eShop/DotNetEShop.sln +++ b/Samples/dotnet.eShop/DotNetEShop.sln @@ -11,20 +11,25 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "C4InterFlow", "..\..\C4Inte EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "C4InterFlow.Automation", "..\..\C4InterFlow.Automation\C4InterFlow.Automation.csproj", "{E47ACFF1-7BAC-4538-9558-D7AA04939546}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6DA89291-6ECC-4A99-9921-56F0F2FF8B39}" + ProjectSection(SolutionItems) = preProject + ..\..\.editorconfig = ..\..\.editorconfig + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F18C0E05-2B41-4508-B91D-3B84E0535E99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F18C0E05-2B41-4508-B91D-3B84E0535E99}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F18C0E05-2B41-4508-B91D-3B84E0535E99}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F18C0E05-2B41-4508-B91D-3B84E0535E99}.Release|Any CPU.Build.0 = Release|Any CPU {0DEABC5C-3A2C-42FE-91B6-E326BA6CF65D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0DEABC5C-3A2C-42FE-91B6-E326BA6CF65D}.Debug|Any CPU.Build.0 = Debug|Any CPU {0DEABC5C-3A2C-42FE-91B6-E326BA6CF65D}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DEABC5C-3A2C-42FE-91B6-E326BA6CF65D}.Release|Any CPU.Build.0 = Release|Any CPU + {F18C0E05-2B41-4508-B91D-3B84E0535E99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F18C0E05-2B41-4508-B91D-3B84E0535E99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F18C0E05-2B41-4508-B91D-3B84E0535E99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F18C0E05-2B41-4508-B91D-3B84E0535E99}.Release|Any CPU.Build.0 = Release|Any CPU {C7E5280A-0FD1-4916-BB13-7F57A5E5274B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C7E5280A-0FD1-4916-BB13-7F57A5E5274B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7E5280A-0FD1-4916-BB13-7F57A5E5274B}.Release|Any CPU.ActiveCfg = Release|Any CPU From a3f764a81a681b3fd6371a751da4ea0384ee10e1 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Mon, 16 Sep 2024 13:19:52 -0500 Subject: [PATCH 05/12] build: establish launch profiles for Yaml/Json examples --- .../Properties/launchSettings.json | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/C4InterFlow.Cli/Properties/launchSettings.json b/C4InterFlow.Cli/Properties/launchSettings.json index a8b55f818..3c0dcacbf 100644 --- a/C4InterFlow.Cli/Properties/launchSettings.json +++ b/C4InterFlow.Cli/Properties/launchSettings.json @@ -1,8 +1,32 @@ { "profiles": { - "C4InterFlow.Cli": { + "E-Commerce Platform - YAML - Draw Diagrams": { "commandName": "Project", - "commandLineArgs": "draw-diagrams --interfaces ..SoftwareSystems.*.Interfaces.* ..SoftwareSystems.*.Containers.*.Interfaces.* --business-processes ECommercePlatform.BusinessProcesses.* --levels-of-details context container --scopes namespace namespace-software-systems --types c4-static --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\E-Commerce Platform\\Yaml\\Architecture\" --output-dir \"$(ProjectDir)\\..\\Samples\\E-Commerce Platform\\Yaml\\Diagrams\"" + "commandLineArgs": "draw-diagrams --interfaces ECommercePlatform.*.*.SoftwareSystems.*.Interfaces.* ECommercePlatform.*.*.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes ECommercePlatform.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\E-Commerce Platform\\Yaml\\Architecture\" --output-dir \"$(ProjectDir)\\..\\Samples\\E-Commerce Platform\\Yaml\\Diagrams\"" + }, + "Internet Banking System - YAML - Draw Diagrams": { + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* BigBankPlc.SoftwareSystems.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --scopes namespace namespace-software-systems --types c4-static --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\Yaml\\Architecture\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\Yaml\\Diagrams\"" + }, + "Internet Banking System - CSV/YAML - Draw Diagrams": { + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* BigBankPlc.SoftwareSystems.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Architecture\\Yaml\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Diagrams\"" + }, + "Internet Banking System - CSV/JSON - Draw Diagrams": { + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* BigBankPlc.SoftwareSystems.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.JsonAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Architecture\\Json\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Diagrams\"" + }, + "ToDoApp - YAML - Draw Diagrams": { + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces ToDoAppExample.SoftwareSystems.*.Containers.*.Interfaces.* ToDoAppExample.SoftwareSystems.*.Interfaces.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\ToDoApp\\Architecture\" --output-dir \"$(ProjectDir)\\..\\Samples\\ToDoApp\\Diagrams\"" + }, + "TraderX - CSV/YAML - Draw Diagrams": { + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces TraderXExample.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes TraderXExample.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\TraderX\\CSV\\Architecture\\Yaml\" --output-dir \"$(ProjectDir)\\..\\Samples\\TraderX\\CSV\\Diagrams\"" + }, + "TraderX - CSV/JSON - Draw Diagrams": { + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces TraderXExample.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes TraderXExample.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.JsonAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\TraderX\\CSV\\Architecture\\Json\" --output-dir \"$(ProjectDir)\\..\\Samples\\TraderX\\CSV\\Diagrams\"" } } } \ No newline at end of file From 217ed546647b2ae1e0e6d5d7d0d2c05963568b11 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Tue, 17 Sep 2024 11:20:35 -0500 Subject: [PATCH 06/12] refactor(eShop): add launch profiles --- .../Writers/CSharpToAnyAaCWriter.cs | 11 +++++++++-- .../DotNetEShop.Cli/DotNetEShop.Cli.csproj | 15 +++++++++------ .../Properties/launchSettings.json | 14 +++++++++++--- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/C4InterFlow.Automation/Writers/CSharpToAnyAaCWriter.cs b/C4InterFlow.Automation/Writers/CSharpToAnyAaCWriter.cs index 30f21ed1c..04ff3821d 100644 --- a/C4InterFlow.Automation/Writers/CSharpToAnyAaCWriter.cs +++ b/C4InterFlow.Automation/Writers/CSharpToAnyAaCWriter.cs @@ -22,8 +22,15 @@ public abstract class CSharpToAnyAaCWriter : IAaCWriter private static void RegisterInstanceVisualStudioInstance() { - MSBuildLocator.RegisterInstance(MSBuildLocator.QueryVisualStudioInstances().OrderByDescending( - instance => instance.Version).First()); + var instance = MSBuildLocator.QueryVisualStudioInstances().MaxBy(instance => instance.Version); + if (instance != null) + { + MSBuildLocator.RegisterInstance(instance); + } + else + { + Log.Warning("MSBuildLocator could not find any instances to register."); + } } public CSharpToAnyAaCWriter(string softwareSystemSourcePath, string architectureRootNamespace) diff --git a/Samples/dotnet.eShop/DotNetEShop.Cli/DotNetEShop.Cli.csproj b/Samples/dotnet.eShop/DotNetEShop.Cli/DotNetEShop.Cli.csproj index 1f851a21d..ed178fac0 100644 --- a/Samples/dotnet.eShop/DotNetEShop.Cli/DotNetEShop.Cli.csproj +++ b/Samples/dotnet.eShop/DotNetEShop.Cli/DotNetEShop.Cli.csproj @@ -7,17 +7,20 @@ enable + + C:\Data\Projects\C4Interflow\eShop-main + - - - - - + + + + + + - diff --git a/Samples/dotnet.eShop/DotNetEShop.Cli/Properties/launchSettings.json b/Samples/dotnet.eShop/DotNetEShop.Cli/Properties/launchSettings.json index ee5e4caf9..c773015c7 100644 --- a/Samples/dotnet.eShop/DotNetEShop.Cli/Properties/launchSettings.json +++ b/Samples/dotnet.eShop/DotNetEShop.Cli/Properties/launchSettings.json @@ -1,8 +1,16 @@ { "profiles": { - "dotnet.eShop.Architecture.Cli": { - "commandName": "Project", - "commandLineArgs": "execute-aac-strategy --aac-root-namespace \"dotnet.eShop.Architecture\" --aac-output-path \"C:\\C4InterFlow\\Samples\\dotnet.eShop\\dotnet.eShop.Architecture\\Yaml\" --aac-writer-strategy \"dotnet.eShop.Architecture.Cli.CSharpToYamlBasketApiAaCGenerator, dotnet.eShop.Architecture.Cli\" --params software-system-source-path=\"C:\\Data\\Projects\\C4InterFlow\\eShop-main\\src\\Basket.API\\Basket.API.csproj\" --params software-system-name=\"BasketApi\"" + "DotNetEShop - Execute AaC Strategy": { + "commandName": "Project", + "commandLineArgs": "execute-aac-strategy --aac-root-namespace \"SoftwareSystems\" --aac-output-path \"$(ProjectDir)\\..\\DotNetEShop\\Yaml\" --aac-writer-strategy \"DotNetEShop.Cli.CSharpToYamlBasketApiAaCGenerator, DotNetEShop.Cli\" --params software-system-source-path=\"$(EShopSourcePath)\\src\\Basket.API\\Basket.API.csproj\" --params software-system-name=\"BasketApi\"" + }, + "DotNetEShop - YAML - Draw Diagrams": { + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces DotNetEShop.SoftwareSystems.*.Containers.*.Components.*.Interfaces.* --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)..\\DotNetEShop\\Yaml\" --output-dir \"$(ProjectDir)..\\DotNetEShop\\Diagrams\"" + }, + "DotNetEShop - CSharp - Draw Diagrams": { + "commandName": "Project", + "commandLineArgs": "draw-diagrams --interfaces DotNetEShop.SoftwareSystems.*.Containers.*.Components.*.Interfaces.* --aac-reader-strategy \"C4InterFlow.Automation.Readers.CSharpAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"DotNetEShop.dll\" --output-dir \"$(ProjectDir)..\\DotNetEShop\\Diagrams\"" } } } \ No newline at end of file From de36549a8b27ad389609ff57f4e3030271756084 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Wed, 18 Sep 2024 13:40:25 -0500 Subject: [PATCH 07/12] test: create 'draw-diagrams.bat' that executes all others This way it's easy to test a change against all examples --- CONTRIBUTING.md | 8 ++ .../Yaml/draw-diagrams.bat | 63 ++++++--- .../CSV/draw-diagrams.bat | 57 ++++++-- .../Yaml/draw-diagrams.bat | 57 ++++++-- Samples/ToDoApp/draw-diagrams.bat | 67 +++++++--- Samples/TraderX/CSV/draw-diagrams.bat | 57 ++++++-- Samples/dotnet.eShop/draw-diagrams.bat | 58 ++++++--- Samples/draw-diagrams.bat | 122 ++++++++++++++++++ 8 files changed, 396 insertions(+), 93 deletions(-) create mode 100644 Samples/draw-diagrams.bat diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04f12d01e..d3b3c2f21 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,4 +15,12 @@ Editor files have been put in place to enforce consistency where applicable. ## As a tester +The [Samples](./Samples/) folder contains all valid use cases for the project. +The focus of the samples is on a business domain rather than a specific technology or format. + +There are `draw-diagrams.bat` scripts for each sample that can be run individually. +This is a great way to work on an isolated domain at a time. +But there is also a [`draw-diagrams.bat`](./Samples/draw-diagrams.bat) in the Samples directory that runs all the samples under the same conditions. +This is the best way to perform what effectively is a regression test. + ## All Others \ No newline at end of file diff --git a/Samples/E-Commerce Platform/Yaml/draw-diagrams.bat b/Samples/E-Commerce Platform/Yaml/draw-diagrams.bat index b302ec58f..2642051e9 100644 --- a/Samples/E-Commerce Platform/Yaml/draw-diagrams.bat +++ b/Samples/E-Commerce Platform/Yaml/draw-diagrams.bat @@ -1,9 +1,9 @@ @echo off :: Possible values: TRUE, FALSE -set "redraw-all=TRUE" +if not defined redraw-all set "redraw-all=TRUE" ::::::::::::::::::::::::::::::: -set "build-configuration=Debug" +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=ECommercePlatform" set "cli-project-path=..\..\..\C4InterFlow.Cli\C4InterFlow.Cli.csproj" set "cli-output-dir=..\..\..\C4InterFlow.Cli\bin\%build-configuration%\net6.0\win-x64" @@ -12,13 +12,34 @@ set "diagrams-dir=.\Diagrams" set "aac-reader-strategy=C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation" set "aac-input-paths=.\Architecture" -echo redraw-all: %redraw-all% -echo aac-root-namespace: %aac-root-namespace% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% -echo diagrams-dir: %diagrams-dir% -echo aac-reader-strategy: %aac-reader-strategy% -echo aac-input-paths: %aac-input-paths% +CALL :NormalizePath %cli-project-path% +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath %cli-output-dir% +SET "cli-output-dir=%_NORMALIZED_PATH_%" +CALL :NormalizePath %aac-input-paths% +SET "aac-input-paths=%_NORMALIZED_PATH_%" +CALL :NormalizePath %diagrams-dir% +SET "diagrams-dir=%_NORMALIZED_PATH_%" + +if "%ENABLE_LINE_DRAWING%"=="" ( + echo redraw-all : %redraw-all% + echo aac-root-namespace : %aac-root-namespace% + echo cli-output-dir : %cli-output-dir% + echo cli-exe : %cli-exe% + echo diagrams-dir : %diagrams-dir% + echo aac-reader-strategy : %aac-reader-strategy% + echo aac-input-paths : %aac-input-paths% +) else ( + @ECHO %ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk + @ECHO x %DISABLE_LINE_DRAWING%redraw-all %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!redraw-all!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-root-namespace %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-root-namespace!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-output-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-output-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-exe %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-exe!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%diagrams-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!diagrams-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-reader-strategy %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-reader-strategy!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-input-paths %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-input-paths!%ENABLE_LINE_DRAWING% + @ECHO mqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +) if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( echo ERROR: 'redraw-all' can only be set either to 'TRUE' or 'FALSE'. Edit script and re-run. @@ -26,13 +47,15 @@ if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( goto end ) -echo Check the above settings. -pause +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) :: Publish echo Publishing... :: pause -dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet echo Clearing diagrams... :: pause @@ -42,16 +65,22 @@ powershell.exe -Command "if (Test-Path '%diagrams-dir%\*') { Remove-Item -Path ' powershell.exe -Command "if (Test-Path '%diagrams-dir%\*') { Get-ChildItem -Path '%diagrams-dir%' -Recurse | Where-Object { $_.Extension -eq '.puml' } | ForEach-Object { Remove-Item -Path $_.FullName -Force } }" ) -powershell.exe -Command "Get-ChildItem -Path "%diagrams-dir%" -Recurse -Directory | Where-Object { !(Get-ChildItem -Path $_.FullName) } | ForEach-Object { Remove-Item -Path $_.FullName;}" +:: powershell.exe -Command "Get-ChildItem -Path '%diagrams-dir%' -Recurse -Directory | Where-Object { !(Get-ChildItem -Path $_.FullName) } | ForEach-Object { Remove-Item -Path $_.FullName -Force;}" echo Draw Diagrams with '%aac-reader-strategy%' AaC reader strategy and '%aac-input-paths%' AaC input path -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause echo Drawing Diagrams... if %redraw-all%==TRUE ( -%cli-output-dir%\%cli-exe% draw-diagrams --interfaces ..SoftwareSystems.*.Interfaces.* ..SoftwareSystems.*.Containers.*.Interfaces.* --business-processes %aac-root-namespace%.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" --formats png svg +%cli-output-dir%\%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.*.*.SoftwareSystems.*.Interfaces.* %aac-root-namespace%.*.*.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes %aac-root-namespace%.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" --formats png svg ) else ( -%cli-output-dir%\%cli-exe% draw-diagrams --interfaces ..SoftwareSystems.*.Interfaces.* ..SoftwareSystems.*.Containers.*.Interfaces.* --business-processes %aac-root-namespace%.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" +%cli-output-dir%\%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.*.*.SoftwareSystems.*.Interfaces.* %aac-root-namespace%.*.*.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes %aac-root-namespace%.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" ) -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end + +:NormalizePath +@SET _NORMALIZED_PATH_=%~f1 +@EXIT /B 0 + :end \ No newline at end of file diff --git a/Samples/Internet Banking System/CSV/draw-diagrams.bat b/Samples/Internet Banking System/CSV/draw-diagrams.bat index c99de8618..adb9ba720 100644 --- a/Samples/Internet Banking System/CSV/draw-diagrams.bat +++ b/Samples/Internet Banking System/CSV/draw-diagrams.bat @@ -1,13 +1,13 @@ @echo off :: Possible values: TRUE, FALSE -set "redraw-all=TRUE" +if not defined redraw-all set "redraw-all=TRUE" ::::::::::::::::::::::::::::::: :: Possible values: Yaml, Json set "aac-type=Yaml" ::::::::::::::::::::::::::::::: -set "build-configuration=Debug" +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=BigBankPlc" set "cli-project-path=..\..\..\C4InterFlow.Cli\C4InterFlow.Cli.csproj" set "cli-output-dir=..\..\..\C4InterFlow.Cli\bin\%build-configuration%\net6.0\win-x64" @@ -16,13 +16,34 @@ set "diagrams-dir=.\Diagrams" set "aac-reader-strategy=C4InterFlow.Automation.Readers.%aac-type%AaCReaderStrategy,C4InterFlow.Automation" set "aac-input-paths=.\Architecture\%aac-type%" -echo redraw-all: %redraw-all% -echo aac-root-namespace: %aac-root-namespace% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% -echo diagrams-dir: %diagrams-dir% -echo aac-reader-strategy: %aac-reader-strategy% -echo aac-input-paths: %aac-input-paths% +CALL :NormalizePath %cli-project-path% +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath %cli-output-dir% +SET "cli-output-dir=%_NORMALIZED_PATH_%" +CALL :NormalizePath %aac-input-paths% +SET "aac-input-paths=%_NORMALIZED_PATH_%" +CALL :NormalizePath %diagrams-dir% +SET "diagrams-dir=%_NORMALIZED_PATH_%" + +if "%ENABLE_LINE_DRAWING%"=="" ( + echo redraw-all : %redraw-all% + echo aac-root-namespace : %aac-root-namespace% + echo cli-output-dir : %cli-output-dir% + echo cli-exe : %cli-exe% + echo diagrams-dir : %diagrams-dir% + echo aac-reader-strategy : %aac-reader-strategy% + echo aac-input-paths : %aac-input-paths% +) else ( + @ECHO %ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk + @ECHO x %DISABLE_LINE_DRAWING%redraw-all %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!redraw-all!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-root-namespace %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-root-namespace!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-output-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-output-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-exe %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-exe!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%diagrams-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!diagrams-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-reader-strategy %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-reader-strategy!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-input-paths %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-input-paths!%ENABLE_LINE_DRAWING% + @ECHO mqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +) if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( echo ERROR: 'redraw-all' can only be set either to 'TRUE' or 'FALSE'. Edit script and re-run. @@ -30,13 +51,15 @@ if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( goto end ) -echo Check the above settings. -pause +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) :: Publish echo Publishing... :: pause -dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet echo Clearing diagrams... :: pause @@ -47,7 +70,7 @@ powershell.exe -Command "if (Test-Path '%diagrams-dir%\*') { Get-ChildItem -Path ) echo Draw Diagrams with '%aac-reader-strategy%' AaC reader strategy and '%aac-input-paths%' AaC input path -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause echo Drawing Diagrams... if %redraw-all%==TRUE ( @@ -55,5 +78,11 @@ if %redraw-all%==TRUE ( ) else ( %cli-output-dir%\%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes %aac-root-namespace%.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" ) -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end + +:NormalizePath +@SET _NORMALIZED_PATH_=%~f1 +@EXIT /B 0 + :end \ No newline at end of file diff --git a/Samples/Internet Banking System/Yaml/draw-diagrams.bat b/Samples/Internet Banking System/Yaml/draw-diagrams.bat index 871949000..918f53118 100644 --- a/Samples/Internet Banking System/Yaml/draw-diagrams.bat +++ b/Samples/Internet Banking System/Yaml/draw-diagrams.bat @@ -1,9 +1,9 @@ @echo off :: Possible values: TRUE, FALSE -set "redraw-all=TRUE" +if not defined redraw-all set "redraw-all=TRUE" ::::::::::::::::::::::::::::::: -set "build-configuration=Debug" +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=BigBankPlc" set "cli-project-path=..\..\..\C4InterFlow.Cli\C4InterFlow.Cli.csproj" set "cli-output-dir=..\..\..\C4InterFlow.Cli\bin\%build-configuration%\net6.0\win-x64" @@ -12,13 +12,34 @@ set "diagrams-dir=.\Diagrams" set "aac-reader-strategy=C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation" set "aac-input-paths=.\Architecture" -echo redraw-all: %redraw-all% -echo aac-root-namespace: %aac-root-namespace% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% -echo diagrams-dir: %diagrams-dir% -echo aac-reader-strategy: %aac-reader-strategy% -echo aac-input-paths: %aac-input-paths% +CALL :NormalizePath %cli-project-path% +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath %cli-output-dir% +SET "cli-output-dir=%_NORMALIZED_PATH_%" +CALL :NormalizePath %aac-input-paths% +SET "aac-input-paths=%_NORMALIZED_PATH_%" +CALL :NormalizePath %diagrams-dir% +SET "diagrams-dir=%_NORMALIZED_PATH_%" + +if "%ENABLE_LINE_DRAWING%"=="" ( + echo redraw-all : %redraw-all% + echo aac-root-namespace : %aac-root-namespace% + echo cli-output-dir : %cli-output-dir% + echo cli-exe : %cli-exe% + echo diagrams-dir : %diagrams-dir% + echo aac-reader-strategy : %aac-reader-strategy% + echo aac-input-paths : %aac-input-paths% +) else ( + @ECHO %ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk + @ECHO x %DISABLE_LINE_DRAWING%redraw-all %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!redraw-all!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-root-namespace %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-root-namespace!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-output-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-output-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-exe %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-exe!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%diagrams-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!diagrams-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-reader-strategy %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-reader-strategy!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-input-paths %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-input-paths!%ENABLE_LINE_DRAWING% + @ECHO mqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +) if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( echo ERROR: 'redraw-all' can only be set either to 'TRUE' or 'FALSE'. Edit script and re-run. @@ -26,13 +47,15 @@ if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( goto end ) -echo Check the above settings. -pause +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) :: Publish echo Publishing... :: pause -dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet echo Clearing diagrams... :: pause @@ -43,7 +66,7 @@ powershell.exe -Command "if (Test-Path '%diagrams-dir%\*') { Get-ChildItem -Path ) echo Draw Diagrams with '%aac-reader-strategy%' AaC reader strategy and '%aac-input-paths%' AaC input path -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause echo Drawing Diagrams... if %redraw-all%==TRUE ( @@ -51,5 +74,11 @@ if %redraw-all%==TRUE ( ) else ( %cli-output-dir%\%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes %aac-root-namespace%.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" ) -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end + +:NormalizePath +@SET _NORMALIZED_PATH_=%~f1 +@EXIT /B 0 + :end \ No newline at end of file diff --git a/Samples/ToDoApp/draw-diagrams.bat b/Samples/ToDoApp/draw-diagrams.bat index 1bba354ab..ef4fc04e6 100644 --- a/Samples/ToDoApp/draw-diagrams.bat +++ b/Samples/ToDoApp/draw-diagrams.bat @@ -1,21 +1,45 @@ @echo off :: Possible values: TRUE, FALSE -set "redraw-all=TRUE" +if not defined redraw-all set "redraw-all=TRUE" ::::::::::::::::::::::::::::::: +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=ToDoAppExample" -set "cli-exe=C:\\C4InterFlow.Cli.exe" +set "cli-project-path=..\..\C4InterFlow.Cli\C4InterFlow.Cli.csproj" +set "cli-output-dir=..\..\C4InterFlow.Cli\bin\%build-configuration%\net6.0\win-x64" +set "cli-exe=C4InterFlow.Cli.exe" set "diagrams-dir=.\Diagrams" set "aac-reader-strategy=C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation" set "aac-input-paths=.\Architecture" -echo redraw-all: %redraw-all% -echo aac-root-namespace: %aac-root-namespace% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% -echo diagrams-dir: %diagrams-dir% -echo aac-reader-strategy: %aac-reader-strategy% -echo aac-input-paths: %aac-input-paths% +CALL :NormalizePath %cli-project-path% +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath %cli-output-dir% +SET "cli-output-dir=%_NORMALIZED_PATH_%" +CALL :NormalizePath %aac-input-paths% +SET "aac-input-paths=%_NORMALIZED_PATH_%" +CALL :NormalizePath %diagrams-dir% +SET "diagrams-dir=%_NORMALIZED_PATH_%" + +if "%ENABLE_LINE_DRAWING%"=="" ( + echo redraw-all : %redraw-all% + echo aac-root-namespace : %aac-root-namespace% + echo cli-output-dir : %cli-output-dir% + echo cli-exe : %cli-exe% + echo diagrams-dir : %diagrams-dir% + echo aac-reader-strategy : %aac-reader-strategy% + echo aac-input-paths : %aac-input-paths% +) else ( + @ECHO %ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk + @ECHO x %DISABLE_LINE_DRAWING%redraw-all %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!redraw-all!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-root-namespace %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-root-namespace!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-output-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-output-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-exe %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-exe!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%diagrams-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!diagrams-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-reader-strategy %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-reader-strategy!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-input-paths %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-input-paths!%ENABLE_LINE_DRAWING% + @ECHO mqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +) if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( echo ERROR: 'redraw-all' can only be set either to 'TRUE' or 'FALSE'. Edit script and re-run. @@ -23,8 +47,15 @@ if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( goto end ) -echo Check the above settings. -pause +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) + +:: Publish +echo Publishing... +:: pause +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet echo Clearing diagrams... :: pause @@ -35,13 +66,19 @@ powershell.exe -Command "if (Test-Path '%diagrams-dir%\*') { Get-ChildItem -Path ) echo Draw Diagrams with '%aac-reader-strategy%' AaC reader strategy and '%aac-input-paths%' AaC input path -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause echo Drawing Diagrams... if %redraw-all%==TRUE ( -%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.SoftwareSystems.*.Containers.*.Interfaces.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" --formats png svg +%cli-output-dir%\%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.SoftwareSystems.*.Containers.*.Interfaces.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" --formats png svg ) else ( -%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.SoftwareSystems.*.Containers.*.Interfaces.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" +%cli-output-dir%\%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.SoftwareSystems.*.Containers.*.Interfaces.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" ) -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end + +:NormalizePath +@SET _NORMALIZED_PATH_=%~f1 +@EXIT /B 0 + :end \ No newline at end of file diff --git a/Samples/TraderX/CSV/draw-diagrams.bat b/Samples/TraderX/CSV/draw-diagrams.bat index 66c5a87f6..d0d4be407 100644 --- a/Samples/TraderX/CSV/draw-diagrams.bat +++ b/Samples/TraderX/CSV/draw-diagrams.bat @@ -1,9 +1,9 @@ @echo off :: Possible values: TRUE, FALSE -set "redraw-all=TRUE" +if not defined redraw-all set "redraw-all=TRUE" ::::::::::::::::::::::::::::::: -set "build-configuration=Debug" +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=TraderXExample" set "cli-project-path=..\..\..\C4InterFlow.Cli\C4InterFlow.Cli.csproj" set "cli-output-dir=..\..\..\C4InterFlow.Cli\bin\%build-configuration%\net6.0\win-x64" @@ -12,13 +12,34 @@ set "diagrams-dir=.\Diagrams" set "aac-reader-strategy=C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation" set "aac-input-paths=.\Architecture\Yaml" -echo redraw-all: %redraw-all% -echo aac-root-namespace: %aac-root-namespace% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% -echo diagrams-dir: %diagrams-dir% -echo aac-reader-strategy: %aac-reader-strategy% -echo aac-input-paths: %aac-input-paths% +CALL :NormalizePath %cli-project-path% +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath %cli-output-dir% +SET "cli-output-dir=%_NORMALIZED_PATH_%" +CALL :NormalizePath %aac-input-paths% +SET "aac-input-paths=%_NORMALIZED_PATH_%" +CALL :NormalizePath %diagrams-dir% +SET "diagrams-dir=%_NORMALIZED_PATH_%" + +if "%ENABLE_LINE_DRAWING%"=="" ( + echo redraw-all : %redraw-all% + echo aac-root-namespace : %aac-root-namespace% + echo cli-output-dir : %cli-output-dir% + echo cli-exe : %cli-exe% + echo diagrams-dir : %diagrams-dir% + echo aac-reader-strategy : %aac-reader-strategy% + echo aac-input-paths : %aac-input-paths% +) else ( + @ECHO %ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk + @ECHO x %DISABLE_LINE_DRAWING%redraw-all %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!redraw-all!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-root-namespace %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-root-namespace!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-output-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-output-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%cli-exe %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!cli-exe!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%diagrams-dir %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!diagrams-dir!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-reader-strategy %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-reader-strategy!%ENABLE_LINE_DRAWING% + @ECHO x %DISABLE_LINE_DRAWING%aac-input-paths %ENABLE_LINE_DRAWING% x %DISABLE_LINE_DRAWING%!aac-input-paths!%ENABLE_LINE_DRAWING% + @ECHO mqqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +) if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( echo ERROR: 'redraw-all' can only be set either to 'TRUE' or 'FALSE'. Edit script and re-run. @@ -26,13 +47,15 @@ if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( goto end ) -echo Check the above settings. -pause +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) :: Publish echo Publishing... :: pause -dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet echo Clearing diagrams... :: pause @@ -43,7 +66,7 @@ powershell.exe -Command "if (Test-Path '%diagrams-dir%\*') { Get-ChildItem -Path ) echo Draw Diagrams with '%aac-reader-strategy%' AaC reader strategy and '%aac-input-paths%' AaC input path -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause echo Drawing Diagrams... if %redraw-all%==TRUE ( @@ -51,5 +74,11 @@ if %redraw-all%==TRUE ( ) else ( %cli-output-dir%\%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes %aac-root-namespace%.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" ) -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end + +:NormalizePath +@SET _NORMALIZED_PATH_=%~f1 +@EXIT /B 0 + :end \ No newline at end of file diff --git a/Samples/dotnet.eShop/draw-diagrams.bat b/Samples/dotnet.eShop/draw-diagrams.bat index 1a0cd56db..0473d7ece 100644 --- a/Samples/dotnet.eShop/draw-diagrams.bat +++ b/Samples/dotnet.eShop/draw-diagrams.bat @@ -1,13 +1,13 @@ @echo off :: Possible values: TRUE, FALSE -set "redraw-all=TRUE" +if not defined redraw-all set "redraw-all=TRUE" ::::::::::::::::::::::::::::::: :: Possible values: CSharp, Yaml -set "aac-type=Yaml" +if not defined aac-type set "aac-type=Yaml" :::::::::::::::::::::::::::::::: -set "build-configuration=Debug" +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=DotNetEShop" set "aac-project-name=DotNetEShop" set "cli-project-path=.\%aac-project-name%.Cli\%aac-project-name%.Cli.csproj" @@ -19,17 +19,26 @@ set "aac-reader-strategy=C4InterFlow.Automation.Readers.%aac-type%AaCReaderStrat if %aac-type%==CSharp set "aac-input-paths=%aac-project-name%.dll" if %aac-type%==Yaml set "aac-input-paths=%aac-project-name%\Yaml" -echo redraw-all: %redraw-all% -echo aac-type: %aac-type% -echo build-configuration: %build-configuration% -echo aac-root-namespace: %aac-root-namespace% -echo aac-project-name: %aac-project-name% -echo cli-project-path: %cli-project-path% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% -echo diagrams-dir: %diagrams-dir% -echo aac-reader-strategy: %aac-reader-strategy% -echo aac-input-paths: %aac-input-paths% +CALL :NormalizePath %cli-project-path% +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath %cli-output-dir% +SET "cli-output-dir=%_NORMALIZED_PATH_%" +CALL :NormalizePath %aac-input-paths% +SET "aac-input-paths=%_NORMALIZED_PATH_%" +CALL :NormalizePath %diagrams-dir% +SET "diagrams-dir=%_NORMALIZED_PATH_%" + +echo redraw-all : %redraw-all% +echo aac-type : %aac-type% +echo build-configuration : %build-configuration% +echo aac-root-namespace : %aac-root-namespace% +echo aac-project-name : %aac-project-name% +echo cli-project-path : %cli-project-path% +echo cli-output-dir : %cli-output-dir% +echo cli-exe : %cli-exe% +echo diagrams-dir : %diagrams-dir% +echo aac-reader-strategy : %aac-reader-strategy% +echo aac-input-paths : %aac-input-paths% if not %aac-type%==CSharp if not %aac-type%==Yaml ( echo ERROR: 'aac-type' can only be set either to 'CSharp' or 'Yaml'. Edit script and re-run. @@ -43,10 +52,15 @@ if not %redraw-all%==TRUE if not %redraw-all%==FALSE ( goto end ) -echo Check the above settings. -pause +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) -dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% +:: Publish +echo Publishing... +:: pause +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet --property:WarningLevel=0 echo Clearing diagrams... :: pause @@ -57,7 +71,7 @@ powershell.exe -Command "if (Test-Path '%diagrams-dir%\*') { Get-ChildItem -Path ) echo Draw Diagrams with '%aac-reader-strategy%' AaC reader strategy and '%aac-input-paths%' AaC input path -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause echo Drawing Diagrams... if %redraw-all%==TRUE ( @@ -65,5 +79,11 @@ if %redraw-all%==TRUE ( ) else ( %cli-output-dir%\%cli-exe% draw-diagrams --interfaces %aac-root-namespace%.SoftwareSystems.*.Containers.*.Components.*.Interfaces.* --aac-reader-strategy "%aac-reader-strategy%" --aac-input-paths "%aac-input-paths%" --output-dir "%diagrams-dir%" ) -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end + +:NormalizePath +@SET _NORMALIZED_PATH_=%~f1 +@EXIT /B 0 + :end \ No newline at end of file diff --git a/Samples/draw-diagrams.bat b/Samples/draw-diagrams.bat new file mode 100644 index 000000000..a8821357f --- /dev/null +++ b/Samples/draw-diagrams.bat @@ -0,0 +1,122 @@ +:: Push the current directory so we can drop back to it after +@pushd + +@setlocal enableextensions enabledelayedexpansion + +@CALL :SetESC +@CALL :SetColors +@SET /A _TIMEOUT_=2 + +@ECHO Make a choice for the following parameters. The default value will be chosen after %_TIMEOUT_% seconds of no input. +@ECHO. + +@CHOICE /c TF /T %_TIMEOUT_% /D F /M "Redraw all diagrams - [T]rue or [F]alse (default: False)" +@IF %ERRORLEVEL% EQU 1 SET "redraw-all=TRUE" +@IF %ERRORLEVEL% EQU 2 SET "redraw-all=FALSE" + +@CHOICE /c DR /T %_TIMEOUT_% /D D /M "Build Configuration - [D]ebug or [R]elease (default: Debug)" +@IF %ERRORLEVEL% EQU 1 SET "build-configuration=Debug" +@IF %ERRORLEVEL% EQU 2 SET "build-configuration=Release" + +@SET ALL_ARGS=%* +@IF NOT DEFINED ALL_ARGS SET "ALL_ARGS=" + +@SET SCRIPT="%~dpnx0" +@SET SCRIPT_DIRECTORY="%~dp0" + +:: Assume the script is being run interactively +@SET SCRIPT_IS_INTERACTIVE=1 + +@SET BATCH_TEST_MODE=1 + +:: Search for the script's name in the command's command line +:: if the script exists there, it likely was executed by Explorer rather than the command line +:: Inspired by https://stackoverflow.com/a/9422268 +@ECHO %cmdcmdline% | FIND /i %SCRIPT% >nul +@IF NOT errorlevel 1 SET SCRIPT_IS_INTERACTIVE=0 +:: when executing this from Powershell, it runs the same command as if it is coming from Explorer +:: So, circumvent that by checking for something that's different about Powershell... +:: See https://github.com/PowerShell/PowerShell/issues/9797 for more context +@ECHO "%PATHEXT%" | FIND /i ".CPL" >nul +@IF NOT errorlevel 1 SET SCRIPT_IS_INTERACTIVE=1 + + +@SET _OUTPUT_CHANGED_=0 + +@SET "aac-type=Yaml" +@CALL :DrawDiagrams "dotnet EShop (%aac-type%)" "dotnet.eShop" +@IF "%_OUTPUT_CHANGED_%"=="1" GOTO :ReportOutputChanged + +@SET "aac-type=CSharp" +::@CALL :DrawDiagrams "dotnet EShop (%aac-type%)" "dotnet.eShop" +@IF "%_OUTPUT_CHANGED_%"=="1" GOTO :ReportOutputChanged + +@SET "aac-type=Yaml" +@CALL :DrawDiagrams "E-Commerce Platform (%aac-type%)" "E-Commerce Platform\%aac-type%" +@IF "%_OUTPUT_CHANGED_%"=="1" GOTO :ReportOutputChanged + +@SET "aac-type=CSV" +@CALL :DrawDiagrams "Internet Banking System (%aac-type%)" "Internet Banking System\%aac-type%" +@IF "%_OUTPUT_CHANGED_%"=="1" GOTO :ReportOutputChanged + +@SET "aac-type=Yaml" +@CALL :DrawDiagrams "Internet Banking System (%aac-type%)" "Internet Banking System\%aac-type%" +@IF "%_OUTPUT_CHANGED_%"=="1" GOTO :ReportOutputChanged + +@SET "aac-type=Yaml" +@CALL :DrawDiagrams "ToDoApp (%aac-type%)" "ToDoApp" +@IF "%_OUTPUT_CHANGED_%"=="1" GOTO :ReportOutputChanged + +@SET "aac-type=CSV" +@CALL :DrawDiagrams "TraderX (%aac-type%)" "TraderX\%aac-type%" +@IF "%_OUTPUT_CHANGED_%"=="1" GOTO :ReportOutputChanged + +@GOTO :EXIT + + + + +:SetESC +@for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do @( + set ESC=%%b + exit /B 0 +) +@exit /B 0 + +:SetColors +@SET "COLOR_RESET=%ESC%[0m" +@SET "COLOR_FG_RED=%ESC%[91m" +@SET "COLOR_FG_GREEN=%ESC%[92m" +@SET "ENABLE_LINE_DRAWING=%ESC%(0" +@SET "DISABLE_LINE_DRAWING=%ESC%(B" +@exit /B 0 + +:DrawDiagrams +:: Pad the name with enough whitespace to trim after +@SET "_SAMPLE_NAME_=%1 " +@SET "_DIRECTORY_=%2" + +:: Because the parameters will likely have spaces in them, they are passed in quotes. +:: So strip the quotes off because Batch files will pass the quotes as part of the parameter. +@SET "_SAMPLE_NAME_=%_SAMPLE_NAME_:"=%" +::@SET "_DIRECTORY_=%_DIRECTORY_:"=%" + +@ECHO. +:: See https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN#designate-character-set to understand the DEC Line Drawing mode +@ECHO %COLOR_FG_GREEN%%ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk +@ECHO x %DISABLE_LINE_DRAWING%!_SAMPLE_NAME_:~0,70!%ENABLE_LINE_DRAWING% x +@ECHO mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +@CD %SCRIPT_DIRECTORY%\!_DIRECTORY_! +@CALL %SCRIPT_DIRECTORY%\!_DIRECTORY_!\draw-diagrams.bat +FOR /f "tokens=*" %%a in ('git status --short --porcelain --untracked-files=normal -- "%diagrams-dir%"') DO SET _OUTPUT_CHANGED_=1 +@exit /B 0 + +:ReportOutputChanged +@ECHO %COLOR_FG_RED%The files in '%diagrams-dir%' has changed !!!!!%COLOR_RESET% +@GOTO :EXIT + +:EXIT +:: Pause only if the script was opened from Explorer +@IF "%SCRIPT_IS_INTERACTIVE%"=="0" PAUSE +@ENDLOCAL +@POPD From 8c77143d7a6b2356a028dd76017db5c794a117bf Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Fri, 20 Sep 2024 10:56:24 -0500 Subject: [PATCH 08/12] test: add 'execute-aac-strategy' runner script This way it's easy enough to execute all executions in a single go. --- .../CSV/execute-aac-strategy.bat | 90 +++++++----- Samples/TraderX/CSV/execute-aac-strategy.bat | 89 +++++++----- Samples/dotnet.eShop/execute-aac-strategy.bat | 39 ++--- Samples/draw-diagrams.bat | 6 +- Samples/execute-aac-strategy.bat | 136 ++++++++++++++++++ 5 files changed, 269 insertions(+), 91 deletions(-) create mode 100644 Samples/execute-aac-strategy.bat diff --git a/Samples/Internet Banking System/CSV/execute-aac-strategy.bat b/Samples/Internet Banking System/CSV/execute-aac-strategy.bat index ca5900bad..f7a89b13c 100644 --- a/Samples/Internet Banking System/CSV/execute-aac-strategy.bat +++ b/Samples/Internet Banking System/CSV/execute-aac-strategy.bat @@ -1,61 +1,79 @@ @echo off -set "build-configuration=Debug" +if not defined aac-type set "aac-type=Json" +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=BigBankPlc" set "aac-project-name=Architecture" set "cli-project-path=..\..\..\C4InterFlow.Cli\C4InterFlow.Cli.csproj" set "cli-output-dir=..\..\..\C4InterFlow.Cli\bin\%build-configuration%\net6.0" set "cli-exe=C4InterFlow.Cli.exe" set "aac-input-path=Architecture Catalogue - CSV Export" +set "aac-output-path=%aac-project-name%\%aac-type%" +set "aac-writer-strategy=C4InterFlow.Automation.Writers.CsvTo%aac-type%AaCGenerator,C4InterFlow.Automation" -echo build-configuration: %build-configuration% -echo aac-root-namespace: %aac-root-namespace% -echo aac-input-path: %aac-input-path% -echo aac-output-path: %aac-output-path% -echo cli-project-path: %cli-project-path% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% +if not %aac-type%==Json if not %aac-type%==Yaml ( + echo ERROR: 'aac-type' can only be set either to 'Json' or 'Yaml'. Edit script and re-run. + pause + goto end +) +CALL :NormalizePath "%cli-project-path%" +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath "%cli-project-path%" +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath "%cli-output-dir%" +SET "cli-output-dir=%_NORMALIZED_PATH_%" +CALL :NormalizePath "%aac-output-path%" +SET "aac-output-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath "%aac-input-path%" +SET "aac-input-path=%_NORMALIZED_PATH_%" + +if "%ENABLE_LINE_DRAWING%"=="" ( + echo build-configuration : %build-configuration% + echo aac-root-namespace : %aac-root-namespace% + echo aac-input-path : %aac-input-path% + echo aac-output-path : %aac-output-path% + echo aac-writer-strategy : %aac-writer-strategy% + echo cli-project-path : %cli-project-path% + echo cli-output-dir : %cli-output-dir% + echo cli-exe : %cli-exe% +) else ( + @ECHO %ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk + echo x %DISABLE_LINE_DRAWING%build-configuration %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%build-configuration%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%aac-root-namespace %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%aac-root-namespace%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%aac-input-path %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%COLOR_FG_CYAN%%aac-input-path%%COLOR_RESET%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%aac-output-path %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%COLOR_FG_CYAN%%aac-output-path%%COLOR_RESET%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%aac-writer-strategy %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%aac-writer-strategy%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%cli-project-path %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%COLOR_FG_CYAN%%cli-project-path%%COLOR_RESET%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%cli-output-dir %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%COLOR_FG_CYAN%%cli-output-dir%%COLOR_RESET%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%cli-exe %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%cli-exe%%ENABLE_LINE_DRAWING% + @ECHO mqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +) + +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) -echo Check the above settings. -pause :: Publish echo Publishing... -:: pause -dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% - -set "aac-output-path=%aac-project-name%\Json" -set "aac-writer-strategy=C4InterFlow.Automation.Writers.CsvToJsonAaCGenerator,C4InterFlow.Automation" +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet :: Clear AaC echo Clearing AaC at '%aac-output-path%'... -:: pause - powershell.exe -Command "if (Test-Path '%aac-output-path%\*') { Remove-Item -Path '%aac-output-path%\*' -Recurse -Force }" - echo AaC is cleared -:: pause :: Execute AaC Strategy echo Executing AaC Strategy using '%aac-writer-strategy%' with '%aac-output-path%' output directory... -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause %cli-output-dir%\%cli-exe% execute-aac-strategy --aac-root-namespace "%aac-root-namespace%" --aac-output-path "%aac-output-path%" --aac-writer-strategy "%aac-writer-strategy%" --params aac-input-path="%aac-input-path%" -set "aac-output-path=%aac-project-name%\Yaml" -set "aac-writer-strategy=C4InterFlow.Automation.Writers.CsvToYamlAaCGenerator,C4InterFlow.Automation" - -:: Clear AaC -echo Clearing AaC at '%aac-output-path%'... -:: pause +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end -powershell.exe -Command "if (Test-Path '%aac-output-path%\*') { Remove-Item -Path '%aac-output-path%\*' -Recurse -Force }" - -echo AaC is cleared -:: pause - -:: Execute AaC Strategy -echo Executing AaC Strategy using '%aac-writer-strategy%' with '%aac-output-path%' output directory... -pause -%cli-output-dir%\%cli-exe% execute-aac-strategy --aac-root-namespace "%aac-root-namespace%" --aac-output-path "%aac-output-path%" --aac-writer-strategy "%aac-writer-strategy%" --params aac-input-path="%aac-input-path%" +:NormalizePath +@SET "_NORMALIZED_PATH_=%~f1" +@EXIT /B 0 -pause \ No newline at end of file +:end \ No newline at end of file diff --git a/Samples/TraderX/CSV/execute-aac-strategy.bat b/Samples/TraderX/CSV/execute-aac-strategy.bat index a02fdfb1f..46a0b9c8b 100644 --- a/Samples/TraderX/CSV/execute-aac-strategy.bat +++ b/Samples/TraderX/CSV/execute-aac-strategy.bat @@ -1,61 +1,78 @@ @echo off -set "build-configuration=Debug" +if not defined aac-type set "aac-type=Json" + +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=TraderXExample" set "aac-project-name=Architecture" set "cli-project-path=..\..\..\C4InterFlow.Cli\C4InterFlow.Cli.csproj" set "cli-output-dir=..\..\..\C4InterFlow.Cli\bin\%build-configuration%\net6.0" set "cli-exe=C4InterFlow.Cli.exe" set "aac-input-path=Architecture Catalogue - CSV Export" +set "aac-output-path=%aac-project-name%\%aac-type%" +set "aac-writer-strategy=C4InterFlow.Automation.Writers.CsvTo%aac-type%AaCGenerator,C4InterFlow.Automation" + +if not %aac-type%==Json if not %aac-type%==Yaml ( + echo ERROR: 'aac-type' can only be set either to 'Json' or 'Yaml'. Edit script and re-run. + pause + goto end +) + +CALL :NormalizePath %cli-project-path% +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath %cli-project-path% +SET "cli-project-path=%_NORMALIZED_PATH_%" +CALL :NormalizePath %cli-output-dir% +SET "cli-output-dir=%_NORMALIZED_PATH_%" + +if "%ENABLE_LINE_DRAWING%"=="" ( + echo build-configuration : %build-configuration% + echo aac-root-namespace : %aac-root-namespace% + echo aac-input-path : %aac-input-path% + echo aac-output-path : %aac-output-path% + echo aac-writer-strategy : %aac-writer-strategy% + echo cli-project-path : %cli-project-path% + echo cli-output-dir : %cli-output-dir% + echo cli-exe : %cli-exe% +) else ( + @ECHO %ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk + echo x %DISABLE_LINE_DRAWING%build-configuration %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%build-configuration%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%aac-root-namespace %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%aac-root-namespace%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%aac-input-path %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%aac-input-path%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%aac-output-path %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%aac-output-path%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%aac-writer-strategy %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%aac-writer-strategy%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%cli-project-path %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%cli-project-path%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%cli-output-dir %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%cli-output-dir%%ENABLE_LINE_DRAWING% + echo x %DISABLE_LINE_DRAWING%cli-exe %ENABLE_LINE_DRAWING%x %DISABLE_LINE_DRAWING%%cli-exe%%ENABLE_LINE_DRAWING% + @ECHO mqqqqqqqqqqqqqqqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +) -echo build-configuration: %build-configuration% -echo aac-root-namespace: %aac-root-namespace% -echo aac-input-path: %aac-input-path% -echo aac-output-path: %aac-output-path% -echo cli-project-path: %cli-project-path% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) -echo Check the above settings. -pause :: Publish echo Publishing... -:: pause -dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet -set "aac-output-path=%aac-project-name%\Json" -set "aac-writer-strategy=C4InterFlow.Automation.Writers.CsvToJsonAaCGenerator,C4InterFlow.Automation" :: Clear AaC echo Clearing AaC at '%aac-output-path%'... -:: pause - powershell.exe -Command "if (Test-Path '%aac-output-path%\*') { Remove-Item -Path '%aac-output-path%\*' -Recurse -Force }" - -echo AaC is cleared -:: pause +echo AaC (%aac-output-path%) is cleared :: Execute AaC Strategy echo Executing AaC Strategy using '%aac-writer-strategy%' with '%aac-output-path%' output directory... -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause %cli-output-dir%\%cli-exe% execute-aac-strategy --aac-root-namespace "%aac-root-namespace%" --aac-output-path "%aac-output-path%" --aac-writer-strategy "%aac-writer-strategy%" --params aac-input-path="%aac-input-path%" -set "aac-output-path=%aac-project-name%\Yaml" -set "aac-writer-strategy=C4InterFlow.Automation.Writers.CsvToYamlAaCGenerator,C4InterFlow.Automation" +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end -:: Clear AaC -echo Clearing AaC at '%aac-output-path%'... -:: pause - -powershell.exe -Command "if (Test-Path '%aac-output-path%\*') { Remove-Item -Path '%aac-output-path%\*' -Recurse -Force }" - -echo AaC is cleared -:: pause - -:: Execute AaC Strategy -echo Executing AaC Strategy using '%aac-writer-strategy%' with '%aac-output-path%' output directory... -pause -%cli-output-dir%\%cli-exe% execute-aac-strategy --aac-root-namespace "%aac-root-namespace%" --aac-output-path "%aac-output-path%" --aac-writer-strategy "%aac-writer-strategy%" --params aac-input-path="%aac-input-path%" +:NormalizePath +@SET _NORMALIZED_PATH_=%~f1 +@EXIT /B 0 -pause \ No newline at end of file +:end \ No newline at end of file diff --git a/Samples/dotnet.eShop/execute-aac-strategy.bat b/Samples/dotnet.eShop/execute-aac-strategy.bat index 995919cef..b99c24539 100644 --- a/Samples/dotnet.eShop/execute-aac-strategy.bat +++ b/Samples/dotnet.eShop/execute-aac-strategy.bat @@ -1,14 +1,14 @@ @echo off :: Set net-sourcecode-dir to the directory path where E-Shop repo was cloned to -set "net-sourcecode-dir=C:\Data\Projects\C4InterFlow\eShop-main" +@IF NOT DEFINED net-sourcecode-dir set "net-sourcecode-dir=C:\Data\Projects\C4InterFlow\eShop-main" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: Possible values: CSharp, Yaml -set "aac-type=CSharp" +@IF NOT DEFINED aac-type set "aac-type=CSharp" :::::::::::::::::::::::::::::::: -set "build-configuration=Debug" +if not defined build-configuration set "build-configuration=Debug" set "aac-root-namespace=DotNetEShop" set "aac-project-name=DotNetEShop" set "cli-project-path=.\%aac-project-name%.Cli\%aac-project-name%.Cli.csproj" @@ -18,14 +18,14 @@ set "cli-exe=%aac-project-name%.Cli.exe" if %aac-type%==CSharp set "aac-output-path=%aac-project-name%\%aac-project-name%.csproj" if %aac-type%==Yaml set "aac-output-path=%aac-project-name%\Yaml" -echo aac-type: %aac-type% -echo net-sourcecode-dir: %net-sourcecode-dir% +echo aac-type : %aac-type% +echo net-sourcecode-dir : %net-sourcecode-dir% echo build-configuration: %build-configuration% -echo aac-root-namespace: %aac-root-namespace% -echo aac-project-name: %aac-project-name% -echo cli-project-path: %cli-project-path% -echo cli-output-dir: %cli-output-dir% -echo cli-exe: %cli-exe% +echo aac-root-namespace : %aac-root-namespace% +echo aac-project-name : %aac-project-name% +echo cli-project-path : %cli-project-path% +echo cli-output-dir : %cli-output-dir% +echo cli-exe : %cli-exe% if not %aac-type%==CSharp if not %aac-type%==Yaml ( echo ERROR: 'aac-type' can only be set either to 'CSharp' or 'Yaml'. Edit script and re-run. @@ -39,12 +39,15 @@ if not exist %net-sourcecode-dir% ( goto end ) -echo Check the above settings. -pause +if NOT "%BATCH_TEST_MODE%"=="1" ( + echo Check the above settings. + pause +) + :: Publish echo Publishing... :: pause -dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% +dotnet publish %cli-project-path% --configuration %build-configuration% --output %cli-output-dir% --verbosity quiet --property:WarningLevel=0 :: Clear AaC echo Clearing AaC... @@ -57,7 +60,6 @@ powershell.exe -Command "if (Test-Path '%aac-project-name%\BusinessProcesses\*') if %aac-type%==Yaml ( powershell.exe -Command "if (Test-Path '%aac-project-name%\Yaml\*') { Remove-Item -Path '%aac-project-name%\Yaml\*' -Recurse -Force }" ) -echo AaC is cleared :: pause :: Execute AaC Strategy @@ -67,6 +69,11 @@ echo Executing AaC Strategy... %cli-output-dir%\%cli-exe% execute-aac-strategy --aac-root-namespace "%aac-root-namespace%" --aac-output-path "%aac-output-path%" --aac-writer-strategy "%aac-project-name%.Cli.CSharpTo%aac-type%CatalogApiAaCGenerator, %aac-project-name%.Cli" --params software-system-source-path="%net-sourcecode-dir%\src\Catalog.API\Catalog.API.csproj" --params software-system-name="CatalogApi" -pause +if NOT "%BATCH_TEST_MODE%"=="1" pause +@GOTO :end + +:NormalizePath +@SET _NORMALIZED_PATH_=%~f1 +@EXIT /B 0 -:end \ No newline at end of file +:end \ No newline at end of file diff --git a/Samples/draw-diagrams.bat b/Samples/draw-diagrams.bat index a8821357f..baac96c88 100644 --- a/Samples/draw-diagrams.bat +++ b/Samples/draw-diagrams.bat @@ -22,7 +22,7 @@ @IF NOT DEFINED ALL_ARGS SET "ALL_ARGS=" @SET SCRIPT="%~dpnx0" -@SET SCRIPT_DIRECTORY="%~dp0" +@SET "SCRIPT_DIRECTORY=%~dp0" :: Assume the script is being run interactively @SET SCRIPT_IS_INTERACTIVE=1 @@ -106,8 +106,8 @@ @ECHO %COLOR_FG_GREEN%%ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk @ECHO x %DISABLE_LINE_DRAWING%!_SAMPLE_NAME_:~0,70!%ENABLE_LINE_DRAWING% x @ECHO mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% -@CD %SCRIPT_DIRECTORY%\!_DIRECTORY_! -@CALL %SCRIPT_DIRECTORY%\!_DIRECTORY_!\draw-diagrams.bat +@CD %SCRIPT_DIRECTORY%!_DIRECTORY_! +@CALL "%SCRIPT_DIRECTORY%!_DIRECTORY_!\draw-diagrams.bat" FOR /f "tokens=*" %%a in ('git status --short --porcelain --untracked-files=normal -- "%diagrams-dir%"') DO SET _OUTPUT_CHANGED_=1 @exit /B 0 diff --git a/Samples/execute-aac-strategy.bat b/Samples/execute-aac-strategy.bat new file mode 100644 index 000000000..eb3028c69 --- /dev/null +++ b/Samples/execute-aac-strategy.bat @@ -0,0 +1,136 @@ +:: Push the current directory so we can drop back to it after +@pushd + +@setlocal enableextensions enabledelayedexpansion + +@CALL :SetESC +@CALL :SetColors +@SET /A _TIMEOUT_=2 + +@IF NOT DEFINED net-sourcecode-dir SET "net-sourcecode-dir=C:\Data\Projects\C4InterFlow\eShop-main" + +@SET /P "eshop_path=Where is the dotnet EShop repo cloned to (default: '%net-sourcecode-dir%')?" +@IF DEFINED eshop_path SET "net-sourcecode-dir=%eshop_path%" +@IF NOT EXIST "%net-sourcecode-dir%\eShop.sln" ( + ECHO "Could not find the 'eShop.sln' file under '%net-sourcecode-dir%'!" + EXIT 1 +) + +@ECHO Make a choice for the following parameters. The default value will be chosen after %_TIMEOUT_% seconds of no input. +@ECHO. + +@CHOICE /c DR /T %_TIMEOUT_% /D D /M "Build Configuration - [D]ebug or [R]elease (default: Debug)" +@IF %ERRORLEVEL% EQU 1 SET "build-configuration=Debug" +@IF %ERRORLEVEL% EQU 2 SET "build-configuration=Release" + + +@CHOICE /c YN /T %_TIMEOUT_% /D Y /M "Stop execution if files change " +@IF %ERRORLEVEL% EQU 1 SET "stop_on_modified=1" +@IF %ERRORLEVEL% EQU 2 SET "stop_on_modified=0" + + +@SET ALL_ARGS=%* +@IF NOT DEFINED ALL_ARGS SET "ALL_ARGS=" + +@SET SCRIPT="%~dpnx0" +@SET "SCRIPT_DIRECTORY=%~dp0" + +:: Assume the script is being run interactively +@SET SCRIPT_IS_INTERACTIVE=1 + +@SET BATCH_TEST_MODE=1 + +:: Search for the script's name in the command's command line +:: if the script exists there, it likely was executed by Explorer rather than the command line +:: Inspired by https://stackoverflow.com/a/9422268 +@ECHO %cmdcmdline% | FIND /i %SCRIPT% >nul +@IF NOT errorlevel 1 SET SCRIPT_IS_INTERACTIVE=0 +:: when executing this from Powershell, it runs the same command as if it is coming from Explorer +:: So, circumvent that by checking for something that's different about Powershell... +:: See https://github.com/PowerShell/PowerShell/issues/9797 for more context +@ECHO "%PATHEXT%" | FIND /i ".CPL" >nul +@IF NOT errorlevel 1 SET SCRIPT_IS_INTERACTIVE=1 + + +@SET _OUTPUT_CHANGED_=0 + +@SET "aac-type=Yaml" +::@CALL :ExecuteAaCStrategy "dotnet EShop (%aac-type%)" "dotnet.eShop" +@IF "%_OUTPUT_CHANGED_%"=="1" CALL :ReportOutputChanged + +@SET "aac-type=CSharp" +::@CALL :ExecuteAaCStrategy "dotnet EShop (%aac-type%)" "dotnet.eShop" +@IF "%_OUTPUT_CHANGED_%"=="1" CALL :ReportOutputChanged + +@SET "aac-type=Json" +@CALL :ExecuteAaCStrategy "Internet Banking System (%aac-type%)" "Internet Banking System\CSV" +@IF "%_OUTPUT_CHANGED_%"=="1" CALL :ReportOutputChanged + +@SET "aac-type=Yaml" +@CALL :ExecuteAaCStrategy "Internet Banking System (%aac-type%)" "Internet Banking System\CSV" +@IF "%_OUTPUT_CHANGED_%"=="1" CALL :ReportOutputChanged + +@SET "aac-type=Json" +@CALL :ExecuteAaCStrategy "TraderX (%aac-type%)" "TraderX\CSV" +@IF "%_OUTPUT_CHANGED_%"=="1" CALL :ReportOutputChanged + +@SET "aac-type=Yaml" +@CALL :ExecuteAaCStrategy "TraderX (%aac-type%)" "TraderX\CSV" +@IF "%_OUTPUT_CHANGED_%"=="1" CALL :ReportOutputChanged + + + +@GOTO :EXIT + + + + +:SetESC +@for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do @( + set ESC=%%b + exit /B 0 +) +@exit /B 0 + +:SetColors +@SET "COLOR_RESET=%ESC%[0m" +@SET "COLOR_FG_RED=%ESC%[91m" +@SET "COLOR_FG_GREEN=%ESC%[92m" +@SET "COLOR_FG_CYAN=%ESC%[94m" +@SET "ENABLE_LINE_DRAWING=%ESC%(0" +@SET "DISABLE_LINE_DRAWING=%ESC%(B" +@exit /B 0 + +:ExecuteAaCStrategy +:: Pad the name with enough whitespace to trim after +@SET "_SAMPLE_NAME_=%1 " +@SET "_DIRECTORY_=%2" + +:: Because the parameters will likely have spaces in them, they are passed in quotes. +:: So strip the quotes off because Batch files will pass the quotes as part of the parameter. +@SET "_SAMPLE_NAME_=%_SAMPLE_NAME_:"=%" +@SET "_DIRECTORY_=%_DIRECTORY_:"=%" + +@ECHO. +:: See https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN#designate-character-set to understand the DEC Line Drawing mode +@ECHO %COLOR_FG_GREEN%%ENABLE_LINE_DRAWING%lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk +@ECHO x %DISABLE_LINE_DRAWING%!_SAMPLE_NAME_:~0,70!%ENABLE_LINE_DRAWING% x +@ECHO mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj%DISABLE_LINE_DRAWING%%COLOR_RESET% +@CD %SCRIPT_DIRECTORY%!_DIRECTORY_! +@CALL "%SCRIPT_DIRECTORY%!_DIRECTORY_!\execute-aac-strategy.bat" +FOR /f "tokens=*" %%a in ('git status --short --porcelain --untracked-files=normal -- "%aac-output-path%"') DO SET _OUTPUT_CHANGED_=1 +@exit /B 0 + +:ReportOutputChanged +@ECHO %COLOR_FG_RED%The files in '%aac-output-path%' has changed !!!!!%COLOR_RESET% +@IF "%stop_on_modified%"=="1" ( + @GOTO :EXIT +) else ( + @EXIT /B 0 +) + +:EXIT +:: Pause only if the script was opened from Explorer +@IF "%SCRIPT_IS_INTERACTIVE%"=="0" PAUSE +@ENDLOCAL +@POPD \ No newline at end of file From 201258bcab04eac472d5982c25a3413fd1579f3f Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Wed, 25 Sep 2024 08:27:52 -0500 Subject: [PATCH 09/12] chore: update timeout to be 10 seconds --- Samples/draw-diagrams.bat | 2 +- Samples/execute-aac-strategy.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Samples/draw-diagrams.bat b/Samples/draw-diagrams.bat index baac96c88..452057b2b 100644 --- a/Samples/draw-diagrams.bat +++ b/Samples/draw-diagrams.bat @@ -5,7 +5,7 @@ @CALL :SetESC @CALL :SetColors -@SET /A _TIMEOUT_=2 +@SET /A _TIMEOUT_=10 @ECHO Make a choice for the following parameters. The default value will be chosen after %_TIMEOUT_% seconds of no input. @ECHO. diff --git a/Samples/execute-aac-strategy.bat b/Samples/execute-aac-strategy.bat index eb3028c69..0a25cbc22 100644 --- a/Samples/execute-aac-strategy.bat +++ b/Samples/execute-aac-strategy.bat @@ -5,7 +5,7 @@ @CALL :SetESC @CALL :SetColors -@SET /A _TIMEOUT_=2 +@SET /A _TIMEOUT_=10 @IF NOT DEFINED net-sourcecode-dir SET "net-sourcecode-dir=C:\Data\Projects\C4InterFlow\eShop-main" From 1ba0de80f033b4474929b2999b198198a5a2ebcf Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Wed, 25 Sep 2024 08:32:38 -0500 Subject: [PATCH 10/12] bug: account for spaces in Sample paths --- Samples/draw-diagrams.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Samples/draw-diagrams.bat b/Samples/draw-diagrams.bat index 452057b2b..3ec6900eb 100644 --- a/Samples/draw-diagrams.bat +++ b/Samples/draw-diagrams.bat @@ -99,7 +99,7 @@ :: Because the parameters will likely have spaces in them, they are passed in quotes. :: So strip the quotes off because Batch files will pass the quotes as part of the parameter. @SET "_SAMPLE_NAME_=%_SAMPLE_NAME_:"=%" -::@SET "_DIRECTORY_=%_DIRECTORY_:"=%" +@SET "_DIRECTORY_=%_DIRECTORY_:"=%" @ECHO. :: See https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences?redirectedfrom=MSDN#designate-character-set to understand the DEC Line Drawing mode From 5b5dfc721414f27ed1b7c4c8db684e9baf686b92 Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Wed, 25 Sep 2024 08:40:42 -0500 Subject: [PATCH 11/12] chore: update Big Bank Plc debug settings Removing the top level interfaces per PR feedback. https://github.com/SlavaVedernikov/C4InterFlow/pull/104#discussion_r1773297447 --- C4InterFlow.Cli/Properties/launchSettings.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4InterFlow.Cli/Properties/launchSettings.json b/C4InterFlow.Cli/Properties/launchSettings.json index 3c0dcacbf..923696edd 100644 --- a/C4InterFlow.Cli/Properties/launchSettings.json +++ b/C4InterFlow.Cli/Properties/launchSettings.json @@ -6,15 +6,15 @@ }, "Internet Banking System - YAML - Draw Diagrams": { "commandName": "Project", - "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* BigBankPlc.SoftwareSystems.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --scopes namespace namespace-software-systems --types c4-static --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\Yaml\\Architecture\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\Yaml\\Diagrams\"" + "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --scopes namespace namespace-software-systems --types c4-static --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\Yaml\\Architecture\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\Yaml\\Diagrams\"" }, "Internet Banking System - CSV/YAML - Draw Diagrams": { "commandName": "Project", - "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* BigBankPlc.SoftwareSystems.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Architecture\\Yaml\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Diagrams\"" + "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.YamlAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Architecture\\Yaml\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Diagrams\"" }, "Internet Banking System - CSV/JSON - Draw Diagrams": { "commandName": "Project", - "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* BigBankPlc.SoftwareSystems.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.JsonAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Architecture\\Json\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Diagrams\"" + "commandLineArgs": "draw-diagrams --interfaces BigBankPlc.SoftwareSystems.*.Containers.*.Interfaces.* --business-processes BigBankPlc.BusinessProcesses.* --levels-of-details context container --aac-reader-strategy \"C4InterFlow.Automation.Readers.JsonAaCReaderStrategy,C4InterFlow.Automation\" --aac-input-paths \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Architecture\\Json\" --output-dir \"$(ProjectDir)\\..\\Samples\\Internet Banking System\\CSV\\Diagrams\"" }, "ToDoApp - YAML - Draw Diagrams": { "commandName": "Project", From 1fc9f44c7afda2abdf8bf98d091466c5f90dad4a Mon Sep 17 00:00:00 2001 From: Steven Evans Date: Fri, 27 Sep 2024 09:00:14 -0500 Subject: [PATCH 12/12] revert: dotnet.eShop Nuget references --- .../DotNetEShop.Cli/DotNetEShop.Cli.csproj | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Samples/dotnet.eShop/DotNetEShop.Cli/DotNetEShop.Cli.csproj b/Samples/dotnet.eShop/DotNetEShop.Cli/DotNetEShop.Cli.csproj index ed178fac0..68fb3adac 100644 --- a/Samples/dotnet.eShop/DotNetEShop.Cli/DotNetEShop.Cli.csproj +++ b/Samples/dotnet.eShop/DotNetEShop.Cli/DotNetEShop.Cli.csproj @@ -11,14 +11,13 @@ C:\Data\Projects\C4Interflow\eShop-main - - - - - - + + + + + - +