Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more generic build scripts

  • Loading branch information...
commit 16c23037e90a5aae2fdee4b2ec999892b35802e0 1 parent 59266fe
@marcelog authored
Showing with 32 additions and 22 deletions.
  1. +13 −10 build.properties
  2. +0 −1  build.xml
  3. +19 −11 resources/generatePackageXml.php
View
23 build.properties
@@ -1,7 +1,10 @@
version=none
+name=PAGI
+summary="PHP AGI ( Asterisk Gateway Interface ) facade"
+description="CDR ( Call Detail Record ), Call spool and schedule auto dial, Send and Receive Fax, Channel Variables, and Caller ID management"
dir.output=${project.basedir}/build
dir.tmp=${dir.output}/tmp
-dir.src=${project.basedir}/src/mg/PAGI
+dir.src=${project.basedir}/src/mg/${name}
dir.vendor=${project.basedir}/vendor
dir.vendor.bin=${dir.vendor}/bin
dir.vendor.php=${dir.vendor}/php
@@ -24,7 +27,7 @@ phpdepend.output.html.file=${phpdepend.output.html.dir}/index.html
phpdepend.output.xml.dir=${phpdepend.output}
phpdepend.output.xml.file=${phpdepend.output.xml.dir}/php-depend.xml
phpdepend.style=resources/pdepend.xsl
-phpdepend.args=--jdepend-xml=${phpdepend.output.xml.file} --jdepend-chart=${phpdepend.output.html.dir}/pdepend.svg --ignore=.git,test/ --overview-pyramid=${phpdepend.output.html.dir}/pyramid.svg src/mg/PAGI
+phpdepend.args=--jdepend-xml=${phpdepend.output.xml.file} --jdepend-chart=${phpdepend.output.html.dir}/pdepend.svg --ignore=.git,test/ --overview-pyramid=${phpdepend.output.html.dir}/pyramid.svg ${dir.src}
phpcs.exec=${php.exec} ${dir.vendor.bin}/phpcs
phpcs.output=${dir.output}/php-cs
@@ -33,7 +36,7 @@ phpcs.output.html.file=${phpcs.output.html.dir}/index.html
phpcs.output.xml.dir=${phpcs.output}
phpcs.output.xml.file=${phpcs.output.xml.dir}/php-cs.xml
phpcs.style=resources/checkstyle.xsl
-phpcs.args=--report=checkstyle --report-file=${phpcs.output.xml.file} --standard=PEAR --extensions=php --ignore=.git/,doc/,resources/,build src/mg/PAGI
+phpcs.args=--report=checkstyle --report-file=${phpcs.output.xml.file} --standard=PEAR --extensions=php --ignore=.git/,doc/,resources/,build ${dir.src}
junit.output.xml.dir=${phpunit.output}
junit.output.xml.file=${junit.output.xml.dir}/junit.xml
@@ -52,7 +55,7 @@ phpmd.output.html.file=${phpmd.output.html.dir}/index.html
phpmd.output.xml.dir=${phpmd.output}
phpmd.output.xml.file=${phpmd.output.xml.dir}/php-md.xml
phpmd.style=resources/pmd.xslt
-phpmd.args=src/mg/PAGI xml rulesets/codesize.xml,rulesets/unusedcode.xml,rulesets/naming.xml --extensions php --reportfile ${phpmd.output.xml.file}
+phpmd.args=${dir.src} xml rulesets/codesize.xml,rulesets/unusedcode.xml,rulesets/naming.xml --extensions php --reportfile ${phpmd.output.xml.file}
phpcpd.exec=${php.exec} ${dir.vendor.bin}/phpcpd
phpcpd.output=${dir.output}/php-cpd
@@ -61,23 +64,23 @@ phpcpd.output.html.file=${phpcpd.output.html.dir}/index.html
phpcpd.output.xml.dir=${phpcpd.output}
phpcpd.output.xml.file=${phpcpd.output.xml.dir}/php-cpd.xml
phpcpd.style=resources/cpd.xslt
-phpcpd.args=--log-pmd ${phpcpd.output.xml.file} --verbose src/mg/PAGI
+phpcpd.args=--log-pmd ${phpcpd.output.xml.file} --verbose ${dir.src}
phpdoc.exec=${php.exec} ${dir.vendor.bin}/docblox
phpdoc.output=${dir.output}/php-doc
phpdoc.output.html.dir=${phpdoc.output}/html
-phpdoc.args=-d ${dir.src} -t ${phpdoc.output.html.dir} --sourcecode --visibility public,protected,private --parseprivate --title "PAGI Asterisk Gateway Interface PHP Client"
+phpdoc.args=-d ${dir.src} -t ${phpdoc.output.html.dir} --sourcecode --visibility public,protected,private --parseprivate --title ${summary}
phploc.exec=${php.exec} ${dir.vendor.bin}/phploc
phploc.output=${dir.output}/php-loc
phploc.output.html.dir=${phploc.output}/html
phploc.output.html.file=${phploc.output.html.dir}/phploc.txt
-phploc.args=src/mg/PAGI
+phploc.args=${dir.src}
-phar=PAGI-${version}.phar
+phar=${name}-${version}.phar
genphar.exec=${php.exec} resources/generatePhar.php
genphar.args=${package.output.dir}/${phar} ${project.basedir}/src/mg
-peartgz=PAGI-${version}.tgz
+peartgz=${name}-${version}.tgz
-genpear.exec=${php.exec} resources/generatePackageXml.php ${version}
+genpear.exec=${php.exec} resources/generatePackageXml.php ${name} ${summary} ${description} ${version}
View
1  build.xml
@@ -108,7 +108,6 @@
<mkdir dir="${phpdoc.output.html.dir}"/>
<exec
command="${phpdoc.exec} ${phpdoc.args}"
- dir="${project.basedir}/src/mg/PAGI"
passthru="true"
/>
</target>
View
30 resources/generatePackageXml.php
@@ -1,9 +1,18 @@
+<?php
+$name = $argv[1];
+$summary = $argv[2];
+$description = $argv[3];
+$version = $argv[4];
+$src = realpath(__DIR__ . "/../src/mg/$name");
+$installPath = "/$name";
+
+?>
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
- <name>PAGI</name>
+ <name><?php echo $name; ?></name>
<channel>pear.marcelog.name</channel>
- <summary>PHP AGI ( Asterisk Gateway Interface ) facade</summary>
- <description>CDR ( Call Detail Record ), Call spool and schedule auto dial, Send and Receive Fax, Channel Variables, and Caller ID management</description>
+ <summary><?php echo $summary; ?></summary>
+ <description><?php echo $description; ?></description>
<lead>
<name>Marcelo Gornstein</name>
<user>marcelog</user>
@@ -13,24 +22,23 @@
<date><?php echo date('Y-m-d'); ?></date>
<time><?php echo date('H:m:i'); ?></time>
<version>
- <release><?php echo $argv[1]; ?></release>
- <api><?php echo $argv[1]; ?></api>
+ <release><?php echo $version; ?></release>
+ <api><?php echo $version; ?></api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.apache.org/licenses/">Apache</license>
- <notes>
-Supports bean inheritance, via normal OOP and explicit definitions in xml/yaml. Can apply global aspects to parent classes.
- </notes>
+ <notes>None</notes>
<contents>
- <dir baseinstalldir="/PAGI" name="<?php echo realpath(__DIR__ . '/../src/mg/PAGI'); ?>/">
+ <dir baseinstalldir="<?php echo $installPath; ?>" name="<?php echo $src; ?>/">
<?php
function dumpFileInfo($realPath, $pearPath) {
+ global $installPath;
?>
-<file baseinstalldir="/PAGI" md5sum="<?php echo md5_file($realPath); ?>" name="<?php echo $pearPath; ?>" role="php" />
+<file baseinstalldir="<?php echo $installPath; ?>" md5sum="<?php echo md5_file($realPath); ?>" name="<?php echo $pearPath; ?>" role="php" />
<?php
}
@@ -52,7 +60,7 @@ function generateFileInfo($realPath, $pearPath) {
}
}
}
-generateFileInfo(realpath(__DIR__ . '/../src/mg/PAGI'), '');
+generateFileInfo($src, '');
?>
</dir>
</contents>
Please sign in to comment.
Something went wrong with that request. Please try again.