Update build.xml to exlude not wanted directories/files

This commit is contained in:
Marc Alexander
2023-02-20 21:07:29 +01:00
parent e0c9908a2b
commit 6854ff7407

229
build.xml
View File

@@ -14,24 +14,23 @@
${dir}/ is the folder of your extension, e.g. ext/nickvergessen/newspage/
-->
<delete dir="${dir}/tests" />
<delete dir="${dir}/.github" />
<delete dir="${dir}/travis" />
<delete dir="${dir}/vendor/nickvergessen/phpbb-tool-trimmessage/src/Nickvergessen/TrimMessage/Tests" />
<delete dir="${dir}/vendor/nickvergessen/phpbb-tool-trimmessage/tests" />
<delete dir="${dir}/vendor/marc1706/phpbb-text-shortener/.github" />
<delete dir="${dir}/language/ar" />
<delete dir="${dir}/language/es" />
<delete dir="${dir}/language/fr" />
<delete dir="${dir}/language/it" />
<delete dir="${dir}/language/nl" />
<delete file="${dir}/.gitignore" />
<delete file="${dir}/.gitattributes" />
<delete file="${dir}/.travis.yml" />
<delete file="${dir}/build.xml" />
<delete file="${dir}/composer.lock" />
<delete file="${dir}/composer.phar" />
<delete file="${dir}/phpunit.xml.dist" />
<delete file="${dir}/README.md" />
<delete file="${dir}/vendor/nickvergessen/phpbb-tool-trimmessage/composer.lock" />
<delete file="${dir}/vendor/nickvergessen/phpbb-tool-trimmessage/composer.phar" />
<delete file="${dir}/vendor/nickvergessen/phpbb-tool-trimmessage/phpunit.xml" />
<delete file="${dir}/vendor/nickvergessen/phpbb-tool-trimmessage/README.md" />
<delete file="${dir}/vendor/nickvergessen/phpbb-tool-trimmessage/.gitignore" />
<delete file="${dir}/vendor/nickvergessen/phpbb-tool-trimmessage/.travis.yml" />
</target>
<!--
@@ -39,12 +38,12 @@
-->
<property name="version" value="HEAD" override="true" />
<property name="package.version" value="HEAD" />
<property name="package.version" value="HEAD" />
<property name="build-directory" value="build" override="true" />
<property name="package-directory" value="${build-directory}/package/${vendor-name}/${extension-name}" />
<property name="phpbb-root" value="${build-directory}/../../../../../" />
<property name="clover-path" value="${build-directory}/logs/clover.xml" />
<property name="coverage-html-path" value="${build-directory}/coverage" />
<property name="clover-path" value="${build-directory}/logs/clover.xml" />
<property name="coverage-html-path" value="${build-directory}/coverage" />
<!-- These are the main targets which you will probably want to use -->
<target name="all" depends="prepare-structure,package" />
@@ -54,7 +53,7 @@
-->
<target name="clean">
<delete dir="${build-directory}" />
<mkdir dir="${build-directory}" />
<mkdir dir="${build-directory}" />
</target>
<target name="composer">
@@ -63,115 +62,115 @@
passthru="true" />
</target>
<target name="prepare-tests" depends="clean,composer">
<if>
<available property="phpbb-is-available" file="${phpbb-root}/phpBB/vendor/bin/phpunit" type="file" />
<then>
<echo msg="phpBB is already set up." />
</then>
<else>
<!-- Move Board3 Portal and set up phpBB -->
<exec command="CURRENT_BUILD_REV=$(git rev-parse --abbrev-ref HEAD)" passthru="true" />
<exec command="echo $GIT_BRANCH" passthru="true" />
<exec command="git clone -v --progress https://github.com/phpbb/phpbb.git phpbb" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="git checkout 3.3.x" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB" command="php ../composer.phar install" passthru="true" />
<mkdir dir="phpbb/phpBB/ext/board3" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3" command="git clone https://github.com/board3/Board3-Portal.git portal" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="git checkout $GIT_BRANCH" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="php composer.phar install" passthru="true" />
<property name="phpbb-root" value="${build-directory}/../phpbb" override="true" />
<property name="clover-path" value="../build/logs/clover.xml" override="true" />
<property name="coverage-html-path" value="../build/coverage" override="true" />
<exec dir="${build-directory}/../phpbb" command="cp ../../test_config_22x.php tests/test_config.php" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/cache" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="mkdir phpBB/cache/test" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/cache/test" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/files" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/store" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/images/avatars/upload" passthru="true" />
</else>
</if>
<if>
<equals arg1="$JENKINS_URL" arg2="" />
<then>
<echo msg="JENKINS_URL is not set" />
</then>
<else>
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="wget https://phar.phpunit.de/phploc.phar" passthru="true" />
<if>
<available property="logs-dir-available" file="${build-directory}/logs" type="dir" />
<then>
<echo msg="Logs dir already set up." />
</then>
<else>
<mkdir dir="${build-directory}/logs" />
<exec dir="${build-directory}/logs" command="touch phploc.csv" />
</else>
</if>
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3" command="php portal/phploc.phar --exclude=vendor --exclude=travis --log-csv ../../../../build/logs/phploc.csv portal/" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="rm phploc.phar" passthru="true" />
</else>
</if>
<if>
<equals arg1="$BUILD_NUMBER" arg2="" />
<then>
<echo msg="BUILD_NUMBER is not available" />
</then>
<else>
<property environment="env" />
<echo>Build number is ${env.BUILD_NUMBER}</echo>
<property name="package.version" value="${env.BUILD_NUMBER}" override="true" />
</else>
</if>
</target>
<target name="prepare-tests" depends="clean,composer">
<if>
<available property="phpbb-is-available" file="${phpbb-root}/phpBB/vendor/bin/phpunit" type="file" />
<then>
<echo msg="phpBB is already set up." />
</then>
<else>
<!-- Move Board3 Portal and set up phpBB -->
<exec command="CURRENT_BUILD_REV=$(git rev-parse --abbrev-ref HEAD)" passthru="true" />
<exec command="echo $GIT_BRANCH" passthru="true" />
<exec command="git clone -v --progress https://github.com/phpbb/phpbb.git phpbb" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="git checkout 3.3.x" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB" command="php ../composer.phar install" passthru="true" />
<mkdir dir="phpbb/phpBB/ext/board3" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3" command="git clone https://github.com/board3/Board3-Portal.git portal" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="git checkout $GIT_BRANCH" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="php composer.phar install" passthru="true" />
<property name="phpbb-root" value="${build-directory}/../phpbb" override="true" />
<property name="clover-path" value="../build/logs/clover.xml" override="true" />
<property name="coverage-html-path" value="../build/coverage" override="true" />
<exec dir="${build-directory}/../phpbb" command="cp ../../test_config_22x.php tests/test_config.php" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/cache" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="mkdir phpBB/cache/test" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/cache/test" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/files" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/store" passthru="true" />
<exec dir="${build-directory}/../phpbb" command="chmod 777 phpBB/images/avatars/upload" passthru="true" />
</else>
</if>
<if>
<equals arg1="$JENKINS_URL" arg2="" />
<then>
<echo msg="JENKINS_URL is not set" />
</then>
<else>
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="wget https://phar.phpunit.de/phploc.phar" passthru="true" />
<if>
<available property="logs-dir-available" file="${build-directory}/logs" type="dir" />
<then>
<echo msg="Logs dir already set up." />
</then>
<else>
<mkdir dir="${build-directory}/logs" />
<exec dir="${build-directory}/logs" command="touch phploc.csv" />
</else>
</if>
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3" command="php portal/phploc.phar --exclude=vendor --exclude=travis --log-csv ../../../../build/logs/phploc.csv portal/" passthru="true" />
<exec dir="${build-directory}/../phpbb/phpBB/ext/board3/portal" command="rm phploc.phar" passthru="true" />
</else>
</if>
<if>
<equals arg1="$BUILD_NUMBER" arg2="" />
<then>
<echo msg="BUILD_NUMBER is not available" />
</then>
<else>
<property environment="env" />
<echo>Build number is ${env.BUILD_NUMBER}</echo>
<property name="package.version" value="${env.BUILD_NUMBER}" override="true" />
</else>
</if>
</target>
<target name="test" depends="clean,composer,prepare-tests">
<if>
<available property="phpunit-available" file="phpbb/phpBB/vendor/bin/phpunit" type="file" />
<then>
<exec dir="${phpbb-root}"
command="phpBB/vendor/bin/phpunit
<if>
<available property="phpunit-available" file="phpbb/phpBB/vendor/bin/phpunit" type="file" />
<then>
<exec dir="${phpbb-root}"
command="phpBB/vendor/bin/phpunit
-c phpBB/ext/${vendor-name}/${extension-name}/ --coverage-clover=${clover-path} --coverage-html=${coverage-html-path}"
passthru="true" returnProperty="test.pass" />
<if>
<not>
<equals arg1="${test.pass}" arg2="0"/>
</not>
<then>
<fail msg="PHPUnit tests failed."/>
</then>
</if>
</then>
<else>
<echo msg="PHPUnit couldn't be found." />
</else>
</if>
passthru="true" returnProperty="test.pass" />
<if>
<not>
<equals arg1="${test.pass}" arg2="0"/>
</not>
<then>
<fail msg="PHPUnit tests failed."/>
</then>
</if>
</then>
<else>
<echo msg="PHPUnit couldn't be found." />
</else>
</if>
</target>
<target name="test-slow" depends="clean,composer">
<if>
<available property="phpunit-available" file="phpbb/phpBB/vendor/bin/phpunit" type="file" />
<then>
<exec dir="${phpbb-root}"
command="phpBB/vendor/bin/phpunit
-c phpBB/ext/${vendor-name}/${extension-name}/
--group slow"
passthru="true" />
<if>
<not>
<equals arg1="${test.pass}" arg2="0"/>
</not>
<then>
<fail msg="PHPUnit slow tests failed."/>
</then>
</if>
</then>
<else>
<echo msg="PHPUnit couldn't be found." />
</else>
</if>
<if>
<available property="phpunit-available" file="phpbb/phpBB/vendor/bin/phpunit" type="file" />
<then>
<exec dir="${phpbb-root}"
command="phpBB/vendor/bin/phpunit
-c phpBB/ext/${vendor-name}/${extension-name}/
--group slow"
passthru="true" />
<if>
<not>
<equals arg1="${test.pass}" arg2="0"/>
</not>
<then>
<fail msg="PHPUnit slow tests failed."/>
</then>
</if>
</then>
<else>
<echo msg="PHPUnit couldn't be found." />
</else>
</if>
</target>
<!--