Skip to content

Commit

Permalink
feat: get library_version from env (#1981)
Browse files Browse the repository at this point in the history
* feat: pass library_version from env

* format code

* remove condition

* change default value
  • Loading branch information
JoeWang1127 authored Jul 3, 2024
1 parent 26075d0 commit 696c4bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion synthtool/languages/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
METADATA = "metadata"
LIBRARIES_BOM_VERSION = "libraries_bom_version"
LIBRARIES_BOM_VERSION_ENV_KEY = "SYNTHTOOL_LIBRARIES_BOM_VERSION"
LIBRARY_VERSION = "library_version"
LIBRARY_VERSION_ENV_KEY = "SYNTHTOOL_LIBRARY_VERSION"


def format_code(
Expand Down Expand Up @@ -477,7 +479,7 @@ def _common_template_metadata() -> Dict[str, Any]:


def common_templates(
excludes: List[str] = [],
excludes: List[str] = None,
template_path: Optional[Path] = None,
**kwargs,
) -> None:
Expand All @@ -492,6 +494,8 @@ def common_templates(
:param template_path:
:param kwargs: Additional options for CommonTemplates.java_library()
"""
if not excludes:
excludes = []
metadata = _common_template_metadata()
kwargs[METADATA] = metadata

Expand All @@ -506,6 +510,7 @@ def common_templates(
kwargs[METADATA][LIBRARIES_BOM_VERSION] = os.getenv(
LIBRARIES_BOM_VERSION_ENV_KEY
)
kwargs[METADATA][LIBRARY_VERSION] = os.getenv(LIBRARY_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 696c4bf

Please sign in to comment.