Skip to content

Commit

Permalink
chore: update codegen plugin interface (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy authored Jul 2, 2024
1 parent c067502 commit 92f7c73
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "ecsact_runtime", version = "0.6.6")
bazel_dep(name = "rules_ecsact", version = "0.5.2")
bazel_dep(name = "ecsact_codegen", version = "0.2.0")
bazel_dep(name = "ecsact_codegen", version = "0.3.0")

bazel_dep(name = "ecsact_cli", version = "0.3.11", dev_dependency = True)
bazel_dep(name = "ecsact_cli", version = "0.3.12", dev_dependency = True)
bazel_dep(name = "boost.dll", version = "1.83.0.bzl.2", dev_dependency = True)
bazel_dep(name = "boost.process", version = "1.83.0.bzl.2", dev_dependency = True)
bazel_dep(name = "toolchains_llvm", version = "1.0.0", dev_dependency = True)
Expand Down
7 changes: 4 additions & 3 deletions cpp_header_codegen/cpp_header_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ static auto has_assoc_fields(CompositeID compo_id) -> bool {
}

void ecsact_codegen_plugin(
ecsact_package_id package_id,
ecsact_codegen_write_fn_t write_fn
ecsact_package_id package_id,
ecsact_codegen_write_fn_t write_fn,
ecsact_codegen_report_fn_t report_fn
) {
using ecsact::cc_lang_support::cpp_identifier;
using namespace std::string_literals;
Expand All @@ -172,7 +173,7 @@ void ecsact_codegen_plugin(
using ecsact::meta::get_system_ids;
using ecsact::meta::get_transient_ids;

ecsact::codegen_plugin_context ctx{package_id, write_fn};
ecsact::codegen_plugin_context ctx{package_id, write_fn, report_fn};

ctx.write(GENERATED_FILE_DISCLAIMER);
ctx.write("#pragma once\n\n");
Expand Down
7 changes: 4 additions & 3 deletions cpp_systems_header_codegen/cpp_systems_header_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,11 @@ static auto write_sys_context(
};

void ecsact_codegen_plugin(
ecsact_package_id package_id,
ecsact_codegen_write_fn_t write_fn
ecsact_package_id package_id,
ecsact_codegen_write_fn_t write_fn,
ecsact_codegen_report_fn_t report_fn
) {
ecsact::codegen_plugin_context ctx{package_id, write_fn};
ecsact::codegen_plugin_context ctx{package_id, write_fn, report_fn};

ctx.write(GENERATED_FILE_DISCLAIMER);
ctx.write("#pragma once\n\n");
Expand Down
7 changes: 4 additions & 3 deletions cpp_systems_source_codegen/cpp_systems_source_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ constexpr auto GENERATED_FILE_DISCLAIMER = R"(// GENERATED FILE - DO NOT EDIT
)";

void ecsact_codegen_plugin(
ecsact_package_id package_id,
ecsact_codegen_write_fn_t write_fn
ecsact_package_id package_id,
ecsact_codegen_write_fn_t write_fn,
ecsact_codegen_report_fn_t report_fn
) {
using ecsact::cc_lang_support::c_identifier;
using ecsact::cc_lang_support::cpp_identifier;
using ecsact::meta::get_all_system_like_ids;
ecsact::codegen_plugin_context ctx{package_id, write_fn};
ecsact::codegen_plugin_context ctx{package_id, write_fn, report_fn};

ctx.write(GENERATED_FILE_DISCLAIMER);

Expand Down
7 changes: 4 additions & 3 deletions systems_header_codegen/systems_header_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ static void write_system_impl_fn_decl(
}

void ecsact_codegen_plugin(
ecsact_package_id package_id,
ecsact_codegen_write_fn_t write_fn
ecsact_package_id package_id,
ecsact_codegen_write_fn_t write_fn,
ecsact_codegen_report_fn_t report_fn
) {
using namespace std::string_literals;

ecsact::codegen_plugin_context ctx{package_id, write_fn};
ecsact::codegen_plugin_context ctx{package_id, write_fn, report_fn};
const auto inc_guard_str = make_package_inc_guard_str(package_id);

ctx.write(GENERATED_FILE_DISCLAIMER);
Expand Down

0 comments on commit 92f7c73

Please # to comment.