From 97d6cfee0cbff1e5eb0993c2a0b2b68297b1152f Mon Sep 17 00:00:00 2001 From: irengrig Date: Fri, 21 Sep 2018 11:48:39 +0200 Subject: [PATCH] Print version information by the script (#110) --- tools/build_defs/framework.bzl | 5 ++++- tools/build_defs/version.bzl | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tools/build_defs/version.bzl diff --git a/tools/build_defs/framework.bzl b/tools/build_defs/framework.bzl index a92d7ff2..7750ac50 100644 --- a/tools/build_defs/framework.bzl +++ b/tools/build_defs/framework.bzl @@ -3,6 +3,7 @@ """ load("@bazel_skylib//lib:collections.bzl", "collections") +load(":version.bzl", "VERSION") load( "//tools/build_defs:cc_toolchain_util.bzl", "LibrariesToLinkInfo", @@ -177,8 +178,10 @@ def cc_external_rule_impl(ctx, attrs): if not ctx.attr._target_os[OSInfo].is_osx: set_envs = "\n".join(["export {}=\"{}\"".format(key, env[key]) for key in env]) + version_and_lib = "Bazel external C/C++ Rules #{}. Building library '{}'".format(VERSION, lib_name) + script_lines = [ - "echo \"Building external library '{}'\"".format(lib_name), + "echo \"\n{}\n\"".format(version_and_lib), "set -e", "source " + shell_utils, set_envs, diff --git a/tools/build_defs/version.bzl b/tools/build_defs/version.bzl new file mode 100644 index 00000000..901e5110 --- /dev/null +++ b/tools/build_defs/version.bzl @@ -0,0 +1 @@ +VERSION = "0.0.1"