Skip to content

Commit

Permalink
feat: [java] allow passing libraries_bom_version from env (#1967)
Browse files Browse the repository at this point in the history
* feat: [java] allow passing libraries_bom_version from env

* reformat
  • Loading branch information
diegomarquezp committed May 17, 2024
1 parent 0b86c72 commit e36d2f1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions synthtool/languages/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
DEFAULT_MIN_SUPPORTED_JAVA_VERSION = 8
METADATA = "metadata"
LIBRARIES_BOM_VERSION = "libraries_bom_version"
LIBRARIES_BOM_VERSION_ENV_KEY = "SYNTHTOOL_LIBRARIES_BOM_VERSION"


def format_code(
Expand Down Expand Up @@ -501,8 +502,10 @@ def common_templates(
split_repo = not monorepo
repo_metadata = metadata["repo"]
repo_short = repo_metadata["repo_short"]
if LIBRARIES_BOM_VERSION in kwargs:
kwargs[METADATA][LIBRARIES_BOM_VERSION] = kwargs.get(LIBRARIES_BOM_VERSION)
if os.getenv(LIBRARIES_BOM_VERSION_ENV_KEY, default=None) is not None:
kwargs[METADATA][LIBRARIES_BOM_VERSION] = os.getenv(
LIBRARIES_BOM_VERSION_ENV_KEY
)
# Special libraries that are not GAPIC_AUTO but in the monorepo
special_libs_in_monorepo = [
"java-translate",
Expand Down

0 comments on commit e36d2f1

Please sign in to comment.