summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-16 17:29:23 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-02-16 17:29:23 +0100
commitcbe7859d1c79fbb991186605b5ea2defdfe9ef52 (patch)
treef95e1271a3f7a00fd1430dc28f4b5a2117d772fb
parentf297454ac0566b8614cc4a7dd1cbce5a3a1307c8 (diff)
docgen: add -p to print what exactly is being generated currently
-rw-r--r--src/scripts/elua/apps/gendoc.lua41
1 files changed, 33 insertions, 8 deletions
diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 9cbbf7a139..9100f73892 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -8,6 +8,8 @@ local writer = require("docgen.writer")
8local keyref = require("docgen.keyref") 8local keyref = require("docgen.keyref")
9local dtree = require("docgen.doctree") 9local dtree = require("docgen.doctree")
10 10
11local printgen = function() end
12
11local propt_to_type = { 13local propt_to_type = {
12 [dtree.Function.PROPERTY] = "(get, set)", 14 [dtree.Function.PROPERTY] = "(get, set)",
13 [dtree.Function.PROP_GET] = "(get)", 15 [dtree.Function.PROP_GET] = "(get)",
@@ -327,6 +329,7 @@ end
327 329
328local build_ref = function() 330local build_ref = function()
329 local f = writer.Writer("reference", "EFL Reference") 331 local f = writer.Writer("reference", "EFL Reference")
332 printgen("Generating reference...")
330 333
331 f:write_editable({ "reference" }, "general") 334 f:write_editable({ "reference" }, "general")
332 f:write_nl() 335 f:write_nl()
@@ -717,7 +720,9 @@ end
717 720
718local build_class = function(cl) 721local build_class = function(cl)
719 local cln = cl:nspaces_get() 722 local cln = cl:nspaces_get()
720 local f = writer.Writer(cln, cl:full_name_get()) 723 local fulln = cl:full_name_get()
724 local f = writer.Writer(cln, fulln)
725 printgen("Generating class: " .. fulln)
721 stats.check_class(cl) 726 stats.check_class(cl)
722 727
723 keyref.add(cl:full_name_get():gsub("%.", "_"), cln, "c") 728 keyref.add(cl:full_name_get():gsub("%.", "_"), cln, "c")
@@ -804,7 +809,9 @@ end
804 809
805local build_alias = function(tp) 810local build_alias = function(tp)
806 local ns = dtree.Node.nspaces_get(tp, "alias") 811 local ns = dtree.Node.nspaces_get(tp, "alias")
807 local f = writer.Writer(ns, tp:full_name_get()) 812 local fulln = tp:full_name_get()
813 local f = writer.Writer(ns, fulln)
814 printgen("Generating alias: " .. fulln)
808 stats.check_alias(tp) 815 stats.check_alias(tp)
809 816
810 write_tsigs(f, tp, ns) 817 write_tsigs(f, tp, ns)
@@ -821,7 +828,9 @@ end
821 828
822local build_struct = function(tp) 829local build_struct = function(tp)
823 local ns = dtree.Node.nspaces_get(tp, "struct") 830 local ns = dtree.Node.nspaces_get(tp, "struct")
824 local f = writer.Writer(ns, tp:full_name_get()) 831 local fulln = tp:full_name_get()
832 local f = writer.Writer(ns, fulln)
833 printgen("Generating struct: " .. fulln)
825 stats.check_struct(tp) 834 stats.check_struct(tp)
826 835
827 write_tsigs(f, tp, ns) 836 write_tsigs(f, tp, ns)
@@ -853,7 +862,9 @@ end
853 862
854local build_enum = function(tp) 863local build_enum = function(tp)
855 local ns = dtree.Node.nspaces_get(tp, "enum") 864 local ns = dtree.Node.nspaces_get(tp, "enum")
856 local f = writer.Writer(ns, tp:full_name_get()) 865 local fulln = tp:full_name_get()
866 local f = writer.Writer(ns, fulln)
867 printgen("Generating enum: " .. fulln)
857 stats.check_enum(tp) 868 stats.check_enum(tp)
858 869
859 write_tsigs(f, tp, ns) 870 write_tsigs(f, tp, ns)
@@ -885,7 +896,9 @@ end
885 896
886local build_variable = function(v, constant) 897local build_variable = function(v, constant)
887 local ns = v:nspaces_get() 898 local ns = v:nspaces_get()
888 local f = writer.Writer(ns, v:full_name_get()) 899 local fulln = v:full_name_get()
900 local f = writer.Writer(ns, fulln)
901 printgen("Generating variable: " .. fulln)
889 if constant then 902 if constant then
890 stats.check_constant(v) 903 stats.check_constant(v)
891 else 904 else
@@ -1068,7 +1081,9 @@ build_method = function(impl, cl)
1068 local over = impl:is_overridden(cl) 1081 local over = impl:is_overridden(cl)
1069 local fn = impl:function_get() 1082 local fn = impl:function_get()
1070 local mns = fn:nspaces_get(cl) 1083 local mns = fn:nspaces_get(cl)
1071 local f = writer.Writer(mns, cl:full_name_get() .. "." .. fn:name_get()) 1084 local methn = cl:full_name_get() .. "." .. fn:name_get()
1085 local f = writer.Writer(mns, methn)
1086 printgen("Generating method: " .. methn)
1072 stats.check_method(fn, cl) 1087 stats.check_method(fn, cl)
1073 1088
1074 write_inherited_from(f, impl, cl, over) 1089 write_inherited_from(f, impl, cl, over)
@@ -1110,7 +1125,9 @@ build_property = function(impl, cl)
1110 local over = impl:is_overridden(cl) 1125 local over = impl:is_overridden(cl)
1111 local fn = impl:function_get() 1126 local fn = impl:function_get()
1112 local pns = fn:nspaces_get(cl) 1127 local pns = fn:nspaces_get(cl)
1113 local f = writer.Writer(pns, cl:full_name_get() .. "." .. fn:name_get()) 1128 local propn = cl:full_name_get() .. "." .. fn:name_get()
1129 local f = writer.Writer(pns, propn)
1130 printgen("Generating property: " .. propn)
1114 1131
1115 write_inherited_from(f, impl, cl, over) 1132 write_inherited_from(f, impl, cl, over)
1116 1133
@@ -1216,7 +1233,9 @@ end
1216 1233
1217build_event = function(ev, cl) 1234build_event = function(ev, cl)
1218 local evn = ev:nspaces_get(cl) 1235 local evn = ev:nspaces_get(cl)
1219 local f = writer.Writer(evn, cl:full_name_get() .. ": " .. ev:name_get()) 1236 local evnm = cl:full_name_get() .. ": " .. ev:name_get()
1237 local f = writer.Writer(evn, evnm)
1238 printgen("Generating event: " .. evnm)
1220 1239
1221 f:write_h("Signature", 2) 1240 f:write_h("Signature", 2)
1222 local buf = { ev:name_get() } 1241 local buf = { ev:name_get() }
@@ -1271,6 +1290,7 @@ getopt.parse {
1271 callback = getopt.help_cb(io.stdout) 1290 callback = getopt.help_cb(io.stdout)
1272 }, 1291 },
1273 { "v", "verbose", false, help = "Be verbose." }, 1292 { "v", "verbose", false, help = "Be verbose." },
1293 { "p", "print-gen", false, help = "Print what is being generated." },
1274 1294
1275 { category = "Generator" }, 1295 { category = "Generator" },
1276 { "r", "root", true, help = "Root path of the docs." }, 1296 { "r", "root", true, help = "Root path of the docs." },
@@ -1290,6 +1310,9 @@ getopt.parse {
1290 if opts["h"] then 1310 if opts["h"] then
1291 return 1311 return
1292 end 1312 end
1313 if opts["p"] then
1314 printgen = function(...) print(...) end
1315 end
1293 if opts["graph-theme-dark"] then 1316 if opts["graph-theme-dark"] then
1294 current_theme = default_theme_light 1317 current_theme = default_theme_light
1295 end 1318 end
@@ -1329,6 +1352,8 @@ getopt.parse {
1329 build_typedecls() 1352 build_typedecls()
1330 build_variables() 1353 build_variables()
1331 keyref.build() 1354 keyref.build()
1355 -- newline if printing what's being generated
1356 printgen()
1332 stats.print() 1357 stats.print()
1333 end 1358 end
1334} 1359}