[vala/staging: 2/2] valadoc: Drop obsolete "Driver" API
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 2/2] valadoc: Drop obsolete "Driver" API
- Date: Mon, 1 Apr 2019 20:19:03 +0000 (UTC)
commit ddf82bd61b36e10c3c72ee2fd87d48f3a0f81f42
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Apr 1 21:21:19 2019 +0200
valadoc: Drop obsolete "Driver" API
libvaladoc/Makefile.am | 1 -
libvaladoc/api/driver.vala | 42 ------------------
valadoc/Makefile.am | 1 -
valadoc/driver.vala | 68 -----------------------------
valadoc/girwriter.vala | 2 +-
valadoc/symbolresolver.vala | 2 +-
valadoc/tests/Makefile.am | 2 -
valadoc/tests/drivers/generic-api-test.vala | 9 ++--
valadoc/treebuilder.vala | 2 +-
valadoc/valadoc.vala | 15 +++++--
10 files changed, 18 insertions(+), 126 deletions(-)
---
diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
index 7456fb836..73fd966c4 100644
--- a/libvaladoc/Makefile.am
+++ b/libvaladoc/Makefile.am
@@ -88,7 +88,6 @@ libvaladoc_la_VALASOURCES = \
api/typereference.vala \
api/typesymbol.vala \
api/visitor.vala \
- api/driver.vala \
content/block.vala \
content/blockcontent.vala \
content/comment.vala \
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/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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]