22 Commits

Author SHA1 Message Date
Paolo Bonzini
d7bedd8cc1 build: replace SubProject with BuildProject for target
The SubProject alone will not be a unique key into build.projects.
Just store the object itself, as it allows retrieving the key.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-17 13:05:22 -07:00
Paolo Bonzini
22e9df5684 modules: java: do not pass strings to CustomTargets
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-04-21 07:57:45 -07:00
Charles Brunet
f9479787a0 fix reconfigure subproject base options 2024-03-10 13:09:32 -07:00
Dylan Baker
e991c4d454 Use SPDX-License-Identifier consistently
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.

This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.

SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
2023-12-13 15:19:21 -05:00
Volker Weißmann
2699fd4b8a During reconfigure, show that no compiler was found, if compiler fails sanity check. 2023-05-13 11:06:24 +03:00
Tristan Partin
37ef5bfdde Replace dashes in Java package names with underscores when generating native headers
This was causing a ninja issue where the native headers were always
being generated because io.github.hse-project.hse_Hse.h was being
expected, but io.github.hse_project.hse_Hse.h was actually generated.
2023-02-08 13:39:28 -05:00
Tristan Partin
dfea023ced Fix package kwarg type 2022-12-11 14:50:26 -06:00
Tristan Partin
2e600ef710 Rename java.generate_native_headers to java.native_headers
This follows the Meson naming scheme which typically leaves off a verb
like generate.
2022-12-11 14:50:26 -06:00
Tristan Partin
b746e92f62 Remove java.generate_native_header
This API existed for 2 minor releases and was worthless for pretty much
every usecase.
2022-12-11 14:50:23 -06:00
Alf Henrik Sauge
06bf9a5cda Fix purely white space issues reported by flake8 2022-08-26 17:12:40 -04:00
Dylan Baker
6843f56f6b modules: use module level information about new and deprecation
Instead of using FeatureNew/FeatureDeprecated in the module.

The goal here is to be able to handle information about modules in a
single place, instead of having to handle it separately. Each module
simply defines some metadata, and then the interpreter handles the rest.
2022-08-17 16:25:36 -04:00
Eli Schwartz
c9938f8f60 move a bunch of imports into TYPE_CHECKING blocks
These are only used for type checking, so don't bother importing them at
runtime.

Generally add future annotations at the same time, to make sure that
existing uses of these imports don't need to be quoted.
2022-03-29 16:44:54 -04:00
Xavier Claessens
e33ec88ac7 Pass environment down to base Target class 2022-03-29 16:10:28 -04:00
Eli Schwartz
a009eacc65 treewide: string-quote the first argument to T.cast
Using future annotations, type annotations become strings at runtime and
don't impact performance. This is not possible to do with T.cast though,
because it is a function argument instead of an annotation.

Quote the type argument everywhere in order to have the same effect as
future annotations. This also allows linters to better detect in some
cases that a given import is typing-only.
2022-03-07 19:01:04 -05:00
Tristan Partin
d072ebc955 Fix @typed_pos_args on java.generate_native_headers 2022-03-07 15:42:07 -08:00
Tristan Partin
5048390a98 Port JavaModule to NewExtensionModule API 2022-03-04 14:59:02 -08:00
Tristan Partin
1960810d64 Fix @typed_pos args on java.generate_native_header 2022-03-04 14:59:02 -08:00
Tristan Partin
18147b91ff Deprecate java.generate_native_header() in favor of java.generate_native_headers()
After implementing a much more extensive Java native module than what
currently exists in the tests, I found shortcomings.

1. You need to be able to pass multiple Java files.
2. Meson needs more information to better track the generated native
   headers.
3. Meson wasn't tracking the header files generated from inner classes.

This new function should fix all the issues the old function had with
room to grow should more functionality need to be added. What I
implemented here in this new function is essentially what I have done in
the Heterogeneous-Memory Storage Engine's Java bindings.
2022-03-01 13:18:50 -08:00
Dylan Baker
11f9638035 build: replace kwargs in CustomTarget initializer
Because we don't want to pass the Interpreter kwargs into the build
layer. This turned out to be a mega commit, as there's really on elegant
way to make this change in an incremental way. On the nice side, mypy
made this change super easy, as nearly all of the calls to
`CustomTarget` are fully type checked!

It also turns out that we're not handling install_tags in custom_target
correctly, since we're not converting the boolean values into Optional
values!
2022-01-28 15:53:20 -05:00
Eli Schwartz
8947352889 fix various flake8 whitespace errors 2021-10-27 09:51:52 -04:00
Eli Schwartz
b3c240989b java module: fix FeatureNew version
It should apply to the *next* stable release.

Reported-by: Tristan Partin <tristan@partin.io>
2021-08-23 12:53:26 -04:00
Tristan Partin
be92e37837 Add Java module
The Java module will serve as a source for easing Java development
within Meson. Currently it only supports generating native header files.
2021-08-22 07:57:29 -07:00