summaryrefslogtreecommitdiff
path: root/valadoc
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-04-01 21:21:19 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-04-01 21:26:43 +0200
commitddf82bd61b36e10c3c72ee2fd87d48f3a0f81f42 (patch)
tree5ee5bc8e09cafcba658730b0c417611d3355bf2b /valadoc
parent74952b2d9d3b8926b73e67b04e148a78804b1f6a (diff)
downloadvala-ddf82bd61b36e10c3c72ee2fd87d48f3a0f81f42.tar.gz
valadoc: Drop obsolete "Driver" API
Diffstat (limited to 'valadoc')
-rw-r--r--valadoc/Makefile.am1
-rw-r--r--valadoc/driver.vala68
-rw-r--r--valadoc/girwriter.vala2
-rw-r--r--valadoc/symbolresolver.vala2
-rw-r--r--valadoc/tests/Makefile.am2
-rw-r--r--valadoc/tests/drivers/generic-api-test.vala9
-rw-r--r--valadoc/treebuilder.vala2
-rw-r--r--valadoc/valadoc.vala15
8 files changed, 18 insertions, 83 deletions
diff --git a/valadoc/Makefile.am b/valadoc/Makefile.am
index b7fb50986..89edc5578 100644
--- a/valadoc/Makefile.am
+++ b/valadoc/Makefile.am
@@ -27,7 +27,6 @@ BUILT_SOURCES = valadoc.vala.stamp
bin_PROGRAMS = valadoc
valadoc_VALASOURCES = \
- driver.vala \
girwriter.vala \
initializerbuilder.vala \
symbolresolver.vala \
diff --git a/valadoc/driver.vala b/valadoc/driver.vala
deleted file mode 100644
index 9bd4a3e19..000000000
--- a/valadoc/driver.vala
+++ /dev/null
@@ -1,68 +0,0 @@
-/* driver.vala
- *
- * Copyright (C) 2011 Florian Brosch
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Florian Brosch <flo.brosch@gmail.com>
- */
-
-
-using Valadoc.Api;
-
-/**
- * Creates an simpler, minimized, more abstract AST for valacs AST.
- */
-public class Valadoc.Drivers.Driver : Object, Valadoc.Driver {
- private SymbolResolver resolver;
- private Api.Tree? tree;
-
- public void write_gir (Settings settings, ErrorReporter reporter) {
- var gir_writer = new Drivers.GirWriter (resolver);
-
- // put .gir file in current directory unless -d has been explicitly specified
- string gir_directory = ".";
- if (settings.gir_directory != null) {
- gir_directory = settings.gir_directory;
- }
-
- gir_writer.write_file (tree.context,
- gir_directory,
- "%s-%s.gir".printf (settings.gir_namespace, settings.gir_version),
- settings.gir_namespace,
- settings.gir_version,
- settings.pkg_name);
- }
-
- public Api.Tree? build (Settings settings, ErrorReporter reporter) {
- TreeBuilder builder = new TreeBuilder ();
- tree = builder.build (settings, reporter);
- if (reporter.errors > 0) {
- return null;
- }
-
- resolver = new SymbolResolver (builder);
- tree.accept (resolver);
-
- return tree;
- }
-}
-
-
-public Type register_plugin (Valadoc.ModuleLoader module_loader) {
- return typeof (Valadoc.Drivers.Driver);
-}
-
diff --git a/valadoc/girwriter.vala b/valadoc/girwriter.vala
index 66deb38ae..84131eb86 100644
--- a/valadoc/girwriter.vala
+++ b/valadoc/girwriter.vala
@@ -26,7 +26,7 @@ using Valadoc.Api;
/**
* Code visitor generating .gir file for the public interface.
*/
-public class Valadoc.Drivers.GirWriter : Vala.GIRWriter {
+public class Valadoc.GirWriter : Vala.GIRWriter {
private GtkdocRenderer renderer;
private SymbolResolver resolver;
diff --git a/valadoc/symbolresolver.vala b/valadoc/symbolresolver.vala
index adf19a34a..d96b9ca72 100644
--- a/valadoc/symbolresolver.vala
+++ b/valadoc/symbolresolver.vala
@@ -23,7 +23,7 @@
using Valadoc.Api;
-public class Valadoc.Drivers.SymbolResolver : Visitor {
+public class Valadoc.SymbolResolver : Visitor {
private Vala.HashMap<Vala.Symbol, Symbol> symbol_map;
private Valadoc.Api.Class glib_error;
private Api.Tree root;
diff --git a/valadoc/tests/Makefile.am b/valadoc/tests/Makefile.am
index b49de43cb..7f14c8a78 100644
--- a/valadoc/tests/Makefile.am
+++ b/valadoc/tests/Makefile.am
@@ -43,7 +43,6 @@ check_PROGRAMS = driver
driver_VALASOURCES = \
drivers/driver-test.vala \
drivers/generic-api-test.vala \
- $(top_srcdir)/valadoc/driver.vala \
$(top_srcdir)/valadoc/girwriter.vala \
$(top_srcdir)/valadoc/initializerbuilder.vala \
$(top_srcdir)/valadoc/symbolresolver.vala \
@@ -54,7 +53,6 @@ driver_SOURCES = \
driver.vala.stamp \
drivers/driver-test.c \
drivers/generic-api-test.c \
- driver.c \
girwriter.c \
initializerbuilder.c \
symbolresolver.c \
diff --git a/valadoc/tests/drivers/generic-api-test.vala b/valadoc/tests/drivers/generic-api-test.vala
index 24ef6954f..f8e57bb50 100644
--- a/valadoc/tests/drivers/generic-api-test.vala
+++ b/valadoc/tests/drivers/generic-api-test.vala
@@ -2885,13 +2885,12 @@ public static void test_driver () {
settings.path = "out";
- var driver = new Valadoc.Drivers.Driver ();
- assert (driver != null);
-
-
- Api.Tree? doctree = driver.build (settings, reporter);
+ TreeBuilder builder = new TreeBuilder ();
+ Api.Tree? doctree = builder.build (settings, reporter);
assert (reporter.errors == 0);
assert (doctree != null);
+ SymbolResolver resolver = new SymbolResolver (builder);
+ doctree.accept (resolver);
bool tmp = doctree.create_tree ();
diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala
index 921a72d33..66638d892 100644
--- a/valadoc/treebuilder.vala
+++ b/valadoc/treebuilder.vala
@@ -26,7 +26,7 @@ using Valadoc.Api;
/**
* Creates an simpler, minimized, more abstract AST for valacs AST.
*/
-public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
+public class Valadoc.TreeBuilder : Vala.CodeVisitor {
private Vala.ArrayList<PackageMetaData> packages = new Vala.ArrayList<PackageMetaData> ();
private PackageMetaData source_package;
diff --git a/valadoc/valadoc.vala b/valadoc/valadoc.vala
index 6d5093092..2bb6558f9 100644
--- a/valadoc/valadoc.vala
+++ b/valadoc/valadoc.vala
@@ -232,8 +232,6 @@ public class ValaDoc : Object {
settings.alternative_resource_dirs = alternative_resource_dirs;
- var driver = new Valadoc.Drivers.Driver ();
-
// load plugins:
Doclet? doclet = null;
ModuleLoader? modules = create_module_loader (reporter, out doclet);
@@ -242,11 +240,14 @@ public class ValaDoc : Object {
}
// Create tree:
- Valadoc.Api.Tree doctree = driver.build (settings, reporter);
+ TreeBuilder builder = new TreeBuilder ();
+ Valadoc.Api.Tree doctree = builder.build (settings, reporter);
if (reporter.errors > 0) {
doclet = null;
return quit (reporter);
}
+ SymbolResolver resolver = new SymbolResolver (builder);
+ doctree.accept (resolver);
// register child symbols:
Valadoc.Api.ChildSymbolRegistrar registrar = new Valadoc.Api.ChildSymbolRegistrar ();
@@ -279,7 +280,13 @@ public class ValaDoc : Object {
}
if (ValaDoc.gir_name != null) {
- driver.write_gir (settings, reporter);
+ var gir_writer = new GirWriter (resolver);
+ gir_writer.write_file (doctree.context,
+ settings.gir_directory,
+ "%s-%s.gir".printf (settings.gir_namespace, settings.gir_version),
+ settings.gir_namespace,
+ settings.gir_version,
+ settings.pkg_name);
if (reporter.errors > 0) {
return quit (reporter);
}