wip revive and split off doc generatin toolchain
authorgggeek <giunta.gaetano@gmail.com>
Sun, 12 Dec 2021 18:58:41 +0000 (18:58 +0000)
committergggeek <giunta.gaetano@gmail.com>
Sun, 12 Dec 2021 18:58:41 +0000 (18:58 +0000)
composer.json
doc/build/composer.json [new file with mode: 0644]
pakefile.php
tests/ci/setup/install_packages.sh
tests/parse_args.php
tests/phpunit_coverage.php

index 9fd5985..3a241a5 100644 (file)
         "yoast/phpunit-polyfills": "*",
         "ext-curl": "*",
         "ext-dom": "*",
-        "ext-mbstring": "*",
-        "ext-xsl": "*",
-        "indeyets/pake": "^1.99",
-        "docbook/docbook-xsl": "^1.79"
+        "ext-mbstring": "*"
     },
     "suggest": {
         "ext-curl": "Needed for HTTPS and HTTP 1.1 support, NTLM Auth etc...",
         "ext-zlib": "Needed for sending compressed requests and receiving compressed responses, if cURL is not available",
         "ext-mbstring": "Needed to allow reception of requests/responses in character sets other than ASCII,LATIN-1,UTF-8",
         "phpxmlrpc/extras": "Adds more featured Server classes and other useful bits",
-        "phpxmlrpc/jsonrpc": "Adds support for the JSON-RPC protocol",
-        "sami/sami": "Required for doc generation using pake. Version constraints: ^3.3 || ^4.1"
+        "phpxmlrpc/jsonrpc": "Adds support for the JSON-RPC protocol"
     },
     "_comment::conflict": "Within the extras package, only the XMLRPC extension emulation is not compatible... the JSONRPC part should be ok. Both have been moved to different packages anyway",
     "conflict": {
     },
     "autoload": {
         "psr-4": {"PhpXmlRpc\\": "src/"}
-    },
-    "config": {
-        "secure-http": false
-    },
-    "repositories": [
-        {
-            "type": "package",
-            "package": {
-                "name": "docbook/docbook-xsl",
-                "version": "1.79.1",
-                "dist": {
-                    "url": "https://sourceforge.net/projects/docbook/files/docbook-xsl/1.79.1/docbook-xsl-1.79.1.zip/download",
-                    "type": "zip"
-                }
-            }
-        }
-    ]
+    }
 }
diff --git a/doc/build/composer.json b/doc/build/composer.json
new file mode 100644 (file)
index 0000000..f2275fc
--- /dev/null
@@ -0,0 +1,26 @@
+{
+    "name": "phpxmlrpc/phpxmlrpc-doc-toolchain",
+    "require-dev": {
+        "php": "^5.3.0 || ^7.0 || ^8.0",
+        "ext-xsl": "*",
+        "indeyets/pake": "^1.99",
+        "docbook/docbook-xsl": "^1.79",
+        "sami/sami": "^3.3 || ^4.1"
+    },
+    "config": {
+        "secure-http": false
+    },
+    "repositories": [
+        {
+            "type": "package",
+            "package": {
+                "name": "docbook/docbook-xsl",
+                "version": "1.79.1",
+                "dist": {
+                    "url": "https://sourceforge.net/projects/docbook/files/docbook-xsl/1.79.1/docbook-xsl-1.79.1.zip/download",
+                    "type": "zip"
+                }
+            }
+        }
+    ]
+}
index ef2f31a..956cc66 100644 (file)
@@ -3,7 +3,7 @@
  * Makefile for phpxmlrpc library.
  * To be used with the Pake tool: https://github.com/indeyets/pake/wiki
  *
- * @copyright (c) 2015-2020 G. Giunta
+ * @copyright (c) 2015-2021 G. Giunta
  *
  * @todo !important allow user to specify location of docbook xslt instead of the one installed via composer
  */
@@ -42,6 +42,11 @@ class Builder
         return self::buildDir().'/workspace';
     }
 
+    public static function toolsDir()
+    {
+        return self::buildDir().'/tools';
+    }
+
     /// most likely things will break if this one is moved outside of BuildDir
     public static function distDir()
     {
@@ -104,7 +109,6 @@ class Builder
      */
     public static function applyXslt($inFile, $xssFile, $outFileOrDir)
     {
-
         if (!file_exists($inFile)) {
             throw new \Exception("File $inFile cannot be found");
         }
@@ -256,9 +260,11 @@ function run_doc($task=null, $args=array(), $cliOpts=array())
 
     // API docs
 
+    /// @todo sami is anbandonware, whereas phpdocumentor is not. switch back to phpdocumentor
+
     // 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');
+    //pake_sh("$cmd " . Builder::toolsDir(). "/vendor/bin/phpdoc run -d ".Builder::workspaceDir().'/src'." -t ".Builder::workspaceDir().'/doc/api --title PHP-XMLRPC');
 
     // from phpdoc comments using Sami
     $samiConfig = <<<EOT
@@ -278,7 +284,7 @@ function run_doc($task=null, $args=array(), $cliOpts=array())
 EOT;
     file_put_contents('build/sami_config.php', $samiConfig);
     $cmd = Builder::tool('php');
-    pake_sh("$cmd vendor/sami/sami/sami.php update -vvv build/sami_config.php");
+    pake_sh("$cmd " . Builder::toolsDir(). "/vendor/bin/sami.php update -vvv build/sami_config.php");
 
     // User Manual
 
index 9775818..b22f398 100755 (executable)
@@ -5,4 +5,4 @@
 set -e
 
 DEBIAN_FRONTEND=noninteractive apt-get install -y \
-    lsb-release sudo unzip wget zip
+    lsb-release sudo wget
index 6f22c94..712fa99 100644 (file)
@@ -13,7 +13,7 @@
  * @param int     SSLVERSION
  * @param string  PROXYSERVER
  *
- * @copyright (C) 2007-2020 G. Giunta
+ * @copyright (C) 2007-2021 G. Giunta
  * @license code licensed under the BSD License: see file license.txt
  *
  * @todo rename both the class and the file. PhpXmlRpc_TestArgParser ?
index 37c05d9..eafe0e8 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Used to serve back the server-side code coverage results to phpunit-selenium
  *
- * @copyright (C) 2007-2020 G. Giunta
+ * @copyright (C) 2007-2021 G. Giunta
  * @license code licensed under the BSD License: see file license.txt
  **/