diff options
author | Tristan Partin <tristan@partin.io> | 2022-03-07 13:20:59 -0600 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-07 15:42:07 -0800 |
commit | d072ebc9554e5661419d6d75285bfee24dca743f (patch) | |
tree | ad029e64fbfbfcdf3a607ffeb52fe2474fa44c7a /mesonbuild/modules/java.py | |
parent | d35f11fc08b9033b2ce012eb394028b19d7e25f4 (diff) | |
download | meson-d072ebc9554e5661419d6d75285bfee24dca743f.zip meson-d072ebc9554e5661419d6d75285bfee24dca743f.tar.gz meson-d072ebc9554e5661419d6d75285bfee24dca743f.tar.bz2 |
Fix @typed_pos_args on java.generate_native_headers
Diffstat (limited to 'mesonbuild/modules/java.py')
-rw-r--r-- | mesonbuild/modules/java.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mesonbuild/modules/java.py b/mesonbuild/modules/java.py index 6884a22..3806308 100644 --- a/mesonbuild/modules/java.py +++ b/mesonbuild/modules/java.py @@ -16,7 +16,7 @@ import os import pathlib import typing as T from mesonbuild import mesonlib -from mesonbuild.build import CustomTarget +from mesonbuild.build import CustomTarget, CustomTargetIndex, GeneratedList, Target from mesonbuild.compilers import detect_compiler_for, Compiler from mesonbuild.interpreter import Interpreter from mesonbuild.interpreterbase.decorators import ContainerTypeInfo, FeatureDeprecated, FeatureNew, KwargInfo, typed_pos_args, typed_kwargs @@ -80,12 +80,13 @@ class JavaModule(NewExtensionModule): return ModuleReturnValue(target, [target]) @FeatureNew('java.generate_native_headers', '0.62.0') - @typed_pos_args('java.generate_native_headers', (str, mesonlib.File), min_varargs=1) + @typed_pos_args('java.generate_native_headers', + varargs=(str, mesonlib.File, Target, CustomTargetIndex, GeneratedList)) @typed_kwargs('java.generate_native_headers', - KwargInfo('classes', (ContainerTypeInfo(list, str)), default=[], listify=True, + KwargInfo('classes', ContainerTypeInfo(list, str), default=[], listify=True, required=True), KwargInfo('package', str, default=None)) - def generate_native_headers(self, state: ModuleState, args: T.List[mesonlib.FileOrString], + def generate_native_headers(self, state: ModuleState, args: T.Tuple[T.List[mesonlib.FileOrString]], kwargs: T.Dict[str, T.Optional[str]]) -> ModuleReturnValue: classes = T.cast(T.List[str], kwargs.get('classes')) package = kwargs.get('package') @@ -112,7 +113,7 @@ class JavaModule(NewExtensionModule): prefix = classes[0] if not package else package target = CustomTarget(f'{prefix}-native-headers', state.subdir, state.subproject, command, - sources=list(args), outputs=headers, backend=state.backend) + sources=args[0], outputs=headers, backend=state.backend) # It is only known that 1.8.0 won't pre-create the directory. 11 and 16 # do not exhibit this behavior. |