mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-27 10:00:41 +00:00
354 lines
16 KiB
XML
354 lines
16 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project name="seeddms" basedir="." default="main">
|
|
<property name="tmp" value="/tmp" />
|
|
<property name="package" value="${phing.project.name}" override="true" />
|
|
<property name="seeddmsurl" value="http://localhost/seeddms51x" />
|
|
<property name="builddir" value="${tmp}/build/${phing.project.name}" override="true" />
|
|
<property name="srcdir" value="${project.basedir}" override="true" />
|
|
<property name="datadir" value="" override="true" />
|
|
<property name="dbtype" value="sqlite" override="true" />
|
|
<property name="dbhost" value="" override="true" />
|
|
<property name="dbuser" value="" override="true" />
|
|
<property name="dbpass" value="" override="true" />
|
|
<property name="dbname" value="" override="true" />
|
|
<property name="version" value="-" />
|
|
<property name="shortversion" value="${version}" />
|
|
<propertyregex property="shortversion" subject="${version} kk" pattern="([56])\.([0-9]).*" replace="seeddms$1$2x" override="true"/>
|
|
<property name="majorversion" value="${version}" />
|
|
<propertyregex property="majorversion" subject="${version}" pattern="([56])\..*" replace="$1" override="true"/>
|
|
<property name="minorversion" value="${version}" />
|
|
<propertyregex property="minorversion" subject="${version}" pattern="[56]\.([0-9])\..*" replace="$1" override="true"/>
|
|
<property name="subminorversion" value="${version}" />
|
|
<propertyregex property="subminorversion" subject="${version}" pattern="[56]\.[0-9]\.(.*)" replace="$1" override="true"/>
|
|
<property name="composer_version" value="2.8.5" />
|
|
<property name="composer_extra_params" value="" />
|
|
<property name="composer_env" value="" />
|
|
<property name="mink_driver" value="chrome" />
|
|
<property name="snooze_multiplier" value="1" />
|
|
|
|
<fileset id="distfiles" dir=".">
|
|
<include name="languages/**" />
|
|
<include name="op/**" />
|
|
<include name="out/**" />
|
|
<include name="inc/**" />
|
|
<include name="controllers/**" />
|
|
<include name="styles/**" />
|
|
<include name="views/bootstrap*/**" />
|
|
<include name="utils/**" />
|
|
<include name="doc/**" />
|
|
<include name="webdav/**" />
|
|
<include name="install/**" />
|
|
<include name="restapi/**" />
|
|
<include name="www/index.php" />
|
|
<include name="CHANGELOG" />
|
|
<include name="www/.htaccess" />
|
|
<include name="LICENSE" />
|
|
</fileset>
|
|
|
|
<target name="main">
|
|
<echo>Hello</echo>
|
|
</target>
|
|
|
|
<!-- PHP CodeSniffer -->
|
|
<target name="phpcbf">
|
|
<exec executable="bash" line="${srcdir}/vendor/bin/phpcbf --standard=${srcdir}/phpcs.xml" escape="false" passthru="true" checkreturn="true" />
|
|
</target>
|
|
<target name="phpcs">
|
|
<exec executable="bash" line="${srcdir}/vendor/bin/phpcs --standard=${srcdir}/phpcs.xml --report=checkstyle > ${builddir}/reports/checkstyle.xml" escape="false" />
|
|
</target>
|
|
<target name="phpcs-console">
|
|
<exec executable="bash" line="${srcdir}/vendor/bin/phpcs --standard=${srcdir}/phpcs.xml" escape="false" passthru="true" checkreturn="true" />
|
|
</target>
|
|
|
|
<target name="php-cs-fixer-dryrun">
|
|
<exec executable="bash" line="${srcdir}/vendor/bin/php-cs-fixer fix --dry-run -vvv --diff ${srcdir}/inc" passthru="true" escape="false" checkreturn="true" />
|
|
</target>
|
|
|
|
<!-- PHPUnit -->
|
|
<target name="phpunitfast" description="Run tests">
|
|
<exec dir="${srcdir}/SeedDMS_Core" executable="bash" line="XDEBUG_MODE=coverage SEEDDMS_CORE_SQL=../install/create_tables-sqlite3.sql ${srcdir}/vendor/bin/phpunit --bootstrap ${srcdir}/SeedDMS_Core/bootstrap-${majorversion}.php --coverage-html ${srcdir}/coverage/" passthru="true" checkreturn="true" />
|
|
<!-- exec dir="${srcdir}/tests" command="SEEDDMS_URL=${seeddmsurl} SEEDDMS_MINK_DRIVER=${mink_driver} SEEDDMS_SNOOZE_MULTIPLIER=${snooze_multiplier} ${srcdir}/vendor/bin/phpunit" passthru="true" checkreturn="true" / -->
|
|
</target>
|
|
|
|
<target name="composer" description="Install dependencies with Composer">
|
|
<if>
|
|
<equals arg1="${composer_version}" arg2="latest-2.x" />
|
|
<then>
|
|
<httpget url="https://getcomposer.org/composer-2.phar" sslVerifyPeer="false" dir="${srcdir}" filename="composer.phar" />
|
|
</then>
|
|
<else>
|
|
<if>
|
|
<not><available file="composer.phar" /></not>
|
|
<then>
|
|
<httpget url="https://getcomposer.org/download/${composer_version}/composer.phar" sslVerifyPeer="false" dir="${srcdir}" />
|
|
</then>
|
|
</if>
|
|
</else>
|
|
</if>
|
|
<echo message="Installing dependencies..." />
|
|
<exec executable="php" passthru="false" dir="${builddir}/export/${shortversion}">
|
|
<arg line="${srcdir}/composer.phar install ${composer_extra_params}"/>
|
|
<!-- arg line="${composer_env} php ${srcdir}/composer.phar install ${composer_extra_params}"/ -->
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="dist" description="build SeedDMS tar archive">
|
|
<if>
|
|
<equals arg1="-" arg2="${version}" />
|
|
<then><fail msg="Pass version as property 'version'" /></then>
|
|
</if>
|
|
|
|
<echo msg="This is ${version}" />
|
|
|
|
<delete file="./seeddms-${version}.tar.gz" failonerror="false" />
|
|
<tar destfile="./seeddms-${version}.tar.gz" prefix="seeddms-${version}" compression="gzip">
|
|
<fileset refid="distfiles" />
|
|
</tar>
|
|
</target>
|
|
|
|
<target name="package" description="build SeedDMS quickstart packages for distribution">
|
|
<if>
|
|
<equals arg1="-" arg2="${version}" />
|
|
<then><fail msg="Pass version as property 'version'" /></then>
|
|
</if>
|
|
|
|
<echo msg="This is ${shortversion}" />
|
|
<echo msg="Major version ${majorversion}" />
|
|
<echo msg="Minor version ${minorversion}" />
|
|
<echo msg="Subminor version ${subminorversion}" />
|
|
|
|
<if>
|
|
<matches string="${version}" pattern="^6\.0\..*" />
|
|
<then><echo msg="This is version 6" /></then>
|
|
<else><echo msg="This is version 5" /></else>
|
|
</if>
|
|
<!-- make sure the work area is empty, then rebuild it -->
|
|
<delete dir="${builddir}/packages" includeemptydirs="true" failonerror="false" />
|
|
<mkdir dir="${builddir}/packages" />
|
|
<delete dir="${builddir}/export" includeemptydirs="true" failonerror="false" />
|
|
<mkdir dir="${builddir}/export" />
|
|
<mkdir dir="${builddir}/export/${shortversion}" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/conf" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/data" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/data/1048576" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/data/log" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/data/cache" />
|
|
<exec executable="echo" passthru="true" checkreturn="true">
|
|
<arg line="'Signature: 8a477f597d28d172789f06886806bc55' > ${builddir}/export/${shortversion}/data/cache/CACHEDIR.TAG" />
|
|
</exec>
|
|
<exec executable="echo" passthru="true" checkreturn="true">
|
|
<arg line="'# This file is a cache directory tag created by seeddms.' >> ${builddir}/export/${shortversion}/data/cache/CACHEDIR.TAG" />
|
|
</exec>
|
|
<exec executable="echo" passthru="true" checkreturn="true">
|
|
<arg line="echo '# For information about cache directory tags, see: http://www.brynosaurus.com/cachedir/' >> ${builddir}/export/${shortversion}/data/cache/CACHEDIR.TAG" />
|
|
</exec>
|
|
<mkdir dir="${builddir}/export/${shortversion}/data/backup" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/data/lucene" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/data/staging" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/www" />
|
|
<mkdir dir="${builddir}/export/${shortversion}/www/ext" />
|
|
<if>
|
|
<matches string="${mode}" pattern="^development" />
|
|
<then></then>
|
|
<else>
|
|
<mkdir dir="${builddir}/export/${shortversion}/seeddms-${version}" />
|
|
</else>
|
|
</if>
|
|
|
|
<copy file="${srcdir}/conf/settings.xml.template" tofile="${builddir}/export/${shortversion}/conf/settings.xml">
|
|
<filterchain>
|
|
<replaceregexp>
|
|
<regexp pattern="_DBC_DBTYPE_" replace="${dbtype}"/>
|
|
<regexp pattern="_DBC_DBSERVER_" replace="${dbhost}"/>
|
|
<regexp pattern="_DBC_DBNAME_" replace="${dbname}"/>
|
|
<regexp pattern="_DBC_DBUSER_" replace="${dbuser}"/>
|
|
<regexp pattern="_DBC_DBPASS_" replace="${dbpass}"/>
|
|
<regexp pattern="_SHORT_VERSION_" replace="${shortversion}"/>
|
|
</replaceregexp>
|
|
</filterchain>
|
|
</copy>
|
|
<copy file="${srcdir}/conf/.htaccess" tofile="${builddir}/export/${shortversion}/conf/.htaccess" />
|
|
<if>
|
|
<matches string="${mode}" pattern="^development" />
|
|
<then>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}">
|
|
<arg line="-s ${srcdir} seeddms" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/op" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/out" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/inc" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/controllers" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/languages" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/views" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/restapi" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/styles" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/install" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/webdav" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/www/index.php" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ${srcdir}/www/.htaccess" />
|
|
</exec>
|
|
</then>
|
|
<else>
|
|
<copy todir="${builddir}/export/${shortversion}/seeddms-${version}">
|
|
<fileset refid="distfiles" />
|
|
</copy>
|
|
<copy todir="${builddir}/export/${shortversion}/www/ext/example">
|
|
<fileset dir="${srcdir}/www/ext/example" defaultexcludes="false" />
|
|
</copy>
|
|
<if>
|
|
<available file="${srcdir}/www/ext/pdfviewer/conf.php"/>
|
|
<then>
|
|
<copy todir="${builddir}/export/${shortversion}/www/ext/pdfviewer">
|
|
<fileset dir="${srcdir}/www/ext/pdfviewer/" expandsymboliclinks="true" defaultexcludes="false">
|
|
<include name="**/*" />
|
|
</fileset>
|
|
</copy>
|
|
</then>
|
|
<else>
|
|
<echo level="warning" message="I didn't find the extension 'pdfviewer'. You need to install it manually." />
|
|
</else>
|
|
</if>
|
|
<copy tofile="${builddir}/export/${shortversion}/composer.json" file="composer-dist.json">
|
|
<filterchain>
|
|
<replaceregexp>
|
|
<regexp pattern="/home/cvs/seeddms-ext/" replace="${srcdir}/../"/>
|
|
<regexp pattern="__CORE_BRANCH__" replace="seeddms-${majorversion}.${minorversion}.x"/>
|
|
</replaceregexp>
|
|
</filterchain>
|
|
</copy>
|
|
<phingcall target="composer">
|
|
<property name="composer_extra_params" value="--working-dir=${builddir}/export/${shortversion}/" />
|
|
<property name="composer_envv" value="COMPOSER=${srcdir}/composer-dist.json" />
|
|
</phingcall>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}">
|
|
<arg line="-s seeddms-${version} seeddms" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/op" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/out" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/inc" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/controllers" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/languages" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/views" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/restapi" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/styles" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/install" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/webdav" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/www/index.php" />
|
|
</exec>
|
|
<exec executable="ln" passthru="true" dir="${builddir}/export/${shortversion}/www">
|
|
<arg line="-s ../seeddms/www/.htaccess" />
|
|
</exec>
|
|
</else>
|
|
</if>
|
|
|
|
<!-- create initial empty database -->
|
|
<echo message="Creating sqlite3 database ..." />
|
|
<exec executable="bash" passthru="true">
|
|
<arg value="-c"/>
|
|
<arg line='"cat ${srcdir}/install/create_tables-sqlite3.sql | sqlite3 ${builddir}/export/${shortversion}/data/content.db"' />
|
|
</exec>
|
|
|
|
<!-- build the standard tar.gz archive -->
|
|
<echo message="Building .tar.gz ..." />
|
|
<exec executable="tar" passthru="true" checkreturn="true" dir="${builddir}/export">
|
|
<arg line="czf ../packages/seeddms-quickstart-${version}.tar.gz ${shortversion}" />
|
|
</exec>
|
|
<echo message="Built in ${builddir}/packages/seeddms-quickstart-${version}.tar.gz" />
|
|
</target>
|
|
|
|
<target name="install" description="Install SeedDMS">
|
|
<if>
|
|
<equals arg1="" arg2="${installpath}" />
|
|
<then><fail msg="Pass install path as property 'installpath'. Ensure this directory exists and is writeable by the user running this build script." /></then>
|
|
</if>
|
|
<if>
|
|
<not><available file="${installpath}"/></not>
|
|
<then><fail msg="Install path '${installpath}' does not exist." /></then>
|
|
</if>
|
|
<phingcall target="package"></phingcall>
|
|
<exec executable="tar" passthru="false" checkreturn="true" dir="${installpath}">
|
|
<arg line="-xzvf ${builddir}/packages/seeddms-quickstart-${version}.tar.gz --strip-components=1" />
|
|
</exec>
|
|
<copy file="${srcdir}/conf/apache.virtualhost.template" tofile="${installpath}/conf/apache.virtualhost.conf">
|
|
<filterchain>
|
|
<replaceregexp>
|
|
<regexp pattern="_INSTALL_PATH_" replace="${installpath}"/>
|
|
<regexp pattern="_DOMAIN_" replace="${domain}"/>
|
|
</replaceregexp>
|
|
</filterchain>
|
|
</copy>
|
|
<exec executable="bash" passthru="true" dir="${installpath}">
|
|
<arg value="-c"/>
|
|
<arg line="'sudo chown www-data:www-data ${installpath}'" />
|
|
</exec>
|
|
<exec executable="bash" passthru="true" dir="${installpath}">
|
|
<arg value="-c"/>
|
|
<arg line="'sudo chown -R www-data:www-data ${installpath}/data ${installpath}/conf'" />
|
|
</exec>
|
|
<echo message="Create a link in /etc/apache2/sites-enabled/" />
|
|
<echo message="sudo ln -s ${installpath}/conf/apache.virtualhost.conf /etc/apache2/sites-enabled/001-seeddms.conf" />
|
|
</target>
|
|
|
|
<target name="update" description="Update SeedDMS Installation">
|
|
<if>
|
|
<equals arg1="" arg2="${installpath}" />
|
|
<then><fail msg="Pass install path as property 'installpath'. Ensure this directory exists and is writeable by the user running this build script." /></then>
|
|
</if>
|
|
<if>
|
|
<not><available file="${installpath}"/></not>
|
|
<then><fail msg="Install path '${installpath}' does not exist." /></then>
|
|
</if>
|
|
<phingcall target="package"></phingcall>
|
|
<exec executable="tar" passthru="false" checkreturn="true" dir="${installpath}">
|
|
<arg line="-xzvf ${builddir}/packages/seeddms-quickstart-${version}.tar.gz --strip-components=1 ${shortversion}/vendor ${shortversion}/seeddms-${version}" />
|
|
</exec>
|
|
<!-- delete file="${installpath}/seeddms" / -->
|
|
<!-- symlink target="${installpath}/${shortversion}" link="${installpath}/seeddms" relative="true"/ -->
|
|
<echo message="If you have updated to a newer version of SeedDMS, you will have to adjust the link 'seeddms' pointing to 'seeddms-${version}' in '${installpath}'." />
|
|
</target>
|
|
</project>
|