mintro: Renamed --dependencies --> --scan-dependencies

pull/4949/head
Daniel Mensinger 6 years ago
parent 185dc8c2e5
commit 7074f12644
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 9
      docs/markdown/IDE-integration.md
  2. 11
      docs/markdown/snippets/introspect_deps_no_bd.md
  3. 11
      mesonbuild/mintro.py
  4. 2
      run_unittests.py

@ -187,13 +187,10 @@ The list of all _found_ dependencies can be acquired from
`intro-dependencies.json`. Here, the name, compiler and linker arguments for
a dependency are listed.
### Using `--dependencies` without a build directory
### Scanning for dependecie with `--scan-dependencies`
It is also possible to get most targets without a build directory. This can be
done by running `meson introspect --dependencies /path/to/meson.build`.
However, the generated output is vastly different from running the introspection
command with a build directory.
It is also possible to get most dependencies used without a build directory.
This can be done by running `meson introspect --scan-dependencies /path/to/meson.build`.
The output format is as follows:

@ -1,10 +1,7 @@
## `introspect --dependencies` can now be used without configured build directory
## `introspect --scan-dependencies` can now be used to scan for dependencies used in a project
It is now possible to run `meson introspect --dependencies /path/to/meson.build`
without a configured build directory.
However, the generated output is vastly different from running the introspection
command with a build directory.
It is now possible to run `meson introspect --scan-dependencies /path/to/meson.build`
without a configured build directory to scan for dependencies.
The output format is as follows:
@ -25,4 +22,4 @@ in the `meson.build` (all dependencies are required by default). The
inside a conditional block. In a real meson run these dependencies might not be
used, thus they _may_ not be required, even if the `required` key is set. The
`has_fallback` key just indicates whether a fallback was directly set in the
`dependency()` function.
`dependency()` function.

@ -70,6 +70,11 @@ def get_meson_introspection_types(coredata: Optional[cdata.CoreData] = None,
'no_bd': lambda intr: list_deps_from_source(intr),
'desc': 'List external dependencies.',
},
'scan_dependencies': {
'no_bd': lambda intr: list_deps_from_source(intr),
'desc': 'Scan for dependencies used in the meson.build file.',
'key': 'scan-dependencies',
},
'installed': {
'func': lambda: list_installed(installdata),
'desc': 'List all installed files and directories.',
@ -431,6 +436,8 @@ def run(options):
# Extract introspection information from JSON
for i in intro_types.keys():
if 'func' not in intro_types[i]:
continue
if not options.all and not getattr(options, i, False):
continue
curr = os.path.join(infodir, 'intro-{}.json'.format(i))
@ -461,6 +468,8 @@ def generate_introspection_file(builddata: build.Build, backend: backends.Backen
intro_info = []
for key, val in intro_types.items():
if 'func' not in val:
continue
intro_info += [(key, val['func']())]
write_intro_info(intro_info, builddata.environment.info_dir)
@ -489,6 +498,8 @@ def write_meson_info_file(builddata: build.Build, errors: list, build_files_upda
intro_info = {}
for i in intro_types.keys():
if 'func' not in intro_types[i]:
continue
intro_info[i] = {
'file': 'intro-{}.json'.format(i),
'updated': i in updated_introspection_files

@ -3545,7 +3545,7 @@ recommended as it is not supported on some platforms''')
def test_introspect_dependencies_from_source(self):
testdir = os.path.join(self.unit_test_dir, '52 introspection')
testfile = os.path.join(testdir, 'meson.build')
res_nb = self.introspect_directory(testfile, ['--dependencies'] + self.meson_args)
res_nb = self.introspect_directory(testfile, ['--scan-dependencies'] + self.meson_args)
expected = [
{
'name': 'threads',

Loading…
Cancel
Save