File tree Expand file tree Collapse file tree 7 files changed +56
-5
lines changed
Expand file tree Collapse file tree 7 files changed +56
-5
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,12 @@ build --enable_runfiles
66
77build:windows --platforms=//bazel/platforms:windows
88build:windows --host_platform=//bazel/platforms:windows
9+ build:windows --workspace_status_command=bazel/tools/wsc.cmd
910
1011build:linux --platforms=//bazel/platforms:linux
1112build:linux --host_platform=//bazel/platforms:linux
1213build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
14+ build:linux --workspace_status_command=bazel/tools/wsc.sh
1315
1416common:ci --announce_rc
1517common:ci --disk_cache=~/.cache/bazel-disk-cache
Original file line number Diff line number Diff line change 2828 key : ${{runner.os}}-bazel-cache
2929 - uses : actions/checkout@v3
3030 - run : bazel build --config=ci ...
31+ build-windows :
32+ runs-on : windows-latest
33+ steps :
34+ - uses : actions/cache@v3
35+ with :
36+ path : |
37+ /Users/runneradmin/AppData/Local/bazelisk
38+ /Users/runneradmin/.cache/bazel-disk-cache
39+ key : ${{runner.os}}-bazel-cache
40+ - uses : actions/checkout@v3
41+ - run : bazel build --config=ci //...
3142 check-dist :
3243 runs-on : ubuntu-latest
3344 steps :
Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
5252
5353rules_pkg_dependencies ()
5454
55+ http_archive (
56+ name = "rules_cc_stamp" ,
57+ strip_prefix = "rules_cc_stamp-63d4861f4d420b574fa0f112599aae2b8aee785e" ,
58+ urls = ["https://github.com/zaucy/rules_cc_stamp/archive/63d4861f4d420b574fa0f112599aae2b8aee785e.zip" ],
59+ sha256 = "f469a3b97eeabeb850c655f59ea17799ff40badd3a0b3e9de38534c89ad2f87d" ,
60+ )
61+
5562http_archive (
5663 name = "ecsact_si_wasm" ,
5764 sha256 = "4153154fd80e2cd48ddd8e0d0c208691f134b33d5c67dc6fc081b3f77149b2c2" ,
@@ -188,9 +195,9 @@ bazel_skylib_workspace()
188195
189196http_archive (
190197 name = "rules_blender" ,
191- sha256 = "1ae03c77c6e41b90904296f8d6269c3de9ffa12d0faef997a50e4edb225ef64c " ,
192- strip_prefix = "rules_blender-6f17aa27b6d76ecda9df0dab2be61adc2bc11c61 " ,
193- urls = ["https://github.com/zaucy/rules_blender/archive/6f17aa27b6d76ecda9df0dab2be61adc2bc11c61 .zip" ],
198+ sha256 = "734b08d1f0eb29a09f81509803cc324c2012a09f47e692a13c41af1370fcb648 " ,
199+ strip_prefix = "rules_blender-ef5c746f0ef3e9b8523175bed4ac8e8157fe0be3 " ,
200+ urls = ["https://github.com/zaucy/rules_blender/archive/ef5c746f0ef3e9b8523175bed4ac8e8157fe0be3 .zip" ],
194201)
195202
196203load ("@rules_blender//:repo.bzl" , "blender_repository" )
Original file line number Diff line number Diff line change 1+ @ echo off
2+
3+ if " %GITHUB_REF% " == " " (
4+ for /f %%i in ('git describe --tags --abbrev^ =0') do (
5+ set GITHUB_REF = %%i
6+ )
7+ )
8+
9+ echo STABLE_ECSACT_SDK_VERSION %GITHUB_REF%
10+
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ if [[ -z " ${GITHUB_REF} " ]]; then
6+ echo " STABLE_ECSACT_SDK_VERSION $( git describe --tags --abbrev=0) "
7+ else
8+ echo " STABLE_ECSACT_SDK_VERSION ${GITHUB_REF} "
9+ fi
10+
Original file line number Diff line number Diff line change 11load ("@rules_cc//cc:defs.bzl" , "cc_binary" )
2+ load ("@rules_cc_stamp//:index.bzl" , "cc_stamp_header" )
23load ("//bazel:copts.bzl" , "copts" )
34
45package (default_visibility = ["//visibility:public" ])
56
7+ cc_stamp_header (
8+ name = "bazel_stamp_header" ,
9+ out = "bazel_stamp_header.hh" ,
10+ )
11+
612cc_binary (
713 name = "ecsact" ,
8- srcs = ["cli.cc" ],
14+ srcs = ["cli.cc" , "bazel_stamp_header.hh" ],
915 copts = copts ,
16+ stamp = 1 ,
1017 deps = [
1118 "//cli/commands:codegen" ,
1219 "//cli/commands:command" ,
Original file line number Diff line number Diff line change 33#include < string>
44#include < string_view>
55#include < unordered_map>
6+ #include " cli/bazel_stamp_header.hh"
67
78#include " ./commands/command.hh"
89#include " ./commands/codegen.hh"
@@ -25,9 +26,9 @@ constexpr auto USAGE = R"(Ecsact SDK Command Line
2526
2627Usage:
2728 ecsact (--help | -h)
29+ ecsact (--version | -v)
2830 ecsact config ([<options>...] | --help)
2931 ecsact codegen ([<options>...] | --help)
30-
3132)" ;
3233
3334std::string colorize_logo () {
@@ -74,6 +75,9 @@ int main(int argc, char* argv[]) {
7475 if (command == " -h" || command == " --help" ) {
7576 print_usage ();
7677 return 0 ;
78+ } else if (command == " -v" || command == " --version" ) {
79+ std::cout << STABLE_ECSACT_SDK_VERSION << " \n " ;
80+ return 0 ;
7781 } else if (command.starts_with (' -' )) {
7882 std::cerr << " Expected subcommand and instead got '" << command << " '\n " ;
7983 print_usage ();
You can’t perform that action at this time.
0 commit comments