From b30f3c346626caf03098fb41e44af38cfc107562 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 16 May 2024 17:27:15 -0400 Subject: [PATCH] Restructured the codebase yet again but this time with compiler support for monlithic packages So no need to stage generate symbolic links in a flat directory for the compiler --- Readme.md | 3 +- code/host/host.odin | 2 +- code/sectr/.ODIN_MONOLITHIC_PACKAGE | 0 code/{ => sectr}/app/scratch.odin | 0 code/{ => sectr}/app/screen.odin | 0 code/{ => sectr}/app/serialize.odin | 0 code/{ => sectr}/app/state.odin | 0 code/{ => sectr}/app/ui_theme_default.odin | 0 code/{ => sectr}/chrono.odin | 0 code/{ => sectr}/collision.odin | 0 code/{ => sectr}/colors.odin | 0 code/{ => sectr}/engine/client_api.odin | 0 code/{ => sectr}/engine/logger.odin | 0 code/{ => sectr}/engine/render_gl.odin | 0 code/{ => sectr}/engine/render_raylib.odin | 0 .../engine/render_text_raylib.odin | 0 code/{ => sectr}/engine/replay.odin | 0 code/{ => sectr}/engine/startup.odin | 0 code/{ => sectr}/engine/update.odin | 0 code/{ => sectr}/font/provider.odin | 0 code/{ => sectr}/grime/arena.odin | 0 code/{ => sectr}/grime/array.odin | 0 code/{ => sectr}/grime/assert.odin | 0 code/{ => sectr}/grime/context.odin | 0 code/{ => sectr}/grime/filesystem.odin | 0 code/{ => sectr}/grime/grime.odin | 0 code/{ => sectr}/grime/hashmap_chained.odin | 0 code/{ => sectr}/grime/hashmap_zpl.odin | 0 code/{ => sectr}/grime/linked_list.odin | 0 code/{ => sectr}/grime/memory.odin | 0 code/{ => sectr}/grime/memory_tracker.odin | 0 code/{ => sectr}/grime/pool_allocator.odin | 0 code/{ => sectr}/grime/profiler.odin | 0 code/{ => sectr}/grime/ptr.odin | 0 code/{ => sectr}/grime/slab_allocator.odin | 0 code/{ => sectr}/grime/stack.odin | 0 code/{ => sectr}/grime/string_format.odin | 0 code/{ => sectr}/grime/string_interning.odin | 0 code/{ => sectr}/grime/unicode.odin | 0 code/{ => sectr}/grime/virtual_arena.odin | 0 code/{ => sectr}/grime/virtual_memory.odin | 0 code/{ => sectr}/grime/windows.odin | 0 code/{ => sectr}/input/actions.odin | 0 code/{ => sectr}/input/event.odin | 0 code/{ => sectr}/input/input.odin | 0 code/{ => sectr}/math/math.odin | 0 code/{ => sectr}/math/pga2.odin | 0 code/{ => sectr}/math/pga3.odin | 0 code/{ => sectr}/math/pga3_grime.odin | 0 code/{ => sectr}/parser/code_agnostic.odin | 0 code/{ => sectr}/parser/code_formatting.odin | 0 code/{ => sectr}/parser/odin_wysiwyg.odin | 0 code/{ => sectr}/parser/whitespace.odin | 0 .../project/manual_serialization.odin | 0 code/{ => sectr}/project/project.odin | 0 code/{ => sectr}/project/serialize.odin | 0 code/{ => sectr}/project/workspace.odin | 0 code/{ => sectr}/space.odin | 0 code/{ => sectr}/ui/canvas.odin | 0 code/{ => sectr}/ui/core.odin | 0 code/{ => sectr}/ui/core_box.odin | 0 code/{ => sectr}/ui/core_layout.odin | 0 code/{ => sectr}/ui/core_layout_compute.odin | 0 code/{ => sectr}/ui/core_signal.odin | 0 code/{ => sectr}/ui/core_style.odin | 0 code/{ => sectr}/ui/docking.odin | 0 code/{ => sectr}/ui/floating.odin | 0 code/{ => sectr}/ui/layout_widget.odin | 0 code/{ => sectr}/ui/tests.odin | 0 code/{ => sectr}/ui/theme.odin | 0 code/{ => sectr}/ui/util.odin | 0 code/{ => sectr}/ui/widgets.odin | 22 +++--- ols.json | 2 +- scripts/build.ps1 | 25 ++----- scripts/gen_staged_compiler_codebase.ps1 | 67 ------------------- 75 files changed, 24 insertions(+), 97 deletions(-) create mode 100644 code/sectr/.ODIN_MONOLITHIC_PACKAGE rename code/{ => sectr}/app/scratch.odin (100%) rename code/{ => sectr}/app/screen.odin (100%) rename code/{ => sectr}/app/serialize.odin (100%) rename code/{ => sectr}/app/state.odin (100%) rename code/{ => sectr}/app/ui_theme_default.odin (100%) rename code/{ => sectr}/chrono.odin (100%) rename code/{ => sectr}/collision.odin (100%) rename code/{ => sectr}/colors.odin (100%) rename code/{ => sectr}/engine/client_api.odin (100%) rename code/{ => sectr}/engine/logger.odin (100%) rename code/{ => sectr}/engine/render_gl.odin (100%) rename code/{ => sectr}/engine/render_raylib.odin (100%) rename code/{ => sectr}/engine/render_text_raylib.odin (100%) rename code/{ => sectr}/engine/replay.odin (100%) rename code/{ => sectr}/engine/startup.odin (100%) rename code/{ => sectr}/engine/update.odin (100%) rename code/{ => sectr}/font/provider.odin (100%) rename code/{ => sectr}/grime/arena.odin (100%) rename code/{ => sectr}/grime/array.odin (100%) rename code/{ => sectr}/grime/assert.odin (100%) rename code/{ => sectr}/grime/context.odin (100%) rename code/{ => sectr}/grime/filesystem.odin (100%) rename code/{ => sectr}/grime/grime.odin (100%) rename code/{ => sectr}/grime/hashmap_chained.odin (100%) rename code/{ => sectr}/grime/hashmap_zpl.odin (100%) rename code/{ => sectr}/grime/linked_list.odin (100%) rename code/{ => sectr}/grime/memory.odin (100%) rename code/{ => sectr}/grime/memory_tracker.odin (100%) rename code/{ => sectr}/grime/pool_allocator.odin (100%) rename code/{ => sectr}/grime/profiler.odin (100%) rename code/{ => sectr}/grime/ptr.odin (100%) rename code/{ => sectr}/grime/slab_allocator.odin (100%) rename code/{ => sectr}/grime/stack.odin (100%) rename code/{ => sectr}/grime/string_format.odin (100%) rename code/{ => sectr}/grime/string_interning.odin (100%) rename code/{ => sectr}/grime/unicode.odin (100%) rename code/{ => sectr}/grime/virtual_arena.odin (100%) rename code/{ => sectr}/grime/virtual_memory.odin (100%) rename code/{ => sectr}/grime/windows.odin (100%) rename code/{ => sectr}/input/actions.odin (100%) rename code/{ => sectr}/input/event.odin (100%) rename code/{ => sectr}/input/input.odin (100%) rename code/{ => sectr}/math/math.odin (100%) rename code/{ => sectr}/math/pga2.odin (100%) rename code/{ => sectr}/math/pga3.odin (100%) rename code/{ => sectr}/math/pga3_grime.odin (100%) rename code/{ => sectr}/parser/code_agnostic.odin (100%) rename code/{ => sectr}/parser/code_formatting.odin (100%) rename code/{ => sectr}/parser/odin_wysiwyg.odin (100%) rename code/{ => sectr}/parser/whitespace.odin (100%) rename code/{ => sectr}/project/manual_serialization.odin (100%) rename code/{ => sectr}/project/project.odin (100%) rename code/{ => sectr}/project/serialize.odin (100%) rename code/{ => sectr}/project/workspace.odin (100%) rename code/{ => sectr}/space.odin (100%) rename code/{ => sectr}/ui/canvas.odin (100%) rename code/{ => sectr}/ui/core.odin (100%) rename code/{ => sectr}/ui/core_box.odin (100%) rename code/{ => sectr}/ui/core_layout.odin (100%) rename code/{ => sectr}/ui/core_layout_compute.odin (100%) rename code/{ => sectr}/ui/core_signal.odin (100%) rename code/{ => sectr}/ui/core_style.odin (100%) rename code/{ => sectr}/ui/docking.odin (100%) rename code/{ => sectr}/ui/floating.odin (100%) rename code/{ => sectr}/ui/layout_widget.odin (100%) rename code/{ => sectr}/ui/tests.odin (100%) rename code/{ => sectr}/ui/theme.odin (100%) rename code/{ => sectr}/ui/util.odin (100%) rename code/{ => sectr}/ui/widgets.odin (98%) delete mode 100644 scripts/gen_staged_compiler_codebase.ps1 diff --git a/Readme.md b/Readme.md index 23d72f4..6a68ebe 100644 --- a/Readme.md +++ b/Readme.md @@ -17,8 +17,9 @@ The host module loads the main module & its memory. Hot-reloading it's dll when The dependencies are: -* Odin Compiler (Slightly custom) +* Odin Compiler (Slightly custom [fork](https://github.com/Ed94/Odin)) * Added #region, #endregion directives support for editors + * I added support for 'monlithic packages' or 'uniform-across-subdirectories packages'. It allows me to organize the main package with sub-directoreis. * Odin repo's base, core, and vendor(raylib) libaries * An ini parser * backtrace diff --git a/code/host/host.odin b/code/host/host.odin index 06d11d4..f7df555 100644 --- a/code/host/host.odin +++ b/code/host/host.odin @@ -62,7 +62,7 @@ import "core:time" thread_sleep :: time.sleep import "core:prof/spall" import rl "vendor:raylib" -import sectr "../." +import sectr "../sectr" VArena :: sectr.VArena varena_init :: sectr.varena_init fatal :: sectr.fatal diff --git a/code/sectr/.ODIN_MONOLITHIC_PACKAGE b/code/sectr/.ODIN_MONOLITHIC_PACKAGE new file mode 100644 index 0000000..e69de29 diff --git a/code/app/scratch.odin b/code/sectr/app/scratch.odin similarity index 100% rename from code/app/scratch.odin rename to code/sectr/app/scratch.odin diff --git a/code/app/screen.odin b/code/sectr/app/screen.odin similarity index 100% rename from code/app/screen.odin rename to code/sectr/app/screen.odin diff --git a/code/app/serialize.odin b/code/sectr/app/serialize.odin similarity index 100% rename from code/app/serialize.odin rename to code/sectr/app/serialize.odin diff --git a/code/app/state.odin b/code/sectr/app/state.odin similarity index 100% rename from code/app/state.odin rename to code/sectr/app/state.odin diff --git a/code/app/ui_theme_default.odin b/code/sectr/app/ui_theme_default.odin similarity index 100% rename from code/app/ui_theme_default.odin rename to code/sectr/app/ui_theme_default.odin diff --git a/code/chrono.odin b/code/sectr/chrono.odin similarity index 100% rename from code/chrono.odin rename to code/sectr/chrono.odin diff --git a/code/collision.odin b/code/sectr/collision.odin similarity index 100% rename from code/collision.odin rename to code/sectr/collision.odin diff --git a/code/colors.odin b/code/sectr/colors.odin similarity index 100% rename from code/colors.odin rename to code/sectr/colors.odin diff --git a/code/engine/client_api.odin b/code/sectr/engine/client_api.odin similarity index 100% rename from code/engine/client_api.odin rename to code/sectr/engine/client_api.odin diff --git a/code/engine/logger.odin b/code/sectr/engine/logger.odin similarity index 100% rename from code/engine/logger.odin rename to code/sectr/engine/logger.odin diff --git a/code/engine/render_gl.odin b/code/sectr/engine/render_gl.odin similarity index 100% rename from code/engine/render_gl.odin rename to code/sectr/engine/render_gl.odin diff --git a/code/engine/render_raylib.odin b/code/sectr/engine/render_raylib.odin similarity index 100% rename from code/engine/render_raylib.odin rename to code/sectr/engine/render_raylib.odin diff --git a/code/engine/render_text_raylib.odin b/code/sectr/engine/render_text_raylib.odin similarity index 100% rename from code/engine/render_text_raylib.odin rename to code/sectr/engine/render_text_raylib.odin diff --git a/code/engine/replay.odin b/code/sectr/engine/replay.odin similarity index 100% rename from code/engine/replay.odin rename to code/sectr/engine/replay.odin diff --git a/code/engine/startup.odin b/code/sectr/engine/startup.odin similarity index 100% rename from code/engine/startup.odin rename to code/sectr/engine/startup.odin diff --git a/code/engine/update.odin b/code/sectr/engine/update.odin similarity index 100% rename from code/engine/update.odin rename to code/sectr/engine/update.odin diff --git a/code/font/provider.odin b/code/sectr/font/provider.odin similarity index 100% rename from code/font/provider.odin rename to code/sectr/font/provider.odin diff --git a/code/grime/arena.odin b/code/sectr/grime/arena.odin similarity index 100% rename from code/grime/arena.odin rename to code/sectr/grime/arena.odin diff --git a/code/grime/array.odin b/code/sectr/grime/array.odin similarity index 100% rename from code/grime/array.odin rename to code/sectr/grime/array.odin diff --git a/code/grime/assert.odin b/code/sectr/grime/assert.odin similarity index 100% rename from code/grime/assert.odin rename to code/sectr/grime/assert.odin diff --git a/code/grime/context.odin b/code/sectr/grime/context.odin similarity index 100% rename from code/grime/context.odin rename to code/sectr/grime/context.odin diff --git a/code/grime/filesystem.odin b/code/sectr/grime/filesystem.odin similarity index 100% rename from code/grime/filesystem.odin rename to code/sectr/grime/filesystem.odin diff --git a/code/grime/grime.odin b/code/sectr/grime/grime.odin similarity index 100% rename from code/grime/grime.odin rename to code/sectr/grime/grime.odin diff --git a/code/grime/hashmap_chained.odin b/code/sectr/grime/hashmap_chained.odin similarity index 100% rename from code/grime/hashmap_chained.odin rename to code/sectr/grime/hashmap_chained.odin diff --git a/code/grime/hashmap_zpl.odin b/code/sectr/grime/hashmap_zpl.odin similarity index 100% rename from code/grime/hashmap_zpl.odin rename to code/sectr/grime/hashmap_zpl.odin diff --git a/code/grime/linked_list.odin b/code/sectr/grime/linked_list.odin similarity index 100% rename from code/grime/linked_list.odin rename to code/sectr/grime/linked_list.odin diff --git a/code/grime/memory.odin b/code/sectr/grime/memory.odin similarity index 100% rename from code/grime/memory.odin rename to code/sectr/grime/memory.odin diff --git a/code/grime/memory_tracker.odin b/code/sectr/grime/memory_tracker.odin similarity index 100% rename from code/grime/memory_tracker.odin rename to code/sectr/grime/memory_tracker.odin diff --git a/code/grime/pool_allocator.odin b/code/sectr/grime/pool_allocator.odin similarity index 100% rename from code/grime/pool_allocator.odin rename to code/sectr/grime/pool_allocator.odin diff --git a/code/grime/profiler.odin b/code/sectr/grime/profiler.odin similarity index 100% rename from code/grime/profiler.odin rename to code/sectr/grime/profiler.odin diff --git a/code/grime/ptr.odin b/code/sectr/grime/ptr.odin similarity index 100% rename from code/grime/ptr.odin rename to code/sectr/grime/ptr.odin diff --git a/code/grime/slab_allocator.odin b/code/sectr/grime/slab_allocator.odin similarity index 100% rename from code/grime/slab_allocator.odin rename to code/sectr/grime/slab_allocator.odin diff --git a/code/grime/stack.odin b/code/sectr/grime/stack.odin similarity index 100% rename from code/grime/stack.odin rename to code/sectr/grime/stack.odin diff --git a/code/grime/string_format.odin b/code/sectr/grime/string_format.odin similarity index 100% rename from code/grime/string_format.odin rename to code/sectr/grime/string_format.odin diff --git a/code/grime/string_interning.odin b/code/sectr/grime/string_interning.odin similarity index 100% rename from code/grime/string_interning.odin rename to code/sectr/grime/string_interning.odin diff --git a/code/grime/unicode.odin b/code/sectr/grime/unicode.odin similarity index 100% rename from code/grime/unicode.odin rename to code/sectr/grime/unicode.odin diff --git a/code/grime/virtual_arena.odin b/code/sectr/grime/virtual_arena.odin similarity index 100% rename from code/grime/virtual_arena.odin rename to code/sectr/grime/virtual_arena.odin diff --git a/code/grime/virtual_memory.odin b/code/sectr/grime/virtual_memory.odin similarity index 100% rename from code/grime/virtual_memory.odin rename to code/sectr/grime/virtual_memory.odin diff --git a/code/grime/windows.odin b/code/sectr/grime/windows.odin similarity index 100% rename from code/grime/windows.odin rename to code/sectr/grime/windows.odin diff --git a/code/input/actions.odin b/code/sectr/input/actions.odin similarity index 100% rename from code/input/actions.odin rename to code/sectr/input/actions.odin diff --git a/code/input/event.odin b/code/sectr/input/event.odin similarity index 100% rename from code/input/event.odin rename to code/sectr/input/event.odin diff --git a/code/input/input.odin b/code/sectr/input/input.odin similarity index 100% rename from code/input/input.odin rename to code/sectr/input/input.odin diff --git a/code/math/math.odin b/code/sectr/math/math.odin similarity index 100% rename from code/math/math.odin rename to code/sectr/math/math.odin diff --git a/code/math/pga2.odin b/code/sectr/math/pga2.odin similarity index 100% rename from code/math/pga2.odin rename to code/sectr/math/pga2.odin diff --git a/code/math/pga3.odin b/code/sectr/math/pga3.odin similarity index 100% rename from code/math/pga3.odin rename to code/sectr/math/pga3.odin diff --git a/code/math/pga3_grime.odin b/code/sectr/math/pga3_grime.odin similarity index 100% rename from code/math/pga3_grime.odin rename to code/sectr/math/pga3_grime.odin diff --git a/code/parser/code_agnostic.odin b/code/sectr/parser/code_agnostic.odin similarity index 100% rename from code/parser/code_agnostic.odin rename to code/sectr/parser/code_agnostic.odin diff --git a/code/parser/code_formatting.odin b/code/sectr/parser/code_formatting.odin similarity index 100% rename from code/parser/code_formatting.odin rename to code/sectr/parser/code_formatting.odin diff --git a/code/parser/odin_wysiwyg.odin b/code/sectr/parser/odin_wysiwyg.odin similarity index 100% rename from code/parser/odin_wysiwyg.odin rename to code/sectr/parser/odin_wysiwyg.odin diff --git a/code/parser/whitespace.odin b/code/sectr/parser/whitespace.odin similarity index 100% rename from code/parser/whitespace.odin rename to code/sectr/parser/whitespace.odin diff --git a/code/project/manual_serialization.odin b/code/sectr/project/manual_serialization.odin similarity index 100% rename from code/project/manual_serialization.odin rename to code/sectr/project/manual_serialization.odin diff --git a/code/project/project.odin b/code/sectr/project/project.odin similarity index 100% rename from code/project/project.odin rename to code/sectr/project/project.odin diff --git a/code/project/serialize.odin b/code/sectr/project/serialize.odin similarity index 100% rename from code/project/serialize.odin rename to code/sectr/project/serialize.odin diff --git a/code/project/workspace.odin b/code/sectr/project/workspace.odin similarity index 100% rename from code/project/workspace.odin rename to code/sectr/project/workspace.odin diff --git a/code/space.odin b/code/sectr/space.odin similarity index 100% rename from code/space.odin rename to code/sectr/space.odin diff --git a/code/ui/canvas.odin b/code/sectr/ui/canvas.odin similarity index 100% rename from code/ui/canvas.odin rename to code/sectr/ui/canvas.odin diff --git a/code/ui/core.odin b/code/sectr/ui/core.odin similarity index 100% rename from code/ui/core.odin rename to code/sectr/ui/core.odin diff --git a/code/ui/core_box.odin b/code/sectr/ui/core_box.odin similarity index 100% rename from code/ui/core_box.odin rename to code/sectr/ui/core_box.odin diff --git a/code/ui/core_layout.odin b/code/sectr/ui/core_layout.odin similarity index 100% rename from code/ui/core_layout.odin rename to code/sectr/ui/core_layout.odin diff --git a/code/ui/core_layout_compute.odin b/code/sectr/ui/core_layout_compute.odin similarity index 100% rename from code/ui/core_layout_compute.odin rename to code/sectr/ui/core_layout_compute.odin diff --git a/code/ui/core_signal.odin b/code/sectr/ui/core_signal.odin similarity index 100% rename from code/ui/core_signal.odin rename to code/sectr/ui/core_signal.odin diff --git a/code/ui/core_style.odin b/code/sectr/ui/core_style.odin similarity index 100% rename from code/ui/core_style.odin rename to code/sectr/ui/core_style.odin diff --git a/code/ui/docking.odin b/code/sectr/ui/docking.odin similarity index 100% rename from code/ui/docking.odin rename to code/sectr/ui/docking.odin diff --git a/code/ui/floating.odin b/code/sectr/ui/floating.odin similarity index 100% rename from code/ui/floating.odin rename to code/sectr/ui/floating.odin diff --git a/code/ui/layout_widget.odin b/code/sectr/ui/layout_widget.odin similarity index 100% rename from code/ui/layout_widget.odin rename to code/sectr/ui/layout_widget.odin diff --git a/code/ui/tests.odin b/code/sectr/ui/tests.odin similarity index 100% rename from code/ui/tests.odin rename to code/sectr/ui/tests.odin diff --git a/code/ui/theme.odin b/code/sectr/ui/theme.odin similarity index 100% rename from code/ui/theme.odin rename to code/sectr/ui/theme.odin diff --git a/code/ui/util.odin b/code/sectr/ui/util.odin similarity index 100% rename from code/ui/util.odin rename to code/sectr/ui/util.odin diff --git a/code/ui/widgets.odin b/code/sectr/ui/widgets.odin similarity index 98% rename from code/ui/widgets.odin rename to code/sectr/ui/widgets.odin index c4057ba..e093a25 100644 --- a/code/ui/widgets.odin +++ b/code/sectr/ui/widgets.odin @@ -425,15 +425,16 @@ ui_spacer :: proc( label : string ) -> (widget : UI_Widget) { return } -// UI_ScrollBox { -// using widget : UI_Widget, -// scroll_bar : UI_Widget, -// content : UI_Widget, -// } +UI_ScrollBox :: struct { + using widget : UI_Widget, + scroll_bar : UI_Widget, + content : UI_Widget, +} -// ui_scroll_box :: proc( label : string ) -> (scroll_box : UI_ScrollBox) { - -// } +ui_scroll_box :: proc( label : string, flags : UI_BoxFlags ) -> (scroll_box : UI_ScrollBox) { + fatal("NOT IMPLEMENTED") + return +} // ui_scrollable_view( ) @@ -481,7 +482,10 @@ ui_text_tabs :: proc( label : string, flags : UI_BoxFlags = {} ) -> UI_Widget return { box, signal } } -ui_text_wrap_panel :: proc( label : string, flags : UI_BoxFlags = {} ) +ui_text_wrap_panel :: proc( parent : ^UI_Widget ) +{ + fatal("NOT IMPLEMENTED") +} #endregion("Text") #region("Vertical Box") diff --git a/ols.json b/ols.json index 8aa3433..ffc32e4 100644 --- a/ols.json +++ b/ols.json @@ -11,7 +11,7 @@ "enable_fake_methods": true, "enable_format": false, "enable_hover": true, - "enable_semantic_tokens": false, + "enable_semantic_tokens": true, "enable_snippets": false, "enable_references": true, "thread_pool_count": 10, diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 63f5c9c..bd2d29d 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -117,18 +117,13 @@ push-location $path_root function build-prototype { - $gen_staged_compiler_codebase = join-path $PSScriptRoot 'gen_staged_compiler_codebase.ps1' - $path_code_compiler_staged = join-path $path_root 'code_compiler_staged' - - . $gen_staged_compiler_codebase - - push-location $path_code_compiler_staged + push-location $path_code $project_name = 'sectr' write-host "`nBuilding Sectr Prototype`n" - $module_host = join-path $path_code_compiler_staged 'host' - $module_sectr = $path_code_compiler_staged + $module_host = join-path $path_code 'host' + $module_sectr = join-path $path_code 'sectr' $pkg_collection_thirdparty = 'thirdparty=' + $path_thirdparty @@ -152,8 +147,8 @@ push-location $path_root } write-host 'Building Sectr Module' - $module_dll = join-path $path_build ( $project_name + '.dll' ) - $pdb = join-path $path_build ( $project_name + '.pdb' ) + $script:module_dll = join-path $path_build ( $project_name + '.dll' ) + $pdb = join-path $path_build ( $project_name + '.pdb' ) if (test-path $pdb) { remove-item $pdb @@ -167,7 +162,7 @@ push-location $path_root $build_args = @() $build_args += $command_build - $build_args += '.' + $build_args += './sectr' $build_args += $flag_build_mode_dll $build_args += $flag_output_path + $module_dll $build_args += ($flag_collection + $pkg_collection_thirdparty) @@ -290,15 +285,9 @@ push-location $path_root } return $built } - $host_build_code = build-sectr + $host_build_code = build-host Pop-Location # path_code - - if ( test-path $path_code_compiler_staged ) { - if ( ($host_build_code -ne $module_build_failed) -and ($script:sectr_build_code -ne $module_build_failed) ) { - Remove-Item -Path $path_code_compiler_staged -Force -Recurse - } - } } build-prototype pop-location # path_root diff --git a/scripts/gen_staged_compiler_codebase.ps1 b/scripts/gen_staged_compiler_codebase.ps1 deleted file mode 100644 index c33122e..0000000 --- a/scripts/gen_staged_compiler_codebase.ps1 +++ /dev/null @@ -1,67 +0,0 @@ -cls -Write-Host "Reverse Build.ps1" - -$path_root = git rev-parse --show-toplevel -$path_code = Join-Path $path_root 'code' -$path_code_compiler_staged = Join-Path $path_root 'code_compiler_staged' - -if (Test-Path $path_code_compiler_staged) { - Remove-Item -Path $path_code_compiler_staged -Recurse -Force -ErrorAction Ignore -} -New-Item -ItemType Directory -Path $path_code_compiler_staged - -$whitelist_package = 'sectr' - -$files = Get-ChildItem -Path $path_code -File -Recurse -foreach ($file in $files) -{ - # Read the file line by line to determine the package name, ignoring comments - $packageName = $null - Get-Content -Path $file.FullName | ForEach-Object { - if ($_ -notmatch '^\s*//') - { - if ($_ -match '^package\s+(\w+)$') { - $packageName = $Matches[1] - return $false - } - } - } - - if ($packageName) - { - # Calculate relative path and prepend directory names to the file name - $relativePath = $file.FullName.Substring($path_code.Length + 1) - $relativeDir = Split-Path $relativePath -Parent - $relativeDir = $relativeDir.Replace('\', '_').Replace('/', '_') - - if ($relativeDir -ne '') { - $targetFileName = "$relativeDir" + "_" + $file.Name - } else { - $targetFileName = $file.Name - } - - # Determine target directory based on the package name - if ($packageName -eq $whitelist_package) { - $targetDir = $path_code_compiler_staged - } else { - $targetDir = Join-Path $path_code_compiler_staged $packageName - if (-not (Test-Path $targetDir)) { - New-Item -ItemType Directory -Path $targetDir - } - } - - $targetFilePath = Join-Path $targetDir $targetFileName - - # Check if the target file path already exists and handle it accordingly - if (-not (Test-Path $targetFilePath)) { - New-Item -ItemType SymbolicLink -Path $targetFilePath -Value $file.FullName - } else { - Write-Host "Warning: The link for $($file.FullName) already exists at $targetFilePath. Skipping..." - } - } - else { - Write-Host "Warning: The file $($file.FullName) does not contain a valid package declaration." - } -} - -Write-Host "Compiler staged directory structure created successfully."