Skip to content

Commit

Permalink
feat: add libraries_bom_version in metadata (#1956)
Browse files Browse the repository at this point in the history
* feat: add libraries_bom_version

* add unit tests

* remove isfile

* add tempdir

* restore

* add current dir

* restore template

* remove unit test

* restore templates
  • Loading branch information
JoeWang1127 authored Apr 15, 2024
1 parent 3095543 commit 63cc541
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion synthtool/languages/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
\\*/
"""
DEFAULT_MIN_SUPPORTED_JAVA_VERSION = 8
METADATA = "metadata"
LIBRARIES_BOM_VERSION = "libraries_bom_version"


def format_code(
Expand Down Expand Up @@ -490,7 +492,7 @@ def common_templates(
:param kwargs: Additional options for CommonTemplates.java_library()
"""
metadata = _common_template_metadata()
kwargs["metadata"] = metadata
kwargs[METADATA] = metadata

# Generate flat to tell this repository is a split repo that have migrated
# to monorepo. The owlbot.py in the monorepo sets monorepo=True.
Expand All @@ -499,6 +501,8 @@ 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)
# Special libraries that are not GAPIC_AUTO but in the monorepo
special_libs_in_monorepo = [
"java-translate",
Expand Down

0 comments on commit 63cc541

Please sign in to comment.