Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Fri, Feb 21, 11:00 PM

in-portal

Index: branches/5.2.x/tools/build/build_all.xml
===================================================================
--- branches/5.2.x/tools/build/build_all.xml (revision 16782)
+++ branches/5.2.x/tools/build/build_all.xml (revision 16783)
@@ -1,39 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="In-Portal (full)" default="build">
<property file="build.properties" />
<resolvepath propertyName="base.dir" file="${base.dir}"/>
<property name="scan.dir" value="${base.dir}"/>
<property name="pdepend.exclude" value="blog,build,core/editor,core/ckeditor,core/units/general/libchart,modules/mpdf,system,vendor"/>
<property name="phpcpd.exclude" value="--exclude blog --exclude build --exclude core/editor --exclude core/ckeditor --exclude core/units/general/libchart --exclude modules/mpdf --exclude system --exclude vendor"/>
<import file="targets/common.xml"/>
<target name="phpmd-ci" description="Perform project mess detection using PHPMD (creates a log file for the CI server)" depends="init">
<parallel threadCount="4">
<phingcall target="phpmd-ci-inc">
<property name="param.report.file" value="pmd_modules.xml"/>
+ <property name="param.cache.file" value="pmd_modules_result_cache.php"/>
<property name="param.include" value="${scan.dir}/modules"/>
<property name="param.exclude" value="admin_templates,mpdf"/>
</phingcall>
<phingcall target="phpmd-ci-inc">
<property name="param.report.file" value="pmd_core.xml"/>
+ <property name="param.cache.file" value="pmd_core_result_cache.php"/>
<property name="param.include" value="${scan.dir}/core"/>
<property name="param.exclude" value="admin_templates,ckeditor,editor,units/general/libchart"/>
</phingcall>
</parallel>
</target>
<fileset dir="${base.dir}" id="php.files">
<include name="**/*.php"/>
<exclude name="blog/**"/>
<exclude name="build/**"/>
<exclude name="core/editor/**"/>
<exclude name="core/ckeditor/**"/>
<exclude name="core/units/general/libchart/**"/>
<exclude name="modules/mpdf/**"/>
<exclude name="system/**"/>
<exclude name="vendor/**"/>
</fileset>
</project>
Index: branches/5.2.x/tools/build/build_custom.xml
===================================================================
--- branches/5.2.x/tools/build/build_custom.xml (revision 16782)
+++ branches/5.2.x/tools/build/build_custom.xml (revision 16783)
@@ -1,27 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="In-Portal (custom module only)" default="build">
<property file="build.properties" />
<resolvepath propertyName="base.dir" file="${base.dir}"/>
<property name="scan.dir" value="${base.dir}/modules/custom"/>
<!--TODO: update tasks, that uses "pdepend.exclude" and "phpcpd.exclude" to handle empty exclusion list-->
<property name="pdepend.exclude" value="no-match"/>
<property name="phpcpd.exclude" value="--exclude no-match"/>
<import file="targets/common.xml"/>
<target name="phpmd-ci" description="Perform project mess detection using PHPMD (creates a log file for the CI server)" depends="init">
<parallel threadCount="4">
<phingcall target="phpmd-ci-inc">
<property name="param.report.file" value="pmd_custom.xml"/>
+ <property name="param.cache.file" value="pmd_custom_result_cache.php"/>
<property name="param.include" value="${scan.dir}"/>
<property name="param.exclude" value="admin_templates"/>
</phingcall>
</parallel>
</target>
<fileset dir="${base.dir}" id="php.files">
<include name="modules/custom/**/*.php"/>
</fileset>
</project>
Index: branches/5.2.x/tools/build/targets/common.xml
===================================================================
--- branches/5.2.x/tools/build/targets/common.xml (revision 16782)
+++ branches/5.2.x/tools/build/targets/common.xml (revision 16783)
@@ -1,211 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
### Requirements
Using the template requires a range of tools packages present. They can be
installed as follows:
Install packages:
- composer global require sebastian/phpcpd:~2.0 phploc/phploc:~2.1 phpmd/phpmd:~2.2 phing/phing:~2.1 squizlabs/php_codesniffer:~2.3
+ composer global require sebastian/phpcpd:~2.0 phploc/phploc:~2.1 phpmd/phpmd:^2.14 phing/phing:~2.1 squizlabs/php_codesniffer:^3.0
Add following to the your ".bashrc" file:
export PATH="$PATH:$HOME/.composer/vendor/bin"
-->
<project name="inc_common" default="build">
<import file="targets/db.xml"/>
<import file="targets/deploy.xml"/>
<import file="targets/folders.xml"/>
<php function="ini_set">
<param value="memory_limit"/>
<param value="-1"/>
</php>
<!-- AutoLoader is needed to make PhpLoc (installed globally via Composer) work. -->
<if>
<available file="${env.HOME}/.composer/vendor/autoload.php" type="file"/>
<then>
<autoloader autoloaderpath="${env.HOME}/.composer/vendor/autoload.php"/>
</then>
</if>
<target name="build" description="Builds a project" depends="init,verify,analyze"/>
<target name="build-parallel" description="Builds a project (long targets executed in parallel)" depends="init,lint,tools-parallel,phpunit"/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">
<sequential>
<phingcall target="pdepend"/>
<phingcall target="phpmd-ci"/>
</sequential>
<phingcall target="phpcpd"/>
<phingcall target="phpcs-ci"/>
<phingcall target="phploc"/>
<phingcall target="phpdoc"/>
</parallel>
</target>
<!-- ### Verify code consistency
Make sure that our code is clean and functional. -->
<target name="verify" description="Verify code consistency" depends="init,lint"/>
<!--<target name="verify" description="Verify code consistency" depends="init,lint,phpunit"/>-->
<!-- ### Analyze code
Perform static analysis of the code to generate statistics, identify potential
problems and opportunities for refactorings and make sure that the code
complies with coding standards. -->
<target name="analyze" description="Analyze code" depends="init,phploc,phpmd-ci,phpcpd,phpcs-ci"/>
<!--<target name="analyze" description="Analyze code" depends="init,phploc,pdepend,phpmd-ci,phpcpd,phpcs-ci"/>-->
<!-- ### Generate documentation
Generate HTML documentation and code browser for the project. -->
<target name="docs" description="Generate documentation" depends="init,phpdoc" />
<!-- ### PHP linting
Check files for syntax errors. -->
<target name="lint" description="Perform syntax check of sourcecode files" depends="init">
<phplint haltonfailure="true" deprecatedAsError="false" cachefile="${build.cache.dir}/phplint.txt">
<fileset refid="php.files"/>
</phplint>
</target>
<!-- ### Generate code statistics
Measures the size of the project using
[phploc](http://sebastianbergmann.github.com/phploc/) and generates
statistics. -->
<target name="phploc" description="Measure project size using PHPLOC" depends="init">
<phploc reportType="csv" reportName="phploc" reportDirectory="${build.logs.dir}">
<fileset refid="php.files"/>
</phploc>
</target>
<target name="pdepend" description="Calculate software metrics using PHP_Depend" depends="init">
<exec executable="pdepend" passthru="true">
<arg value="--jdepend-xml=${build.logs.dir}/jdepend.xml"/>
<arg value="--jdepend-chart=${build.pdepend.dir}/dependencies.svg"/>
<arg value="--overview-pyramid=${build.pdepend.dir}/overview-pyramid.svg"/>
<arg value="--ignore=${pdepend.exclude}"/>
<arg path="${scan.dir}"/>
</exec>
</target>
<!-- ### Detect code mess
Uses [PHPMD](http://phpmd.org/) to detect code mess and look for potential
problems. -->
<target name="phpmd-ci" description="Perform project mess detection using PHPMD (creates a log file for the CI server)" depends="init">
<fail message="Please create own 'phpmd-ci' task using 'parallel' and 'phpmd-ci-inc' tasks." />
</target>
<target name="phpmd-ci-inc">
- <exec executable="phpmd" passthru="true">
+ <exec executable="phpmd" passthru="true" dir="${base.dir}">
<arg path="${param.include}"/>
<arg value="xml"/>
<arg value="${build.config.dir}/inc/phpmd.xml"/>
<arg value="--reportfile"/>
<arg value="${build.logs.dir}/${param.report.file}"/>
<arg value="--suffixes"/>
<arg value="php"/>
<arg value="--exclude"/>
<arg value="${param.exclude}"/>
+ <arg value="--cache"/>
+ <arg value="--cache-file"/>
+ <arg value="${build.cache.dir}/${param.cache.file}"/>
</exec>
</target>
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer (print human readable output)" depends="init">
<exec executable="phpcs" passthru="true">
<arg value="--standard=${vendor.dir}/aik099/coding-standard/CodingStandard"/>
<arg value="-wps"/>
+ <arg value="--cache"/>
<arg value="--encoding=UTF-8"/>
<arg value="--extensions=php"/>
<arg value="-d"/>
<arg value="memory_limit=-1"/>
<arg path="${scan.dir}"/>
</exec>
</target>
<target name="phpcbf" description="Fixes coding standard violations using PHP_CodeSniffer" depends="init">
<exec executable="phpcbf" passthru="true">
<arg value="--standard=${vendor.dir}/aik099/coding-standard/CodingStandard"/>
<arg value="-wps"/>
<arg value="--encoding=UTF-8"/>
<arg value="--extensions=php"/>
<arg value="-d"/>
<arg value="memory_limit=-1"/>
<arg path="${scan.dir}"/>
</exec>
</target>
<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer (creates a log file for the CI server)" depends="init">
<exec executable="phpcs" passthru="true">
<arg value="--report=checkstyle"/>
<arg value="--report-file=${build.logs.dir}/checkstyle.xml"/>
<arg value="--standard=${vendor.dir}/aik099/coding-standard/CodingStandard"/>
<arg value="-wp"/>
+ <arg value="--cache"/>
<arg value="--encoding=UTF-8"/>
<arg value="--extensions=php"/>
<arg value="-d"/>
<arg value="memory_limit=-1"/>
<arg path="${scan.dir}"/>
</exec>
</target>
<!-- ### Detect potential copy/pasting
Uses [phpcpd](https://github.com/sebastianbergmann/phpcpd) to detect duplicate
code. This indicates potential refactorings.-->
<target name="phpcpd" description="Find duplicate code using PHPCPD" depends="init">
<exec command="which phpcpd" outputProperty="phpcpd_binary"/>
<exec executable="php" passthru="true">
<arg value="-d memory_limit=-1"/>
<arg value="${phpcpd_binary}"/>
<arg value="--log-pmd=${build.logs.dir}/pmd-cpd.xml"/>
<arg value="--progress"/>
<arg line="--names-exclude=*_config.php ${phpcpd.exclude}"/>
<arg path="${scan.dir}"/>
</exec>
</target>
<!-- ### Generate documentation -->
<!-- #### Generate API Documentation
Uses [phpDocumentor](http://www.phpdoc.org/) to generate documentation. -->
<target name="phpdoc" description="Generate API documentation using phpdoc" depends="init">
<phpdoc2 title="API Documentation" destdir="${build.api.dir}" template="responsive" quiet="true">
<fileset refid="php.files"/>
</phpdoc2>
</target>
<target name="phpunit" description="Run tests with PHPUnit" depends="init">
<exec executable="phpunit" logoutput="true" checkreturn="true">
<arg value="--configuration"/>
<arg path="${build.config.dir}/phpunit.xml"/>
<arg value="--testsuite"/>
<arg value="custom"/>
</exec>
</target>
<target name="init" depends="create-aliases,folders-create,deploy-ci" description="Prepare for build">
</target>
<target name="create-aliases" description="Creating directory aliases" hidden="true">
<property name="pdo.dsn.without.db" value="mysql:host=${db.host}"/>
<property name="pdo.dsn" value="${pdo.dsn.without.db};dbname=${db.name}"/>
- <property name="build.config.dir" value="."/>
+ <property name="build.config.dir" value="${base.dir}/tools/build"/>
<property name="build.dir" value="${base.dir}/build"/>
<!--<property name="build.api.dir" value="${build.dir}/api"/>-->
<!--<property name="build.coverage.dir" value="${build.dir}/coverage"/>-->
<property name="build.logs.dir" value="${build.dir}/logs"/>
<property name="build.cache.dir" value="${build.dir}/cache"/>
<!--<property name="build.pdepend.dir" value="${build.dir}/pdepend"/>-->
<property name="vendor.dir" value="${base.dir}/vendor"/>
</target>
</project>

Event Timeline