| 1 |
expand_content_md_files = [ |
| 2 |
] |
| 3 |
|
| 4 |
toml_data = configuration_data() |
| 5 |
toml_data.set('VERSION', libmanette_version) |
| 6 |
|
| 7 |
libmanette_toml = configure_file( |
| 8 |
input: 'libmanette.toml.in', |
| 9 |
output: 'libmanette.toml', |
| 10 |
configuration: toml_data |
| 11 |
) |
| 12 |
|
| 13 |
dependency( |
| 14 |
'gi-docgen', version: '>= 2021.1', |
| 15 |
fallback: ['gi-docgen', 'dummy_dep'], |
| 16 |
native: true, |
| 17 |
required: get_option('doc') |
| 18 |
) |
| 19 |
|
| 20 |
gidocgen = find_program('gi-docgen') |
| 21 |
|
| 22 |
docs_dir = datadir / 'doc' |
| 23 |
|
| 24 |
custom_target('libmanette-doc', |
| 25 |
input: [ libmanette_toml, libmanette_gir[0] ], |
| 26 |
output: 'libmanette', |
| 27 |
command: [ |
| 28 |
gidocgen, |
| 29 |
'generate', |
| 30 |
'--quiet', |
| 31 |
'--config=@INPUT0@', |
| 32 |
'--output-dir=@OUTPUT@', |
| 33 |
'--no-namespace-dir', |
| 34 |
'--content-dir=@0@'.format(meson.current_source_dir()), |
| 35 |
'@INPUT1@', |
| 36 |
], |
| 37 |
depend_files: [ expand_content_md_files ], |
| 38 |
build_by_default: true, |
| 39 |
install: true, |
| 40 |
install_dir: docs_dir, |
| 41 |
) |
| 42 |
|
| 43 |
test('Validate docs', |
| 44 |
gidocgen, |
| 45 |
args: [ |
| 46 |
'check', |
| 47 |
'--config', libmanette_toml, |
| 48 |
'--add-include-path=@0@'.format(meson.current_build_dir() / '../src'), |
| 49 |
libmanette_gir[0], |
| 50 |
], |
| 51 |
depends: libmanette_gir[0], |
| 52 |
suite: ['doc'], |
| 53 |
) |