From 47b5e0bf72ff4282207ad7e5d36818cec957d1e4 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 2 Sep 2021 18:49:34 -0700 Subject: [PATCH] rename samples to examples; delete dead build scripts --- bin/all_dev_checks.sh | 4 +- bin/build_samples.sh | 12 +-- bin/run_samples.sh | 18 ++--- build.bat | 73 ------------------ build.sh | 65 ---------------- build_with_clang.bat | 76 ------------------- {samples => examples}/c_code_generation.c | 0 .../namespaced_types/conversion_test.c | 0 .../namespaced_types/generated/converter.c | 0 .../node_errors/node_errors.c | 0 .../node_errors/node_errors.mdesk | 0 .../old_style_custom_layer.c | 0 .../output_parse/examples/example.mdesk | 0 .../output_parse/examples/example2.mdesk | 0 .../examples/output/parsed_example.txt | 0 .../examples/output/parsed_example2.txt | 0 .../output_parse/output_parse.c | 0 {samples => examples}/parse_check.c | 0 18 files changed, 17 insertions(+), 231 deletions(-) delete mode 100644 build.bat delete mode 100755 build.sh delete mode 100644 build_with_clang.bat rename {samples => examples}/c_code_generation.c (100%) rename {samples => examples}/namespaced_types/conversion_test.c (100%) rename {samples => examples}/namespaced_types/generated/converter.c (100%) rename {samples => examples}/node_errors/node_errors.c (100%) rename {samples => examples}/node_errors/node_errors.mdesk (100%) rename {samples => examples}/old_style_custom_layer.c (100%) rename {samples => examples}/output_parse/examples/example.mdesk (100%) rename {samples => examples}/output_parse/examples/example2.mdesk (100%) rename {samples => examples}/output_parse/examples/output/parsed_example.txt (100%) rename {samples => examples}/output_parse/examples/output/parsed_example2.txt (100%) rename {samples => examples}/output_parse/output_parse.c (100%) rename {samples => examples}/parse_check.c (100%) diff --git a/bin/all_dev_checks.sh b/bin/all_dev_checks.sh index f6424f5..c3fc42f 100644 --- a/bin/all_dev_checks.sh +++ b/bin/all_dev_checks.sh @@ -9,9 +9,9 @@ root_path=$PWD ###### Bin Scripts ############################################################ $bin_path/build_tests.sh -$bin_path/build_samples.sh +$bin_path/build_examples.sh $bin_path/run_tests.sh -$bin_path/run_samples.sh +$bin_path/run_examples.sh ###### Restore Path ########################################################### cd $og_path diff --git a/bin/build_samples.sh b/bin/build_samples.sh index f8a81fe..29a8413 100644 --- a/bin/build_samples.sh +++ b/bin/build_samples.sh @@ -6,14 +6,14 @@ cd "$(dirname "$0")" cd .. ###### Script ################################################################# -echo "~~~ Build All Samples ~~~" +echo "~~~ Build All Exampes ~~~" bin/bld_core.sh show_ctx -bin/bld_core.sh unit old_style_custom_layer samples/old_style_custom_layer.c -bin/bld_core.sh unit output_parse samples/output_parse/output_parse.c -bin/bld_core.sh unit c_code_generation samples/c_code_generation.c -bin/bld_core.sh unit node_errors samples/node_errors/node_errors.c -bin/bld_core.sh unit parse_check samples/parse_check.c +bin/bld_core.sh unit old_style_custom_layer examples/old_style_custom_layer.c +bin/bld_core.sh unit output_parse examples/output_parse/output_parse.c +bin/bld_core.sh unit c_code_generation examples/c_code_generation.c +bin/bld_core.sh unit node_errors examples/node_errors/node_errors.c +bin/bld_core.sh unit parse_check examples/parse_check.c echo diff --git a/bin/run_samples.sh b/bin/run_samples.sh index d736305..3f2b967 100644 --- a/bin/run_samples.sh +++ b/bin/run_samples.sh @@ -4,12 +4,12 @@ og_path=$PWD cd "$(dirname "$0")" cd .. - root_path=$PWD - build_path=$root_path/build -samples_path=$root_path/samples + root_path=$PWD + build_path=$root_path/build +examples_path=$root_path/examples -echo ~~~ Running Output Parse Sample ~~~ -cd $samples_path +echo ~~~ Running Output Parse Example ~~~ +cd $examples_path if [ -d "output_parse/examples" ]; then cd output_parse/examples mkdir -p output @@ -18,17 +18,17 @@ if [ -d "output_parse/examples" ]; then fi echo -echo ~~~ Running C Code Generation Sample ~~~ +echo ~~~ Running C Code Generation Example ~~~ cd $build_path ./c_code_generation.exe echo -echo ~~~ Running Error Generation Sample ~~~ +echo ~~~ Running Error Generation Example ~~~ cd $build_path -./node_errors.exe $samples_path/node_errors/node_errors.mdesk +./node_errors.exe $examples_path/node_errors/node_errors.mdesk echo -echo ~~~ Running C++ Sample ~~~ +echo ~~~ Running C++ Example ~~~ cd $build_path ./cpp_build_test.exe echo diff --git a/build.bat b/build.bat deleted file mode 100644 index fa00f68..0000000 --- a/build.bat +++ /dev/null @@ -1,73 +0,0 @@ -@echo off - -echo ~~~ Metadesk Build ~~~ -set compile_flags= /nologo /Zi /FC /MP /I..\source\ - -if not exist build mkdir build -pushd build -echo. -echo ~~~ Build All Samples ~~~ -cl %compile_flags% ..\samples\old_style_custom_layer.c -cl %compile_flags% ..\samples\toy_language\toy_language.c -cl %compile_flags% ..\samples\static_site_generator\static_site_generator.c -cl %compile_flags% ..\samples\output_parse\output_parse.c -cl %compile_flags% ..\samples\c_code_generation.c -cl %compile_flags% ..\samples\node_errors\node_errors.c -cl %compile_flags% ..\samples\parse_check.c -echo. -echo ~~~ Build All Tests ~~~ -cl %compile_flags% ..\tests\sanity_tests.c -cl %compile_flags% ..\tests\unicode_test.c -cl %compile_flags% ..\tests\cpp_build_test.cpp -popd - -echo. -echo ~~~ Running Sanity Tests ~~~ -pushd build -sanity_tests.exe -popd - -echo. -echo ~~~ Running Static Site Generator Sample ~~~ -pushd samples -pushd static_site_generator -pushd example_site -if not exist generated mkdir generated -pushd generated -..\..\..\..\build\static_site_generator.exe --siteinfo:..\site_info.mdesk --pagedir:..\ -popd -popd -popd -popd - -echo. -echo ~~~ Running Output Parse Sample ~~~ -pushd samples -pushd output_parse -pushd examples -if not exist output mkdir output -pushd output -..\..\..\..\build\output_parse.exe ..\example.mdesk ..\example2.mdesk -popd -popd -popd -popd - -echo. -echo ~~~ Running C Code Generation Sample ~~~ -pushd build -c_code_generation.exe -popd - -echo. -echo ~~~ Running Error Generation Sample ~~~ -pushd build -node_errors.exe %~dp0\samples\node_errors\node_errors.mdesk -popd - -echo. -echo ~~~ Running C++ Sample ~~~ -pushd build -cpp_build_test.exe -popd - diff --git a/build.sh b/build.sh deleted file mode 100755 index 6082fd7..0000000 --- a/build.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -CC=clang - -# NOTE(mal): Silent pushd/popd -pushd () { - command pushd "$@" > /dev/null -} -popd () { - command popd "$@" > /dev/null -} - -echo ~~~ Metadesk Build ~~~ -# TODO(mal): Review these warnings -accepted_clang_warnings="-Wno-deprecated-declarations -Wno-pointer-sign -Wno-writable-strings -Wno-unknown-warning-option" -compile_flags="-I../source/ $accepted_clang_warnings" - -mkdir -p build -pushd build -echo -echo ~~~ Build All Samples ~~~ -$CC $compile_flags ../samples/old_style_custom_layer.c -o old_style_custom_layer -$CC $compile_flags ../samples/static_site_generator/static_site_generator.c -o static_site_generator -$CC $compile_flags ../samples/output_parse/output_parse.c -o output_parse -$CC $compile_flags ../samples/c_code_generation.c -o c_code_generation -$CC $compile_flags ../samples/node_errors/node_errors.c -o node_errors -echo -echo ~~~ Build All Tests ~~~ -$CC $compile_flags ../tests/sanity_tests.c -o sanity_tests -$CC $compile_flags ../tests/unicode_test.c -o unicode_test -clang++ $compile_flags ../tests/cpp_build_test.cpp -popd - -echo -echo ~~~ Running Sanity Tests ~~~ -pushd build -./sanity_tests -popd - -echo -echo ~~~ Running Static Site Generator Sample ~~~ -mkdir -p samples/static_site_generator/example_site/generated -pushd samples/static_site_generator/example_site/generated -../../../../build/static_site_generator --siteinfo ../site_info.mdesk --pagedir ../ -popd - -echo -echo ~~~ Running Output Parse Sample ~~~ -mkdir -p samples/output_parse/examples/output -pushd samples/output_parse/examples/output -../../../../build/output_parse ../example.mdesk ../example2.mdesk -popd - -echo -echo ~~~ Running C Code Generation Sample ~~~ -pushd build -./c_code_generation -popd - -echo -echo ~~~ Running Error Generation Sample ~~~ -pushd build -./node_errors ../samples/node_errors/node_errors.mdesk -popd - diff --git a/build_with_clang.bat b/build_with_clang.bat deleted file mode 100644 index 91e8c2e..0000000 --- a/build_with_clang.bat +++ /dev/null @@ -1,76 +0,0 @@ -@echo off - -echo ~~~ Metadesk Build ~~~ -set src=%cd% - -rem TODO(mal): Review these warnings -set accepted_clang_warnings=-Wno-deprecated-declarations -Wno-pointer-sign -Wno-writable-strings -Wno-unknown-warning-option -set compile_flags=-I%src%/source/ %accepted_clang_warnings% - -if not exist build mkdir build -pushd build -echo. -echo ~~~ Build All Samples ~~~ -clang %compile_flags% %src%\samples\old_style_custom_layer.c -o old_style_custom_layer.exe -clang %compile_flags% %src%\samples\static_site_generator\static_site_generator.c -o static_site_generator.exe -clang %compile_flags% %src%\samples\output_parse\output_parse.c -o output_parse.exe -clang %compile_flags% %src%\samples\c_code_generation.c -o c_code_generation.exe -clang %compile_flags% %src%\samples\node_errors\node_errors.c -o node_errors.exe -echo. -echo ~~~ Build All Tests ~~~ -clang %compile_flags% %src%\tests\sanity_tests.c -o sanity_tests.exe -clang %compile_flags% %src%\tests\unicode_test.c -o unicode_test.exe -clang++ %compile_flags% %src%\tests\cpp_build_test.cpp -o cpp_build_test.exe -popd - -echo. -echo ~~~ Running Sanity Tests ~~~ -pushd build -sanity_tests.exe -popd - -echo. -echo ~~~ Running Static Site Generator Sample ~~~ -pushd samples -pushd static_site_generator -pushd example_site -if not exist generated mkdir generated -pushd generated -..\..\..\..\build\static_site_generator.exe --siteinfo ..\site_info.mdesk --pagedir ..\ -popd -popd -popd -popd - -echo. -echo ~~~ Running Output Parse Sample ~~~ -pushd samples -pushd output_parse -pushd examples -if not exist output mkdir output -pushd output -..\..\..\..\build\output_parse.exe ..\example.mdesk ..\example2.mdesk -popd -popd -popd -popd - -echo. -echo ~~~ Running C Code Generation Sample ~~~ -pushd build -c_code_generation.exe -popd - -echo. -echo ~~~ Running Error Generation Sample ~~~ -pushd build -node_errors.exe %~dp0\samples\node_errors\node_errors.mdesk -popd - - -echo. -echo ~~~ Running C++ Sample ~~~ -pushd build -cpp_build_test.exe -popd - diff --git a/samples/c_code_generation.c b/examples/c_code_generation.c similarity index 100% rename from samples/c_code_generation.c rename to examples/c_code_generation.c diff --git a/samples/namespaced_types/conversion_test.c b/examples/namespaced_types/conversion_test.c similarity index 100% rename from samples/namespaced_types/conversion_test.c rename to examples/namespaced_types/conversion_test.c diff --git a/samples/namespaced_types/generated/converter.c b/examples/namespaced_types/generated/converter.c similarity index 100% rename from samples/namespaced_types/generated/converter.c rename to examples/namespaced_types/generated/converter.c diff --git a/samples/node_errors/node_errors.c b/examples/node_errors/node_errors.c similarity index 100% rename from samples/node_errors/node_errors.c rename to examples/node_errors/node_errors.c diff --git a/samples/node_errors/node_errors.mdesk b/examples/node_errors/node_errors.mdesk similarity index 100% rename from samples/node_errors/node_errors.mdesk rename to examples/node_errors/node_errors.mdesk diff --git a/samples/old_style_custom_layer.c b/examples/old_style_custom_layer.c similarity index 100% rename from samples/old_style_custom_layer.c rename to examples/old_style_custom_layer.c diff --git a/samples/output_parse/examples/example.mdesk b/examples/output_parse/examples/example.mdesk similarity index 100% rename from samples/output_parse/examples/example.mdesk rename to examples/output_parse/examples/example.mdesk diff --git a/samples/output_parse/examples/example2.mdesk b/examples/output_parse/examples/example2.mdesk similarity index 100% rename from samples/output_parse/examples/example2.mdesk rename to examples/output_parse/examples/example2.mdesk diff --git a/samples/output_parse/examples/output/parsed_example.txt b/examples/output_parse/examples/output/parsed_example.txt similarity index 100% rename from samples/output_parse/examples/output/parsed_example.txt rename to examples/output_parse/examples/output/parsed_example.txt diff --git a/samples/output_parse/examples/output/parsed_example2.txt b/examples/output_parse/examples/output/parsed_example2.txt similarity index 100% rename from samples/output_parse/examples/output/parsed_example2.txt rename to examples/output_parse/examples/output/parsed_example2.txt diff --git a/samples/output_parse/output_parse.c b/examples/output_parse/output_parse.c similarity index 100% rename from samples/output_parse/output_parse.c rename to examples/output_parse/output_parse.c diff --git a/samples/parse_check.c b/examples/parse_check.c similarity index 100% rename from samples/parse_check.c rename to examples/parse_check.c