From 096869ad63157f666773bd93bd14bdd6bd0602aa Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 19 Jul 2023 13:28:51 -0700 Subject: [PATCH] interpreter: use typed_kwargs for jar(java_resources) With the added bonus of adding the correct `since` checking values! --- mesonbuild/interpreter/kwargs.py | 1 + mesonbuild/interpreter/type_checking.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index 95bf9bcf1..4254c3043 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -354,3 +354,4 @@ class BuildTarget(Library): class Jar(_BaseBuildTarget): main_class: str + java_resources: T.Optional[build.StructuredSources] diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index cc1f944a7..38e425734 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -10,7 +10,7 @@ import typing as T from .. import compilers from ..build import (CustomTarget, BuildTarget, CustomTargetIndex, ExtractedObjects, GeneratedList, IncludeDirs, - BothLibraries, SharedLibrary, StaticLibrary, Jar, Executable) + BothLibraries, SharedLibrary, StaticLibrary, Jar, Executable, StructuredSources) from ..coredata import UserFeatureOption from ..dependencies import Dependency, InternalDependency from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo @@ -534,6 +534,7 @@ SHARED_MOD_KWS = [ # them into build_target easier _EXCLUSIVE_JAR_KWS: T.List[KwargInfo] = [ KwargInfo('main_class', str, default=''), + KwargInfo('java_resources', (StructuredSources, NoneType), since='0.62.0'), ] # The total list of arguments used by JAR