diff --git a/tools/erlang_vars.bzl b/tools/erlang_vars.bzl index 5b17ab24..0b26bf4f 100644 --- a/tools/erlang_vars.bzl +++ b/tools/erlang_vars.bzl @@ -1,14 +1,32 @@ +ERLANG_VARS_ENV_MAP = { + "OTP_VERSION": "$(OTP_VERSION)", + "OTP_VERSION_FILE_PATH": "$(OTP_VERSION_FILE_PATH)", + "OTP_VERSION_FILE_SHORT_PATH": "$(OTP_VERSION_FILE_SHORT_PATH)", + "ERLANG_HOME": "$(ERLANG_HOME)", +} + +ERLANG_VARS_ENV_MAP_INTERNAL = ERLANG_VARS_ENV_MAP | { + "OTP_INSTALL_PATH": "$(OTP_INSTALL_PATH)", + "ERLANG_RELEASE_TAR_PATH": "$(ERLANG_RELEASE_TAR_PATH)", + "ERLANG_RELEASE_TAR_SHORT_PATH": "$(ERLANG_RELEASE_TAR_SHORT_PATH)", +} + def _impl(ctx): otpinfo = ctx.toolchains["//tools:toolchain_type"].otpinfo vars = { "OTP_VERSION": otpinfo.version, + "OTP_VERSION_FILE_PATH": otpinfo.version_file.path, + "OTP_VERSION_FILE_SHORT_PATH": otpinfo.version_file.short_path, "ERLANG_HOME": otpinfo.erlang_home, } if otpinfo.release_dir_tar != None: + vars["OTP_INSTALL_PATH"] = otpinfo.install_path vars["ERLANG_RELEASE_TAR_PATH"] = otpinfo.release_dir_tar.path vars["ERLANG_RELEASE_TAR_SHORT_PATH"] = otpinfo.release_dir_tar.short_path - return [platform_common.TemplateVariableInfo(vars)] + return [ + platform_common.TemplateVariableInfo(vars), + ] erlang_vars = rule( implementation = _impl,