/** THIS IS THE ENTRY POINT... the application -- in theory this code can be used as a library... but this is the standard command line version... valac --vapidir=/usr/share/vala/vapi --vapidir=/usr/share/vala/vapi --vapidir=/usr/share/vala-0.30/vapi --thread -g JSDOC/Lang.vala JSDOC/TextStream.vala JSDOC/TokenReader.vala JSDOC/Token.vala JSDOC/TokenStream.vala JSDOC/Packer.vala JSDOC/Collapse.vala JSDOC/ScopeParser.vala JSDOC/Scope.vala JSDOC/Identifier.vala JSDOC/CompressWhite.vala JSDOC/PackerRun.vala --pkg glib-2.0 --pkg gee-1.0 --pkg gio-2.0 --pkg posix -o /tmp/jspack --target-glib=2.32 -X -lm */ JSDOC.PackerRun _PackerRun; namespace JSDOC { // --------------- <<<<<<<
{ print("%s: %s\n", dom, msg); }); } // set the base directory... var curdir = Environment.get_current_dir() + Path.DIR_SEPARATOR_S; if (opt_basedir == null) { opt_real_basedir = curdir; } else if (opt_basedir[0] == '/') { opt_real_basedir = opt_basedir; } else { opt_real_basedir = curdir + opt_basedir; } // suffix a slash.. if (opt_real_basedir [opt_real_basedir .length-1].to_string() != Path.DIR_SEPARATOR_S) { opt_real_basedir += Path.DIR_SEPARATOR_S; } GLib.debug("real_base_dir = '%s' : opt_basedir ='%s'\n", opt_real_basedir , opt_basedir); if (opt_files == null && opt_files_from == null) { GLib.error("You must list some files with -f or -i to compile - see --help for more details"); GLib.Process.exit(1); } // initialize the Packer (does not parse anything..) var p = new Packer( this ); if (opt_files != null) { foreach (var f in opt_files) { GLib.debug("Adding File %s", f); p.loadFile(f); // just adds to list of files to parse (no parsing yet..) } } if (opt_files_from != null) { foreach (var f in opt_files_from) { GLib.debug("Adding File %s", f); p.loadSourceIndex(f); } } var run_pack = false; if (opt_target != null || opt_debug_target != null || opt_dump_tokens ) { // do the actual packing... p.pack( opt_target == null ? "" : opt_target , opt_debug_target == null ? "" : opt_debug_target ); if (p.outstr.length > 0 ) { stdout.printf ("%s", p.outstr); } return; } if (opt_doc_target != null || opt_doc_dump_tree) { // remove trailing / if (opt_doc_target != null ) { opt_doc_target = opt_doc_target.has_suffix("/") ? opt_doc_target.substring(0, opt_doc_target.length-1) : opt_doc_target; } var d = new JSDOC.DocBuilder(p); return; } GLib.error("either select output target or doc output target"); } } }