Skip to content

Commit e2ce8de

Browse files
authored
chore: using ecsact_codegen and ecsact_cli (#132)
1 parent 6b8c126 commit e2ce8de

File tree

11 files changed

+85
-29
lines changed

11 files changed

+85
-29
lines changed

WORKSPACE.bazel

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

55
http_archive(
66
name = "ecsact_runtime",
7-
sha256 = "",
8-
strip_prefix = "ecsact_runtime-c6cdc81000bbee028a8e7a2bc95fc35711db1b75",
9-
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/c6cdc81000bbee028a8e7a2bc95fc35711db1b75.zip",
7+
sha256 = "dfc71e519d24b943c855d288d19f539fc9b9c65636c0376c7febb865233161b6",
8+
strip_prefix = "ecsact_runtime-0.2.0",
9+
urls = ["https://github.com/ecsact-dev/ecsact_runtime/archive/refs/tags/0.2.0.tar.gz"],
1010
)
1111

1212
http_archive(
13-
name = "ecsact_parse",
14-
sha256 = "f4a5e2f9bc163fecd125c4c8dd87977150999024ee5c6fdc75912424b3aa5501",
15-
strip_prefix = "ecsact_parse-4e019a5697aa3992c3e9adcea5768f6df21d98a5",
16-
url = "https://github.com/ecsact-dev/ecsact_parse/archive/4e019a5697aa3992c3e9adcea5768f6df21d98a5.zip",
13+
name = "ecsact_codegen",
14+
sha256 = "5a1a466dbddbe042c2e5910f3b65ca44a5ffcef5831fdd0c3b2e2863c13cfb31",
15+
strip_prefix = "ecsact_codegen-0.0.2",
16+
urls = ["https://github.com/ecsact-dev/ecsact_codegen/archive/refs/tags/0.0.2.tar.gz"],
1717
)
1818

1919
http_archive(

cpp_header_codegen/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//bazel:copts.bzl", "copts")
2-
load("@ecsact_runtime//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
2+
load("@ecsact_codegen//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
33

44
package(default_visibility = ["//visibility:public"])
55

cpp_meta_header_codegen/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//bazel:copts.bzl", "copts")
2-
load("@ecsact_runtime//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
2+
load("@ecsact_codegen//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
33

44
package(default_visibility = ["//visibility:public"])
55

cpp_systems_header_codegen/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//bazel:copts.bzl", "copts")
2-
load("@ecsact_runtime//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
2+
load("@ecsact_codegen//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
33

44
package(default_visibility = ["//visibility:public"])
55

cpp_systems_source_codegen/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//bazel:copts.bzl", "copts")
2-
load("@ecsact_runtime//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
2+
load("@ecsact_codegen//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
33

44
package(default_visibility = ["//visibility:public"])
55

ecsact/cpp/type_info.hh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ struct is_action : std::bool_constant<false> {};
2727
template<typename ActionT>
2828
using is_action_v = typename is_action<ActionT>::value;
2929

30+
template<typename SystemT>
31+
struct system_lazy_execution_iteration_rate;
32+
33+
template<typename SystemT>
34+
using system_lazy_execution_iteration_rate_v =
35+
typename system_lazy_execution_iteration_rate<SystemT>::value;
36+
3037
template<typename SystemLikeT>
3138
struct system_capabilities_info {
3239
using readonly_components = mp_list<>;

systems_header_codegen/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("//bazel:copts.bzl", "copts")
2-
load("@ecsact_runtime//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
2+
load("@ecsact_codegen//:codegen_plugin.bzl", "cc_ecsact_codegen_plugin")
33

44
package(default_visibility = ["//visibility:public"])
55

test/.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
common --enable_bzlmod
12
build --enable_platform_specific_config
23
build --incompatible_use_platforms_repo_for_constraints
34
build --incompatible_enable_cc_toolchain_resolution

test/BUILD.bazel

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@rules_cc//cc:defs.bzl", "cc_binary")
2+
load("@rules_ecsact//ecsact:toolchain.bzl", "ecsact_toolchain")
23
load("@rules_ecsact//ecsact:defs.bzl", "ecsact_codegen")
34

45
platform(
@@ -14,6 +15,36 @@ copts = select({
1415
"//conditions:default": ["-std=c++20"],
1516
})
1617

18+
ecsact_toolchain(
19+
name = "ecsact_cli_windows",
20+
target_tool = "@ecsact_cli_windows//file",
21+
)
22+
23+
ecsact_toolchain(
24+
name = "ecsact_cli_linux",
25+
target_tool = "@ecsact_cli_linux//file",
26+
)
27+
28+
toolchain(
29+
name = "ecsact_windows_toolchain",
30+
exec_compatible_with = [
31+
"@platforms//os:windows",
32+
"@platforms//cpu:x86_64",
33+
],
34+
toolchain = ":ecsact_cli_windows",
35+
toolchain_type = "@rules_ecsact//ecsact:toolchain_type",
36+
)
37+
38+
toolchain(
39+
name = "ecsact_linux_toolchain",
40+
exec_compatible_with = [
41+
"@platforms//os:linux",
42+
"@platforms//cpu:x86_64",
43+
],
44+
toolchain = ":ecsact_cli_linux",
45+
toolchain_type = "@rules_ecsact//ecsact:toolchain_type",
46+
)
47+
1748
ecsact_srcs = [
1849
"example.ecsact",
1950
"example_a.ecsact",

test/MODULE.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module(name = "ecsact_lang_cpp_tests")
2+
3+
bazel_dep(name = "nlohmann_json", version = "3.11.2")
4+
bazel_dep(name = "rules_cc", version = "0.0.6")
5+
bazel_dep(name = "platforms", version = "0.0.6")
6+
bazel_dep(name = "rules_pkg", version = "0.9.0")
7+
bazel_dep(name = "bazel_skylib", version = "1.4.1")

test/WORKSPACE.bazel

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,48 @@
11
workspace(name = "ecsact_lang_cpp_example")
22

3-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
3+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
4+
5+
local_repository(
6+
name = "ecsact_lang_cpp",
7+
path = "..",
8+
)
49

510
http_archive(
611
name = "ecsact_runtime",
7-
sha256 = "ba5b8f1649fc86b9c803ab852d0612e2d100a64e2a06a13b612e111bf8d18735",
8-
strip_prefix = "ecsact_runtime-c6cdc81000bbee028a8e7a2bc95fc35711db1b75",
9-
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/c6cdc81000bbee028a8e7a2bc95fc35711db1b75.zip",
12+
sha256 = "dfc71e519d24b943c855d288d19f539fc9b9c65636c0376c7febb865233161b6",
13+
strip_prefix = "ecsact_runtime-0.2.0",
14+
urls = ["https://github.com/ecsact-dev/ecsact_runtime/archive/refs/tags/0.2.0.tar.gz"],
1015
)
1116

12-
http_archive(
13-
name = "ecsact_parse",
14-
sha256 = "f4a5e2f9bc163fecd125c4c8dd87977150999024ee5c6fdc75912424b3aa5501",
15-
strip_prefix = "ecsact_parse-4e019a5697aa3992c3e9adcea5768f6df21d98a5",
16-
url = "https://github.com/ecsact-dev/ecsact_parse/archive/4e019a5697aa3992c3e9adcea5768f6df21d98a5.zip",
17+
http_file(
18+
name = "ecsact_cli_windows",
19+
url = "https://github.com/ecsact-dev/ecsact_cli/releases/download/0.1.0/ecsact_0.1.0_windows_x64.exe",
20+
executable = True,
21+
downloaded_file_path = "ecsact.exe",
1722
)
1823

19-
local_repository(
20-
name = "ecsact_lang_cpp",
21-
path = "..",
24+
http_file(
25+
name = "ecsact_cli_linux",
26+
url = "https://github.com/ecsact-dev/ecsact_cli/releases/download/0.1.0/ecsact_0.1.0_linux_x64",
27+
executable = True,
28+
downloaded_file_path = "ecsact",
2229
)
2330

2431
http_archive(
2532
name = "rules_ecsact",
26-
sha256 = "8eaaf1f05eccbfcf4a0123c951436519672190a7a908fa847c24adf0778041f6",
27-
strip_prefix = "rules_ecsact-0.2.2",
28-
url = "https://github.com/ecsact-dev/rules_ecsact/archive/refs/tags/0.2.2.tar.gz",
33+
sha256 = "3db6d498a681e036dabdcc1bb7e5ee254acadae4ab2ecf19d253f824db88d5e4",
34+
strip_prefix = "rules_ecsact-0.3.0",
35+
urls = ["https://github.com/ecsact-dev/rules_ecsact/archive/refs/tags/0.3.0.tar.gz"],
2936
)
3037

31-
load("@rules_ecsact//ecsact:repositories.bzl", "ecsact_register_toolchains", "rules_ecsact_dependencies")
38+
load("@rules_ecsact//ecsact:repositories.bzl", "rules_ecsact_dependencies")
3239

3340
rules_ecsact_dependencies()
3441

35-
ecsact_register_toolchains()
42+
register_toolchains(
43+
"//:ecsact_windows_toolchain",
44+
"//:ecsact_linux_toolchain",
45+
)
3646

3747
http_archive(
3848
name = "hedron_compile_commands",

0 commit comments

Comments
 (0)