Scripting updates, some refactors..

Made a package release script.

Did refactors based on some design considerations
Still need to make some major decisions...
This commit is contained in:
2023-08-09 18:47:59 -04:00
parent 5aff89262b
commit aa928ff446
46 changed files with 371 additions and 312 deletions

View File

@ -8,6 +8,20 @@ Generation, testing, and cleanup scripts for the test directory are found here a
Currently `refactor` only supports naive sort of *find and replace* feature set and will not be able to rename identifiers excluisvely to a specific context (such as only renaming member names of a specific struct, etc).
**Note: The following macros are used with specifiers and token parsing within the library:**
* global
* internal
* local_persist
* forceinline
* neverinline
IF they are changed the following files would need adjustment:
* `./project/enums/ESpecifier.csv`
* `./project/enums/ETokType.csv`
* `./project/helpers/helper.hpp`
## Build & Run Scripts
**`clean.ps1`**
@ -17,7 +31,7 @@ Remove any generated content from the repository.
Generate a version of gencpp where components are inlined directly to `gen.<hpp/cpp>` and `gen. <hpp/cpp>`
Any heavily preprocessed code is not inlined and are instead generated using the code in the `helpers` directory.
**`singlheader.build.ps1`**
**`singleheader.ps1`**
Generate a single-header version of the library where all code that would normally good in the usual four files (see bootstrap) are inlined into a single `gen.hpp` file.
As with the bootstrap, any heavily preprocessed code is not inlined and instead generated with helper code.

View File

@ -10,6 +10,7 @@ $path_test_build = Join-Path $path_test build
$path_gen = Join-Path $path_test gen
$path_gen_build = Join-Path $path_gen build
$path_x64 = Join-Path $path_root x64
$path_release = Join-Path $path_root release
if ( Test-Path $path_project_build)
{
@ -46,22 +47,10 @@ if ( Test-Path $path_x64)
Remove-Item $path_x64 -Recurse
}
# [string[]] $include = 'gen.hpp', 'gen.cpp', 'gen_dep.hpp', 'gen_dep.cpp'
# [string[]] $exclude =
# $files = Get-ChildItem -Recurse -Path $path_project_gen -Include $include -Exclude $exclude
# if ( $files )
# {
# Remove-Item $files
# }
# $files = Get-ChildItem -Recurse -Path $path_singleheader_gen -Include $include -Exclude $exclude
# if ( $files )
# {
# Remove-Item $files
# }
if ( Test-Path $path_release )
{
Remove-Item $path_release -Recurse
}
$include = '*.h', '*.hpp', '*.cpp'
$exclude =

View File

@ -48,8 +48,8 @@
<DisplayString>{(Header*)((char*)Data - sizeof(Header))}</DisplayString>
<Expand>
<Item Name="Allocator">((Header*)((char*)Data - sizeof(Header)))->Allocator</Item>
<Item Name="Length">((Header*)((char*)Data - sizeof(Header)))->Length</Item>
<Item Name="Capacity">((Header*)((char*)Data - sizeof(Header)))->Capacity</Item>
<Item Name="Length">((Header*)((char*)Data - sizeof(Header)))->Length</Item>
</Expand>
</Synthetic>
</Expand>

View File

@ -21,8 +21,8 @@
// Gen Macro namespace
// namespace GEN_, new_namespace_
// ---------- ZPL Macros
// ---------- Dependency Macros
// Platform
// word GEN_ARCH_64_BIT, new_name
// word GEN_ARCH_32_BIT, new_name
@ -43,20 +43,86 @@
// word GEN_COMPILER_MINGW, new_name
// word GEN_COMPILER_MSVC, new_name
// word forceinline, new_name
// word neverinline, new_name
// General
// word zpl_cast, new_name
// word global, new_name
// word internal, new_name
// word local_persist, new_name
// word forceinline, new_name
// word neverinline, new_name
// word bit, new_name
// word bitfield_is_equal, new_name
// word ccast, new_name
// word pcast, new_name
// word rcast, new_name
// word scast, new_name
// word num_args, new_name
// word num_args_impl, new_name
// word stringize, new_name
// word stringize_va, new_name
// word do_once, new_name
// word do_once_start, new_name
// word do_once_end, new_name
// word label_scope_start, new_name
// word label_scope_end, new_name
// word count_of, new_name
// word is_between, new_name
// word min, new_name
// word size_of, new_name
// word offset_of, new_name
// word swap, new_name
// Basic Types
// word GEN_U8_MIN, new_name
// word GEN_U8_MAX, new_name
// word GEN_I8_MIN, new_name
// word GEN_I8_MAX, new_name
// word GEN_U16_MIN, new_name
// word GEN_U16_MAX, new_name
// word GEN_I16_MIN, new_name
// word GEN_I16_MAX, new_name
// word GEN_U32_MIN, new_name
// word GEN_U32_MAX, new_name
// word GEN_I32_MIN, new_name
// word GEN_I32_MAX, new_name
// word GEN_U64_MIN, new_name
// word GEN_U64_MAX, new_name
// word GEN_I64_MIN, new_name
// word GEN_I64_MAX, new_name
// word GEN_USIZE_MIN, new_name
// word GEN_USIZE_MAX, new_name
// word GEN_ISIZE_MIN, new_name
// word GEN_ISIZE_MAX, new_name
// word GEN_F32_MIN, new_name
// word GEN_F32_MAX, new_name
// word GEN_F64_MIN, new_name
// word GEN_F64_MAX, new_name
// Debug
// word GEN_DEBUG_TRAP, new_name
// word GEN_ASSERT, new_name
// word GEN_ASSERT_MSG, new_name
// word GEN_ASSERT_NOT_NULL, new_name
// word GEN_PANIC, new_name
// word GEN_FATAL, new_name
// Memory
// word kilobytes, new_name
// word megabytes, new_name
// word gigabytes, new_name
// word terabytes, new_name
// word zero_item, new_name
// word zero_array, new_name
@ -67,13 +133,11 @@
// word malloc, new_name
// word mfree, new_name
// word count_of, new_name
// word is_between, new_name
// word min, new_name
// word size_of, new_name
// word swap, new_name
// Strings
// word txt, new_name
// word cast_to_strc, new_name
// ---------- ZPL Types
// ---------- Dependency Types
// word b8, new_name
// word b16, new_name
@ -114,11 +178,11 @@
// word FileStandardType, new_name
// word SeekWhenceType, new_name
// ---------- ZPL Data
// ---------- Dependency Data
// word default_file_operations, new_name
// ---------- ZPL Procedures
// ---------- Dependency Procedures
// word align_forward, new_name
// word align_fordward_i64, new_name
@ -158,6 +222,7 @@
// word hex_digit_to_int, new_name
// word i64_to_str, new_name
// word is_power_of_two, new_name
// word log_fmt, new_name
// word mem_copy, new_name
// word mem_move, new_name
// word mem_set, new_name
@ -189,22 +254,10 @@
// ---------- gencpp Macros
// word bit, new_name
// word bitfield_is_equal, new_name
// word log_failure, new_name
// word ccast, new_name
// word pcast, new_name
// word rcast, new_name
// word scast, new_name
// word do_once, new_name
// word do_once_start, new_name
// word do_once_end, new_name
// word num_args, new_name
// word num_args_impl, new_name
// word stringize, new_name
// word stringize_va, new_name
// word txt_StrC, new_name
// word NoCode, new_name
// word CodeInvalid, new_name
// ------------ gencpp common
@ -215,16 +268,13 @@
// word StrC, new_name
// word String, new_name
// word log_fmt, new_name
// word fatal, new_name
// word to_str, new_name
// word to_StrC, new_name
// word to_type, new_name
// word to_str, new_name
// word to_str, new_name
// word to_type, new_name
// ------------ gencpp Types & Constants
// word LogFailType, new_name
// word log_failure, new_name
// word AccessSpec, new_name
// word ECode, new_name
@ -251,7 +301,6 @@
// word Code, new_name
// word Code_POD, new_name
// word Keyword, new_name
// word NoCode, new_name
// ------------ gencpp API
@ -277,6 +326,9 @@
// word def_attributes, new_name
// word def_comment, new_name
// word def_class, new_name
// word def_constructor, new_name
// word def_destructor, new_name
// word def_define, new_name
// word def_enum, new_name
// word def_execution, new_name
// word def_extern_link, new_name
@ -286,7 +338,10 @@
// word def_module, new_name
// word def_namespace, new_name
// word def_operator, new_name
// word def_operator_cast, new_name
// word def_param, new_name
// word def_pargma, new_name
// word def_preprocess_cond, new_name
// word def_specifier, new_name
// word def_struct, new_name
// word def_template, new_name
@ -343,22 +398,24 @@
// word untyped_fmt, new_name
// word untyped_token_fmt, new_name
// ------------ File Handling
// ------------ File Ops
// word Builder, new_name
// word Editor, new_name
// word Scanner, new_name
// ------------ gencpp macros
// ------------ gencpp user macros
// word gen_main, new_name
// word GEN_TIME, new_name
// word __, new_name
// word code, new_name
// word name, new_name
// word args, new_name
// word token_fmt, new_name
// word __, new_name
// word name, new_name
// word code, new_name
// word args, new_name
// word code_str, new_name
// word code_fmt, new_name
// word token_fmt, new_name
// ------------ Type AST namespace
// namespace t_, new_namespace_

View File

@ -0,0 +1,41 @@
cls
Invoke-Expression "& $(Join-Path $PSScriptRoot 'bootstrap.ci.ps1')"
Invoke-Expression "& $(Join-Path $PSScriptRoot 'singleheader.ci.ps1')"
$path_root = git rev-parse --show-toplevel
$path_docs = Join-Path $path_root docs
$path_project = Join-Path $path_root project
$path_project_gen = Join-Path $path_project gen
$path_singleheader = Join-Path $path_root singleheader
$path_singleheader_gen = Join-Path $path_singleheader gen
$path_release = Join-Path $path_root release
$path_release_content = Join-Path $path_release content
if ( -not(Test-Path $path_release) ) {
New-Item -ItemType Directory -Path $path_release
}
if ( -not(Test-Path $path_release_content) ) {
New-Item -ItemType Directory -Path $path_release_content
}
$license = Join-Path $path_root LICENSE
$readme_root = Join-Path $path_root Readme.md
$readme_docs = Join-Path $path_docs Readme.md
$readme_parsing = Join-Path $path_docs Parsing.md
Copy-Item $license -Destination $(Join-Path $path_release_content "LICENSE")
Copy-Item $readme_root -Destination $(Join-Path $path_release_content "Readme.md")
Copy-Item $readme_docs -Destination $(Join-Path $path_release_content "Readme_Docs.md")
Copy-Item $readme_parsing -Destination $(Join-Path $path_release_content "Parsing.md")
# Singleheader
Copy-Item -Path $path_singleheader_gen\gen.hpp -Destination $path_release_content\gen.hpp
Compress-Archive -Path $path_release_content\* -DestinationPath $path_release\gencpp_singleheader.zip -Force
Remove-Item -Path $path_release_content\gen.hpp
# Segmented
Copy-Item -Path $path_project_gen\* -Destination $path_release_content
Compress-Archive -Path $path_release_content\* -DestinationPath $path_release\gencpp_segmented.zip -Force
Remove-Item -Path $path_release_content -Recurse