Skip to content

Commit

Permalink
feat: moved from ecsact-dev/ecsact_sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed May 1, 2023
0 parents commit c821755
Show file tree
Hide file tree
Showing 28 changed files with 1,765 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
external
dist
21 changes: 21 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
common --enable_bzlmod
build --enable_platform_specific_config
build --incompatible_use_platforms_repo_for_constraints
build --incompatible_enable_cc_toolchain_resolution
build --incompatible_strict_action_env
build --enable_runfiles

build:windows --platforms=//bazel/platforms:windows
build:windows --host_platform=//bazel/platforms:windows
build:windows --workspace_status_command=bazel/tools/wsc.cmd

build:linux --platforms=//bazel/platforms:linux
build:linux --host_platform=//bazel/platforms:linux
build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
build:linux --workspace_status_command=bazel/tools/wsc.sh

common:ci --announce_rc
common:ci --disk_cache=~/.cache/bazel-disk-cache
build:ci -c opt

try-import %workspace%/user.bazelrc
99 changes: 99 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: DontAlign
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakAfterJavaFieldAnnotations: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true
ColumnLimit: 80
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IncludeBlocks: Preserve
IncludeIsMainRegex: "(Test)?$"
IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertBraces: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PackConstructorInitializers: NextLine
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakString: 10
PenaltyExcessCharacter: 400
PenaltyReturnTypeOnItsOwnLine: 350
PointerAlignment: Left
ReflowComments: true
RequiresClausePosition: OwnLine
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SeparateDefinitionBlocks: Always
Standard: Latest
TabWidth: 2
UseTab: ForContinuationAndIndentation
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# bazel
/bazel-*
/user.bazelrc

# https://github.com/hedronvision/bazel-compile-commands-extractor
/compile_commands.json
/external

# clangd
/.cache/

# ecsact codegen
*.ecsact.*

31 changes: 31 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")
load("@rules_cc_stamp//:index.bzl", "cc_stamp_header")
load("//bazel:copts.bzl", "copts")

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

cc_stamp_header(
name = "bazel_stamp_header",
out = "bazel_stamp_header.hh",
)

cc_binary(
name = "ecsact",
srcs = [
"ecsact_cli.cc",
"bazel_stamp_header.hh",
],
copts = copts,
stamp = 1,
deps = [
"//commands:benchmark",
"//commands:codegen",
"//commands:command",
"//commands:config",
],
)

alias(
name = "ecsact_cli",
actual = ":ecsact",
)
7 changes: 7 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module(name = "ecsact_cli")

bazel_dep(name = "nlohmann_json", version = "3.11.2")
bazel_dep(name = "rules_cc", version = "0.0.6")
bazel_dep(name = "platforms", version = "0.0.6")
bazel_dep(name = "rules_pkg", version = "0.9.0")
bazel_dep(name = "bazel_skylib", version = "1.4.1")
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<p align="center">
<img src="https://ecsact.dev/external/ecsact_logo/ecsact-color.png" width="300" />
</p>

# Ecsact CLI

The Ecsact CLI is _the_ utility for the following:

* Code generation frontend
* Benchmark utility
* Config details about Ecsact SDK installation and builtins

## Install

Ecsact CLI ships with the Ecsact SDK. [ecsact.dev/start](https://ecsact.dev/start)

95 changes: 95 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
workspace(name = "ecsact_cli")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")

http_archive(
name = "bazelregistry_docopt_cpp",
sha256 = "a06e705978b1c09427f130a187cb361916c1e7d66b69e91b865ebcd5390a6774",
strip_prefix = "docopt.cpp-1e38ceb67655f576814ae1c95f138eb8b61453c9",
url = "https://github.com/bazelregistry/docopt.cpp/archive/1e38ceb67655f576814ae1c95f138eb8b61453c9.zip",
)

http_archive(
name = "boost",
sha256 = "4a79c389add7e3d54d0e12c83098d471d24536ba2d6b8593d3a95f151f25eebb",
strip_prefix = "boost-da62319c330d81ef032517cbe13b6f35d97387cb",
urls = ["https://github.com/bazelboost/boost/archive/da62319c330d81ef032517cbe13b6f35d97387cb.zip"],
)

load("@boost//:index.bzl", "boost_http_archives")

boost_http_archives()

http_archive(
name = "rules_cc_stamp",
strip_prefix = "rules_cc_stamp-63d4861f4d420b574fa0f112599aae2b8aee785e",
urls = ["https://github.com/zaucy/rules_cc_stamp/archive/63d4861f4d420b574fa0f112599aae2b8aee785e.zip"],
sha256 = "f469a3b97eeabeb850c655f59ea17799ff40badd3a0b3e9de38534c89ad2f87d",
)

http_archive(
name = "ecsact_si_wasm",
sha256 = "e208a94d4f4a9c09f32b8a9ea91a4f799492e11c7c852b0329b4a3595a45cee6",
strip_prefix = "ecsact_si_wasm-0.1.0",
urls = ["https://github.com/seaube/ecsact_si_wasm/archive/refs/tags/0.1.0.tar.gz"],
)

http_archive(
name = "ecsact_parse",
sha256 = "3f83ae8af26b08472fceef768d2c719a7ea9bedfc907303b9d80d9a7c9b937e9",
strip_prefix = "ecsact_parse-0.2.0",
urls = ["https://github.com/ecsact-dev/ecsact_parse/archive/refs/tags/0.2.0.tar.gz"],
)

http_archive(
name = "ecsact_runtime",
sha256 = "dfc71e519d24b943c855d288d19f539fc9b9c65636c0376c7febb865233161b6",
strip_prefix = "ecsact_runtime-0.2.0",
urls = ["https://github.com/ecsact-dev/ecsact_runtime/archive/refs/tags/0.2.0.tar.gz"],
)

http_archive(
name = "ecsact_interpret",
sha256 = "daee9a1924ae169ef64456487c24e72ab3e6a8ab04c8534bd06cd1ef00f58131",
strip_prefix = "ecsact_interpret-0.2.0",
urls = ["https://github.com/ecsact-dev/ecsact_interpret/archive/refs/tags/0.2.0.tar.gz"],
)

load("@ecsact_parse//:repositories.bzl", "ecsact_parse_dependencies")

ecsact_parse_dependencies()

http_archive(
name = "hedron_compile_commands",
sha256 = "99bc3106eb6ce5ffab3c31de8501d4d628de5f1acd74b8b563a876bd39a2e32f",
strip_prefix = "bazel-compile-commands-extractor-b33a4b05c2287372c8e932c55ff4d3a37e6761ed",
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/b33a4b05c2287372c8e932c55ff4d3a37e6761ed.tar.gz",
)

load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")

hedron_compile_commands_setup()

http_archive(
name = "com_grail_bazel_toolchain",
sha256 = "ba89390c2fff1a498456de977dab5c6833b4dcb364b88c405dc375b99e1f5c46",
strip_prefix = "bazel-toolchain-d52ce5d96915428a5ee6f7079078df706c5fddab",
url = "https://github.com/grailbio/bazel-toolchain/archive/d52ce5d96915428a5ee6f7079078df706c5fddab.zip",
)

load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")

bazel_toolchain_dependencies()

load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")

llvm_toolchain(
name = "llvm_toolchain",
cxx_standard = {"linux": "c++20"},
distribution = "clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
llvm_version = "15.0.6",
)

load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")

llvm_register_toolchains()
Empty file added bazel/BUILD.bazel
Empty file.
4 changes: 4 additions & 0 deletions bazel/copts.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
copts = select({
"@bazel_tools//tools/cpp:msvc": ["/std:c++20", "/Zc:preprocessor", "/permissive-"],
"//conditions:default": ["-std=c++20", "-Werror", "-fexperimental-library"],
})
19 changes: 19 additions & 0 deletions bazel/platforms/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package(default_visibility = ["//:__subpackages__"])

platform(
name = "windows",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:msvc",
],
)

platform(
name = "linux",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"@bazel_tools//tools/cpp:clang",
],
)
6 changes: 6 additions & 0 deletions bazel/tools/wsc.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off

@rem This is a mock value for the ecsact_cli repository. This gets set inside
@rem the ecsact_sdk repository.
echo STABLE_ECSACT_SDK_VERSION none

8 changes: 8 additions & 0 deletions bazel/tools/wsc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

# This is a mock value for the ecsact_cli repository. This gets set inside the
# ecsact_sdk repository.
echo "STABLE_ECSACT_SDK_VERSION none"

5 changes: 5 additions & 0 deletions cog.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
post_bump_hooks = [
"git push",
"git push origin {{version}}",
"gh release create {{version}} --generate-notes --latest -t {{version}} --verify-tag",
]
Loading

0 comments on commit c821755

Please sign in to comment.