diff --git a/source/dub/dub.d b/source/dub/dub.d index 4cdd2ea..4baf7b4 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -353,7 +353,8 @@ void runDdox() { auto ddox_pack = m_packageManager.getBestPackage("ddox", ">=0.0.0"); - if( !ddox_pack ){ + if (!ddox_pack) ddox_pack = m_packageManager.getBestPackage("ddox", "~master"); + if (!ddox_pack) { logInfo("DDOX is not installed, performing user wide installation."); ddox_pack = install("ddox", new Dependency(">=0.0.0"), InstallLocation.userWide); } @@ -383,7 +384,9 @@ auto dub_path = p.toNativeString(); string[] commands; - commands ~= dub_path~"ddox filter --min-protection=Protected docs.json"; + string[] filterargs = m_project.mainPackage.info.ddoxFilterArgs.dup; + if (filterargs.empty) filterargs = ["--min-protection=Protected", "--only-documented"]; + commands ~= dub_path~"ddox filter "~filterargs.join(" ")~" docs.json"; commands ~= dub_path~"ddox generate-html docs.json docs"; version(Windows) commands ~= "xcopy /S /D "~dub_path~"public\\* docs\\"; else commands ~= "cp -r "~dub_path~"public/* docs/"; diff --git a/source/dub/package_.d b/source/dub/package_.d index 7ad5296..ac774a5 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -150,6 +150,7 @@ @property string name() const { return m_info.name; } @property string vers() const { return m_info.version_; } @property Version ver() const { return Version(m_info.version_); } + @property const(PackageInfo) info() const { return m_info; } @property installLocation() const { return m_location; } @property Path path() const { return m_path; } @property Path packageInfoFile() const { return m_path ~ "package.json"; } @@ -213,7 +214,7 @@ } /// Human readable information of this package and its dependencies. - string info() const { + string generateInfoString() const { string s; s ~= m_info.name ~ ", version '" ~ m_info.version_ ~ "'"; s ~= "\n Dependencies:"; @@ -256,6 +257,7 @@ string[] authors; string copyright; string license; + string[] ddoxFilterArgs; Dependency[string] dependencies; BuildSettingsTemplate buildSettings; ConfigurationInfo[] configurations; @@ -272,6 +274,7 @@ case "authors": this.authors = deserializeJson!(string[])(value); break; case "copyright": this.copyright = value.get!string; break; case "license": this.license = value.get!string; break; + case "-ddoxFilterArgs": this.ddoxFilterArgs = deserializeJson!(string[])(value); break; case "dependencies": foreach( string pkg, verspec; value ) { enforce(pkg !in this.dependencies, "The dependency '"~pkg~"' is specified more than once." ); @@ -315,6 +318,7 @@ if( !this.authors.empty ) ret.authors = serializeToJson(this.authors); if( !this.copyright.empty ) ret.copyright = this.copyright; if( !this.license.empty ) ret.license = this.license; + if( !this.ddoxFilterArgs.empty ) ret["-ddoxFilterArgs"] = this.ddoxFilterArgs.serializeToJson(); if( this.dependencies ){ auto deps = Json.EmptyObject; foreach( pack, d; this.dependencies ){ diff --git a/source/dub/project.d b/source/dub/project.d index 0113d19..6c9a6de 100644 --- a/source/dub/project.d +++ b/source/dub/project.d @@ -61,10 +61,10 @@ if(!m_main) return "-Unrecognized application in '"~m_root.toNativeString()~"' (probably no package.json in this directory)"; string s = "-Application identifier: " ~ m_main.name; - s ~= "\n" ~ m_main.info(); + s ~= "\n" ~ m_main.generateInfoString(); s ~= "\n-Installed dependencies:"; foreach(p; m_dependencies) - s ~= "\n" ~ p.info(); + s ~= "\n" ~ p.generateInfoString(); return s; }