Skip to content

Commit

Permalink
Changed documentation tool to "Sami" -> Requird some modification in …
Browse files Browse the repository at this point in the history
…the build scripts
  • Loading branch information
ruff committed Nov 21, 2020
1 parent eb3ae9b commit f145ddd
Show file tree
Hide file tree
Showing 130 changed files with 59,971 additions and 236,249 deletions.
73 changes: 31 additions & 42 deletions build.ant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- By default the tools are managed by Composer in ${basedir}/vendor/bin -->
<property name="url.composer.download" value="https://getcomposer.org/download/1.10.13/composer.phar"/>
<property name="url.phpdox.download" value="http://phpdox.de/releases/phpdox.phar"/>
<property name="url.phpdocumentator.download" value="https://phpdoc.org/phpDocumentor.phar"/>
<property name="url.sami.download" value="http://get.sensiolabs.org/sami.phar"/>
<property name="composer" value="${basedir}/composer.phar"/>
<property name="pdepend" value="${basedir}/vendor/bin/pdepend"/>
<property name="phpcpd" value="${basedir}/vendor/bin/phpcpd"/>
Expand All @@ -12,7 +12,7 @@
<property name="phploc" value="${basedir}/vendor/bin/phploc"/>
<property name="phpmd" value="${basedir}/vendor/bin/phpmd"/>
<property name="phpunit" value="${basedir}/vendor/bin/phpunit"/>
<property name="phpdocumentator" value="${basedir}/phpDocumentor.phar"/>
<property name="sami" value="${basedir}/sami.phar"/>
<property name="git" value="/usr/bin/git"/>
<target name="clean" unless="clean.done" description="Cleanup build artifacts.">
<delete dir="${basedir}/build/builddoc"/>
Expand Down Expand Up @@ -49,11 +49,11 @@
<arg value="${phpdox}"/>
</exec>
</target>
<target name="downloadphpdocumentator" description="Install phpdocumentator.">
<get src="${url.phpdocumentator.download}" dest="${phpdocumentator}"/>
<target name="downloadsami" description="Install Sami.">
<get src="${url.sami.download}" dest="${sami}"/>
<exec executable="chmod">
<arg value="+x"/>
<arg path="${phpdocumentator}"/>
<arg path="${sami}"/>
</exec>
</target>
<target name="full-build" depends="prepare,composer,static-analysis,phpunit,phpdox,-check-failure,projectdoc,deploy" description="Perform static analysis, run tests, and generate project documentation.">
Expand Down Expand Up @@ -220,23 +220,17 @@
</fail>
<echo message="Checked failure"/>
</target>
<target name="projectdoc" depends="prepare,downloadphpdocumentator" description="Generator project documentation using phpdocumentator.">
<target name="projectdoc" depends="prepare,downloadsami" description="Generator project documentation using Sami.">
<exec executable="php" taskname="projectdoc">
<arg path="${phpdocumentator}"/>
<arg value="-d"/>
<arg path="${basedir}/src"/>
<arg value="-t"/>
<arg path="${basedir}/build/doc"/>
<arg value="-i"/>
<arg path="${basedir}/src/entities/"/>
<arg value="-i"/>
<arg path="${basedir}/src/ZugferdObjectHelper.php"/>
<arg value="-m"/>
<arg path="TODO"/>
<arg value="--title=horstoeko/zugferd"/>
<arg value="--visibility=public"/>
<arg value="--sourcecode"/>
<arg path="${sami}"/>
<arg value="update"/>
<arg path="${basedir}/build/sami.config.php"/>
</exec>
<delete file="${basedir}/build/doc/PROJECT_VERSION"/>
<delete file="${basedir}/build/doc/SAMI_VERSION"/>
<delete file="${basedir}/build/doc/renderer.index"/>
<delete file="${basedir}/build/doc/opensearch.xml"/>
<delete dir="${basedir}/build/cache"/>
<property name="projectdoc.done" value="true"/>
</target>
<target name="deploy" description="Deplay build">
Expand Down Expand Up @@ -284,34 +278,29 @@
-->
</target>
<target name="projectdocstandalone" description="Generator project documentation using phpdocumentator.">
<delete dir="${project.basedir}/doc"/>
<mkdir dir="${project.basedir}/doc"/>
<delete dir="${basedir}/cache"/>
<delete dir="${basedir}/doc"/>
<mkdir dir="${basedir}/cache"/>
<mkdir dir="${basedir}/doc"/>
<exec executable="wget">
<arg path="${url.phpdocumentator.download}"/>
<arg path="${url.sami.download}"/>
<arg value="-O"/>
<arg path="${basedir}/phpDocumentor.phar"/>
<arg path="${sami}"/>
</exec>
<exec executable="chmod">
<arg value="+x"/>
<arg path="${basedir}/phpDocumentor.phar"/>
<arg path="${sami}"/>
</exec>
<exec executable="php" taskname="projectdoc">
<arg path="${phpdocumentator}"/>
<arg value="-d"/>
<arg path="./src"/>
<arg value="-t"/>
<arg path="./doc"/>
<arg value="-i"/>
<arg path="./src/entities/"/>
<arg value="-i"/>
<arg path="./src/ZugferdObjectHelper.php"/>
<arg value="-m"/>
<arg path="TODO"/>
<arg value="--title=horstoeko/zugferd"/>
<arg value="--visibility=public"/>
<arg value="--sourcecode"/>
<exec executable="php">
<arg path="${sami}"/>
<arg value="update"/>
<arg path="${basedir}/build/sami.config.deploy.php"/>
</exec>
<delete file="${phpdocumentator}"/>
<delete dir="${basedir}/.phpdoc"/>
<delete file="${sami}"/>
<delete file="${basedir}/doc/PROJECT_VERSION"/>
<delete file="${basedir}/doc/SAMI_VERSION"/>
<delete file="${basedir}/doc/renderer.index"/>
<delete file="${basedir}/doc/opensearch.xml"/>
<delete dir="${basedir}/cache"/>
</target>
</project>
73 changes: 32 additions & 41 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- By default the tools are managed by Composer in ${project.basedir}/vendor/bin -->
<property name="url.composer.download" value="https://getcomposer.org/download/1.10.13/composer.phar"/>
<property name="url.phpdox.download" value="http://phpdox.de/releases/phpdox.phar"/>
<property name="url.phpdocumentator.download" value="https://phpdoc.org/phpDocumentor.phar"/>
<property name="url.sami.download" value="http://get.sensiolabs.org/sami.phar"/>
<property name="composer" value="${project.basedir}/composer.phar"/>
<property name="pdepend" value="${project.basedir}/vendor/bin/pdepend"/>
<property name="phpcpd" value="${project.basedir}/vendor/bin/phpcpd"/>
Expand All @@ -12,10 +12,11 @@
<property name="phploc" value="${project.basedir}/vendor/bin/phploc"/>
<property name="phpmd" value="${project.basedir}/vendor/bin/phpmd"/>
<property name="phpunit" value="${project.basedir}/vendor/bin/phpunit"/>
<property name="phpdocumentator" value="${project.basedir}/phpDocumentor.phar"/>
<property name="sami" value="${project.basedir}/sami.phar"/>
<property name="git" value="/usr/bin/git"/>
<target name="clean" unless="clean.done" description="Cleanup build artifacts.">
<delete dir="${project.basedir}/build/builddoc"/>
<delete dir="${project.basedir}/build/cache"/>
<delete dir="${project.basedir}/build/doc"/>
<delete dir="${project.basedir}/build/coverage"/>
<delete dir="${project.basedir}/build/logs"/>
Expand Down Expand Up @@ -57,15 +58,15 @@
<arg path="${phpdox}"/>
</exec>
</target>
<target name="downloadphpdocumentator" description="Install phpdocumentator.">
<target name="downloadsami" description="Install Sami.">
<exec executable="wget">
<arg path="${url.phpdocumentator.download}"/>
<arg path="${url.sami.download}"/>
<arg value="-O"/>
<arg path="${phpdocumentator}"/>
<arg path="${sami}"/>
</exec>
<exec executable="chmod">
<arg value="+x"/>
<arg path="${phpdocumentator}"/>
<arg path="${sami}"/>
</exec>
</target>
<target name="full-build" depends="prepare,composer,static-analysis,phpunit,phpdox,-check-failure,projectdoc,deploy" description="Perform static analysis, run tests, and generate project documentation.">
Expand Down Expand Up @@ -208,6 +209,7 @@
</target>
<target name="prepare" unless="prepare.done" depends="clean" description="Prepare for build.">
<mkdir dir="${project.basedir}/build/builddoc"/>
<mkdir dir="${project.basedir}/build/cache"/>
<mkdir dir="${project.basedir}/build/doc"/>
<mkdir dir="${project.basedir}/build/coverage"/>
<mkdir dir="${project.basedir}/build/logs"/>
Expand All @@ -232,23 +234,17 @@
</fail>
<echo message="Checked failure"/>
</target>
<target name="projectdoc" depends="prepare,downloadphpdocumentator" description="Generator project documentation using phpdocumentator.">
<target name="projectdoc" depends="prepare,downloadsami" description="Generator project documentation using sami.">
<exec executable="php" taskname="projectdoc">
<arg path="${phpdocumentator}"/>
<arg value="-d"/>
<arg path="${project.basedir}/src"/>
<arg value="-t"/>
<arg path="${project.basedir}/build/doc"/>
<arg value="-i"/>
<arg path="${project.basedir}/src/entities/"/>
<arg value="-i"/>
<arg path="${project.basedir}/src/ZugferdObjectHelper.php"/>
<arg value="-m"/>
<arg path="TODO"/>
<arg value="--title=horstoeko/zugferd"/>
<arg value="--visibility=public"/>
<arg value="--sourcecode"/>
<arg path="${sami}"/>
<arg value="update"/>
<arg path="${project.basedir}/build/sami.config.php"/>
</exec>
<delete file="${project.basedir}/build/doc/PROJECT_VERSION"/>
<delete file="${project.basedir}/build/doc/SAMI_VERSION"/>
<delete file="${project.basedir}/build/doc/renderer.index"/>
<delete file="${project.basedir}/build/doc/opensearch.xml"/>
<delete dir="${project.basedir}/build/cache"/>
<property name="projectdoc.done" value="true"/>
</target>
<target name="deploy" description="Deplay build">
Expand Down Expand Up @@ -295,35 +291,30 @@
</exec>
-->
</target>
<target name="projectdocstandalone" description="Generator project documentation using phpdocumentator.">
<target name="projectdocstandalone" description="Generator project documentation using sami.">
<delete dir="${project.basedir}/cache"/>
<delete dir="${project.basedir}/doc"/>
<mkdir dir="${project.basedir}/cache"/>
<mkdir dir="${project.basedir}/doc"/>
<exec executable="wget">
<arg path="${url.phpdocumentator.download}"/>
<arg path="${url.sami.download}"/>
<arg value="-O"/>
<arg path="${project.basedir}/phpDocumentor.phar"/>
<arg path="${sami}"/>
</exec>
<exec executable="chmod">
<arg value="+x"/>
<arg path="${project.basedir}/phpDocumentor.phar"/>
<arg path="${sami}"/>
</exec>
<exec executable="php" taskname="projectdoc">
<arg path="${phpdocumentator}"/>
<arg value="-d"/>
<arg path="./src"/>
<arg value="-t"/>
<arg path="./doc"/>
<arg value="-i"/>
<arg path="./src/entities/"/>
<arg value="-i"/>
<arg path="./src/ZugferdObjectHelper.php"/>
<arg value="-m"/>
<arg path="TODO"/>
<arg value="--title=horstoeko/zugferd"/>
<arg value="--visibility=public"/>
<arg value="--sourcecode"/>
<arg path="${sami}"/>
<arg value="update"/>
<arg path="${project.basedir}/build/sami.config.deploy.php"/>
</exec>
<delete file="${phpdocumentator}"/>
<delete dir="${project.basedir}/.phpdoc"/>
<delete file="${sami}"/>
<delete file="${project.basedir}/doc/PROJECT_VERSION"/>
<delete file="${project.basedir}/doc/SAMI_VERSION"/>
<delete file="${project.basedir}/doc/renderer.index"/>
<delete file="${project.basedir}/doc/opensearch.xml"/>
<delete dir="${project.basedir}/cache"/>
</target>
</project>
19 changes: 19 additions & 0 deletions build/sami.config.deploy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use Sami\Sami;
use Sami\RemoteRepository\GitHubRemoteRepository;
use Sami\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;

$iterator = Finder::create()
->files()
->name('*.php')
->exclude('entities')
->in($dir = dirname(__FILE__) . '/../src');

return new Sami($iterator, array(
'title' => 'horstoeko/zugferd API',
'build_dir' => dirname(__FILE__) . '/../doc',
'cache_dir' => dirname(__FILE__) . '/../cache',
'include_parent_data' => false,
));
19 changes: 19 additions & 0 deletions build/sami.config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use Sami\Sami;
use Sami\RemoteRepository\GitHubRemoteRepository;
use Sami\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;

$iterator = Finder::create()
->files()
->name('*.php')
->exclude('entities')
->in($dir = dirname(__FILE__) . '/../src');

return new Sami($iterator, array(
'title' => 'horstoeko/zugferd API',
'build_dir' => dirname(__FILE__) . '/doc',
'cache_dir' => dirname(__FILE__) . '/cache',
'include_parent_data' => false,
));
Loading

0 comments on commit f145ddd

Please sign in to comment.