Skip to content

Commit e36d2f1

Browse files
authoredMay 17, 2024··
feat: [java] allow passing libraries_bom_version from env (#1967)
* feat: [java] allow passing libraries_bom_version from env * reformat
1 parent 0b86c72 commit e36d2f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎synthtool/languages/java.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
DEFAULT_MIN_SUPPORTED_JAVA_VERSION = 8
6565
METADATA = "metadata"
6666
LIBRARIES_BOM_VERSION = "libraries_bom_version"
67+
LIBRARIES_BOM_VERSION_ENV_KEY = "SYNTHTOOL_LIBRARIES_BOM_VERSION"
6768

6869

6970
def format_code(
@@ -501,8 +502,10 @@ def common_templates(
501502
split_repo = not monorepo
502503
repo_metadata = metadata["repo"]
503504
repo_short = repo_metadata["repo_short"]
504-
if LIBRARIES_BOM_VERSION in kwargs:
505-
kwargs[METADATA][LIBRARIES_BOM_VERSION] = kwargs.get(LIBRARIES_BOM_VERSION)
505+
if os.getenv(LIBRARIES_BOM_VERSION_ENV_KEY, default=None) is not None:
506+
kwargs[METADATA][LIBRARIES_BOM_VERSION] = os.getenv(
507+
LIBRARIES_BOM_VERSION_ENV_KEY
508+
)
506509
# Special libraries that are not GAPIC_AUTO but in the monorepo
507510
special_libs_in_monorepo = [
508511
"java-translate",

0 commit comments

Comments
 (0)
Please sign in to comment.