Skip to content

Commit 696c4bf

Browse files
authored
feat: get library_version from env (#1981)
* feat: pass library_version from env * format code * remove condition * change default value
1 parent 26075d0 commit 696c4bf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

synthtool/languages/java.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
METADATA = "metadata"
6666
LIBRARIES_BOM_VERSION = "libraries_bom_version"
6767
LIBRARIES_BOM_VERSION_ENV_KEY = "SYNTHTOOL_LIBRARIES_BOM_VERSION"
68+
LIBRARY_VERSION = "library_version"
69+
LIBRARY_VERSION_ENV_KEY = "SYNTHTOOL_LIBRARY_VERSION"
6870

6971

7072
def format_code(
@@ -477,7 +479,7 @@ def _common_template_metadata() -> Dict[str, Any]:
477479

478480

479481
def common_templates(
480-
excludes: List[str] = [],
482+
excludes: List[str] = None,
481483
template_path: Optional[Path] = None,
482484
**kwargs,
483485
) -> None:
@@ -492,6 +494,8 @@ def common_templates(
492494
:param template_path:
493495
:param kwargs: Additional options for CommonTemplates.java_library()
494496
"""
497+
if not excludes:
498+
excludes = []
495499
metadata = _common_template_metadata()
496500
kwargs[METADATA] = metadata
497501

@@ -506,6 +510,7 @@ def common_templates(
506510
kwargs[METADATA][LIBRARIES_BOM_VERSION] = os.getenv(
507511
LIBRARIES_BOM_VERSION_ENV_KEY
508512
)
513+
kwargs[METADATA][LIBRARY_VERSION] = os.getenv(LIBRARY_VERSION_ENV_KEY)
509514
# Special libraries that are not GAPIC_AUTO but in the monorepo
510515
special_libs_in_monorepo = [
511516
"java-translate",

0 commit comments

Comments
 (0)