Add Starlarkified Python attributes to generate_tables.go (#1365)
* Add Starlarkified Python attributes to generate_tables.go
This ensures backwards compatibility in the CLI for attributes like "main"
and "python_version". Otherwise, they require quoting, when building buildozer
against newer versions of Bazel.
* Updating tables.gen.go to match new type definitions from generate_tables.go
---------
Co-authored-by: Jon Brandvein <brandjon@google.com>
Co-authored-by: Tim Malmström <oreflow@google.com>
diff --git a/generatetables/generate_tables.go b/generatetables/generate_tables.go
index 04330b5..be0f22e 100644
--- a/generatetables/generate_tables.go
+++ b/generatetables/generate_tables.go
@@ -86,6 +86,24 @@
types["package_metadata"] = buildpb.Attribute_LABEL_LIST
}
+ // The following attributes used to exist in the native Python rules but were removed
+ // during Starlarkification. Add them here for backwards compatibility, at least for now.
+ types["api_version"] = buildpb.Attribute_INTEGER
+ types["bootstrap_template"] = buildpb.Attribute_LABEL
+ types["buildpar"] = buildpb.Attribute_BOOLEAN
+ types["coverage_tool"] = buildpb.Attribute_LABEL
+ types["files"] = buildpb.Attribute_LABEL_LIST
+ types["has_services"] = buildpb.Attribute_BOOLEAN
+ types["interpreter"] = buildpb.Attribute_LABEL
+ types["interpreter_path"] = buildpb.Attribute_STRING
+ types["launcher"] = buildpb.Attribute_LABEL
+ types["launcher_uses_whole_archive"] = buildpb.Attribute_BOOLEAN
+ types["main"] = buildpb.Attribute_LABEL
+ types["paropts"] = buildpb.Attribute_STRING_LIST
+ types["python_version"] = buildpb.Attribute_STRING
+ types["srcs_version"] = buildpb.Attribute_STRING
+ types["stub_shebang"] = buildpb.Attribute_STRING
+
return types
}
diff --git a/lang/tables.gen.go b/lang/tables.gen.go
index 0989f68..5daafa8 100755
--- a/lang/tables.gen.go
+++ b/lang/tables.gen.go
@@ -133,6 +133,7 @@
"android_jar": buildpb.Attribute_LABEL,
"annotations_jar": buildpb.Attribute_LABEL,
"api_level": buildpb.Attribute_INTEGER,
+ "api_version": buildpb.Attribute_INTEGER,
"apkbuilder": buildpb.Attribute_LABEL,
"apksigner": buildpb.Attribute_LABEL,
"applicable_licenses": buildpb.Attribute_LABEL_LIST,
@@ -147,10 +148,12 @@
"binary_type": buildpb.Attribute_STRING,
"blacklisted_protos": buildpb.Attribute_LABEL_LIST,
"bootclasspath": buildpb.Attribute_LABEL_LIST,
+ "bootstrap_template": buildpb.Attribute_LABEL,
"build_file": buildpb.Attribute_STRING,
"build_file_content": buildpb.Attribute_STRING,
"build_setting_default": buildpb.Attribute_LABEL,
"build_tools_version": buildpb.Attribute_STRING,
+ "buildpar": buildpb.Attribute_BOOLEAN,
"bundle_loader": buildpb.Attribute_LABEL,
"cache": buildpb.Attribute_INTEGER,
"classpath_resources": buildpb.Attribute_LABEL_LIST,
@@ -169,6 +172,7 @@
"constraints": buildpb.Attribute_STRING_LIST,
"copts": buildpb.Attribute_STRING_LIST,
"coverage_files": buildpb.Attribute_LABEL,
+ "coverage_tool": buildpb.Attribute_LABEL,
"cpu": buildpb.Attribute_STRING,
"cpu_constraints": buildpb.Attribute_LABEL_LIST,
"create_executable": buildpb.Attribute_BOOLEAN,
@@ -239,6 +243,7 @@
"generator_function": buildpb.Attribute_STRING,
"generator_location": buildpb.Attribute_STRING,
"generator_name": buildpb.Attribute_STRING,
+ "has_services": buildpb.Attribute_BOOLEAN,
"hdrs": buildpb.Attribute_LABEL_LIST,
"header_compiler": buildpb.Attribute_LABEL_LIST,
"header_compiler_builtin_processors": buildpb.Attribute_STRING_LIST,
@@ -275,6 +280,7 @@
"jvm_flags": buildpb.Attribute_STRING_LIST,
"jvm_opts": buildpb.Attribute_STRING_LIST,
"launcher": buildpb.Attribute_LABEL,
+ "launcher_uses_whole_archive": buildpb.Attribute_BOOLEAN,
"legacy_create_init": buildpb.Attribute_TRISTATE,
"libc_top": buildpb.Attribute_LABEL,
"licenses": buildpb.Attribute_LICENSE,
@@ -329,6 +335,7 @@
"package_metadata": buildpb.Attribute_LABEL_LIST,
"packages": buildpb.Attribute_LABEL_LIST,
"parents": buildpb.Attribute_LABEL_LIST,
+ "paropts": buildpb.Attribute_STRING_LIST,
"path": buildpb.Attribute_STRING,
"pch": buildpb.Attribute_LABEL,
"platform_apks": buildpb.Attribute_LABEL_LIST,
@@ -392,6 +399,7 @@
"strip_files": buildpb.Attribute_LABEL,
"strip_import_prefix": buildpb.Attribute_STRING,
"strip_include_prefix": buildpb.Attribute_STRING,
+ "stub_shebang": buildpb.Attribute_STRING,
"support_apks": buildpb.Attribute_LABEL_LIST,
"supports_header_parsing": buildpb.Attribute_BOOLEAN,
"supports_param_files": buildpb.Attribute_BOOLEAN,