diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-12-16 11:44:02 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2023-03-03 11:18:58 -0800 |
commit | 424665623d8c30302009e63952c609954fef3a9d (patch) | |
tree | cc5f65eab6ff7a30ce19b6dd7c822d9c2caf175c | |
parent | 3273ecfcc0f53614a77d37fb331d08957941734d (diff) | |
download | meson-424665623d8c30302009e63952c609954fef3a9d.tar.gz |
interpreter: deprecate passing 'jar' to build_target
This never made any sense, as jar() takes different arguments, and even
when it takes the same arguments, it has a different set of allowed
types. This makes validating arguments between the two incredibly
tedious and painful.
-rw-r--r-- | docs/markdown/snippets/build_target_deprecate_jar.md | 6 | ||||
-rw-r--r-- | docs/yaml/functions/build_target.yaml | 2 | ||||
-rw-r--r-- | mesonbuild/interpreter/type_checking.py | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/docs/markdown/snippets/build_target_deprecate_jar.md b/docs/markdown/snippets/build_target_deprecate_jar.md new file mode 100644 index 000000000..1970dfb00 --- /dev/null +++ b/docs/markdown/snippets/build_target_deprecate_jar.md @@ -0,0 +1,6 @@ +## passing `target_type : 'jar'` to `build_target()` is deprecated + +This never really made sense as you can't mix Java sources with non-Java +sources, but this is even more difficult to ensure that we validate the +arguments correctly given that many `jar()` arguments allow different types than +other targets do. diff --git a/docs/yaml/functions/build_target.yaml b/docs/yaml/functions/build_target.yaml index 48385f252..85644c01e 100644 --- a/docs/yaml/functions/build_target.yaml +++ b/docs/yaml/functions/build_target.yaml @@ -12,7 +12,7 @@ description: | - `static_library` (see [[static_library]]) - `both_libraries` (see [[both_libraries]]) - `library` (see [[library]]) - - `jar` (see [[jar]]) + - `jar` (see [[jar]]) *(deprecated since 1.1.0)* This declaration: diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 973b18f75..7f74c84a6 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -861,6 +861,7 @@ BUILD_TARGET_KWS: T.List[KwargInfo] = [ _VS_MODULE_DEF_KW, KwargInfo( 'target_type', str, required=True, + deprecated_values={'jar': ('1.1', 'Use the jar() function instead.')}, validator=in_set_validator({ 'executable', 'shared_library', 'shared_module', 'static_library', 'both_libraries', 'library', |