@author Gaetano Giunta
@copyright (c) 2007-2015 G. Giunta
@license code licensed under the BSD License
- @todo make the xsl more dynamic: the path to import docbook.xsl could be f.e. rewritten/injected by the php user
-->
<!-- import base stylesheet. This assumes the 'workspace' dir is next to the 'tools' one -->
-<xsl:import href="../../../../tools/vendor/docbook/docbook-xsl/fo/docbook.xsl"/>
+<xsl:import href="%docbook.xsl%"/>
<!-- customization vars -->
throw new \Exception("File $xssFile cannot be found");
}
+ $docbookXslPath = realpath(Builder::buildDir().'/tools/vendor/docbook/docbook-xsl/fo/docbook.xsl');
+ file_put_contents(
+ $xssFile,
+ str_replace('%docbook.xsl%', $docbookXslPath, file_get_contents($xssFile))
+ );
+
// Load the XML source
$xml = new \DOMDocument();
$xml->load($inFile);
echo "\n";
echo " Task options:\n";
echo " --repo=REPO URL of the source repository to clone. Defaults to the github repo.\n";
- echo " --branch=BRANCH The git branch to build from.\n";
+ echo " --branch=BRANCH The git branch to build from. Defaults to master\n";
+ echo " --workspace=DIR The dir where to check out source code. Defaults to build/workspace\n";
echo " --asciidoctor=ASCIIDOCTOR Location of the asciidoctor command-line tool\n";
echo " --fop=FOP Location of the apache fop command-line tool\n";
echo " --php=PHP Location of the php command-line interpreter\n";
/**
* Downloads source code in the build workspace directory, optionally checking out the given branch/tag
- * @todo allow using current installation as source, bypassing git clone in workspace - at least for doc generation
+ * @todo allow using current installation / dir as source, bypassing git clone in workspace - at least for doc generation
*/
function run_init($task=null, $args=array(), $cliOpts=array())
{
throw new Exception("Directory '$targetDir' exists and is not linked to correct git repo");
}
- /// @todo should we not just fetch instead?
+ /// @todo we should just fetch if we are checking out a tag, but pull if we are checking out a branch...
$repo->pull();
} else {
pake_mkdirs(dirname($targetDir));
function run_clean_workspace($task=null, $args=array(), $cliOpts=array())
{
+ if (realpath(__DIR__) === realpath(Builder::workspaceDir())) {
+ throw new \Exception("Can not remove workspace dir, as it is where pakefile is located!");
+ }
pake_remove_dir(Builder::workspaceDir());
}