summaryrefslogtreecommitdiff
path: root/libnm/generate-plugin-docs.pl
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2017-12-15 14:35:31 +0100
committerThomas Haller <thaller@redhat.com>2017-12-16 15:12:33 +0100
commit28914f6a68888d42cd6e7f3dd906df47199e9b39 (patch)
tree823958b5e79e01fa1dbf1d8f071334bbb45addf0 /libnm/generate-plugin-docs.pl
parent22ffd53369d89bd8b7f34a20800dee9ca287f7e2 (diff)
downloadNetworkManager-28914f6a68888d42cd6e7f3dd906df47199e9b39.tar.gz
build: Make generate-plugin-docs.pl independent of autotools
`generate-plugin-docs.pl` script which is used to parse `nm-setting-c*.c` files depends on autotools. This is because it parses the `Makefile.am` in order to figure out the setting files it needs to parse. This patch makes the script independent of autotools by passing the necessary setting files by command line instead of parsing the `Makefile.am` file. It also changes the autotools' and meson's accordingly.
Diffstat (limited to 'libnm/generate-plugin-docs.pl')
-rwxr-xr-xlibnm/generate-plugin-docs.pl20
1 files changed, 4 insertions, 16 deletions
diff --git a/libnm/generate-plugin-docs.pl b/libnm/generate-plugin-docs.pl
index 24912a0372..e4963b7c50 100755
--- a/libnm/generate-plugin-docs.pl
+++ b/libnm/generate-plugin-docs.pl
@@ -46,25 +46,14 @@ use v5.10;
# global variables
my @keywords = ("property", "variable", "format", "values", "default", "example", "description");
-my @source_files;
my @data;
my $fo;
-(scalar @ARGV == 3) or die "Usage: $0 <plugin> <srcdir> <output-xml-file>\n";
-my ($plugin, $srcdir, $output) = @ARGV;
+(scalar @ARGV >= 3) or die "Usage: $0 <plugin> <output-xml-file> <srcfiles>\n";
+my ($plugin, $output, (@source_files)) = @ARGV;
my $start_tag = "---$plugin---\\s*\$";
my $end_tag = '---end---';
-# get source files to scan for documentation comments (nm-setting-<something>.c)
-my $file = "$srcdir/Makefile.am";
-open my $fh, '<', $file or die "Can't open $file: $!";
-while (my $line = <$fh>) {
- if ($line =~ /^\t*(libnm-core\/nm-setting-[^.]*\.c)( \\)?$/g) {
- push @source_files, $1;
- }
-}
-close $fh;
-
# open output file
open $fo, '>', $output or die "Can't open $output: $!";
@@ -73,11 +62,10 @@ write_header();
# write generated documenation for each setting
foreach my $c_file (@source_files) {
- my $path = "$srcdir/$c_file";
- my $setting_name = get_setting_name($path);
+ my $setting_name = get_setting_name($c_file);
if ($setting_name) {
write_item("<setting name=\"$setting_name\">");
- scan_doc_comments($path, $start_tag, $end_tag);
+ scan_doc_comments($c_file, $start_tag, $end_tag);
write_item("</setting>");
}
}