]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
valadoc: Keep using add_package() for default packages and handle POSIX
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 7 May 2020 08:44:54 +0000 (10:44 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 7 May 2020 08:44:54 +0000 (10:44 +0200)
Caused empty documentations for glib-2.0 and gobject-2.0 after
bd73f1ba11c387c919ad06d44badfd7065d1e35f

Fixes https://gitlab.gnome.org/GNOME/vala/issues/989

valadoc/treebuilder.vala

index 662a8583e2736427a8e230899b543c241c0d070f..82e8a9287d47d22e6c9d0b4e815446aec402fa7f 100644 (file)
@@ -489,7 +489,7 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor {
                        context.directory = context.basedir;
                }
 
-               context.set_target_profile (settings.profile, true);
+               context.set_target_profile (settings.profile, false);
 
                if (settings.target_glib != null) {
                        context.set_target_glib_version (settings.target_glib);
@@ -501,6 +501,19 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor {
                        }
                }
 
+               // FIXME Let CodeContext.set_target_profile() do this and correctly
+               // handle default-packages as given source
+               switch (context.profile) {
+               default:
+               case Vala.Profile.GOBJECT:
+                       add_package (context, "glib-2.0");
+                       add_package (context, "gobject-2.0");
+                       break;
+               case Vala.Profile.POSIX:
+                       add_package (context, "posix");
+                       break;
+               }
+
                // add user defined files:
                add_depencies (context, settings.packages);
                if (reporter.errors > 0) {