From 20660a70da36b42df4a80dd3aa282fda4439688b Mon Sep 17 00:00:00 2001 From: gggeek Date: Sun, 24 Jan 2016 23:17:46 +0000 Subject: [PATCH] Move to using Sami for API doc generation instead of PhpDocumentor --- composer.json | 2 +- pakefile.php | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 58c3d40..3a1f028 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "ext-curl": "*", "ext-mbstring": "*", "indeyets/pake": "~1.99", - "phpdocumentor/phpdocumentor": "2.*", + "sami/sami": "~3.1", "docbook/docbook-xsl": "~1.78" }, "suggest": { diff --git a/pakefile.php b/pakefile.php index fc2633b..4bca828 100644 --- a/pakefile.php +++ b/pakefile.php @@ -257,8 +257,28 @@ function run_doc($task=null, $args=array(), $cliOpts=array()) // API docs // from phpdoc comments using phpdocumentor + //$cmd = Builder::tool('php'); + //pake_sh("$cmd vendor/phpdocumentor/phpdocumentor/bin/phpdoc run -d ".Builder::workspaceDir().'/src'." -t ".Builder::workspaceDir().'/doc/api --title PHP-XMLRPC'); + + // from phpdoc comments using Sami + $samiConfig = <<files() + ->exclude('debugger') + ->exclude('demo') + ->exclude('doc') + ->exclude('tests') + ->in('./build/workspace'); + return new Sami\Sami(\$iterator, array( + 'title' => 'PHP-XMLRPC', + 'build_dir' => 'build/workspace/doc/api', + 'cache_dir' => 'build/cache', + )); +EOT; + file_put_contents('build/sami_config.php', $samiConfig); $cmd = Builder::tool('php'); - pake_sh("$cmd vendor/phpdocumentor/phpdocumentor/bin/phpdoc run -d ".Builder::workspaceDir().'/src'." -t ".Builder::workspaceDir().'/doc/api --title PHP-XMLRPC'); + pake_sh("$cmd vendor/sami/sami/sami.php update -vvv build/sami_config.php"); // User Manual @@ -269,7 +289,7 @@ function run_doc($task=null, $args=array(), $cliOpts=array()) // then docbook from asciidoc /// @todo create phpxmlrpc_manual.xml with the good version number /// @todo create phpxmlrpc_manual.xml with the date set to the one of last commit (or today?) - pake_sh("$cmd -d book -b docbook $docDir/manual/phpxmlrpc_manual.adoc"); + pake_sh("$cmd -d book -b docbook $docDir/manual/phpxmlrpc_manual.adoc"); # Other tools for docbook... # -- 2.43.0