| 1 | <?xml version="1.0" encoding="UTF-8"?>
|
|---|
| 2 | <project name="GNUBoatWebApp" default="dist">
|
|---|
| 3 |
|
|---|
| 4 | <property name="builddir" value="../../build/webapp" override="true" />
|
|---|
| 5 |
|
|---|
| 6 | <fileset dir="./common/resources/" id="filesCommonResources">
|
|---|
| 7 | </fileset>
|
|---|
| 8 | <fileset dir="./common/css/" id="filesCommonCss">
|
|---|
| 9 | </fileset>
|
|---|
| 10 | <fileset dir="../icon/" id="filesGnuboatIcons">
|
|---|
| 11 | <include name="gnuboat-256-256-transparent.png"/>
|
|---|
| 12 | </fileset>
|
|---|
| 13 |
|
|---|
| 14 | <target name="prepare">
|
|---|
| 15 | <echo msg="Making directory ${builddir}" />
|
|---|
| 16 | <mkdir dir="${builddir}"/>
|
|---|
| 17 | </target>
|
|---|
| 18 | <target name="buildwebclient" depends="prepare">
|
|---|
| 19 | <echo msg="Copying files to build directory"/>
|
|---|
| 20 | <fileset dir="./webclient" id="filesWebclient">
|
|---|
| 21 | <!-- <exclude name=""/> -->
|
|---|
| 22 | </fileset>
|
|---|
| 23 |
|
|---|
| 24 | <copy todir="${builddir}/webclient">
|
|---|
| 25 | <fileset refid="filesWebclient"/>
|
|---|
| 26 | </copy>
|
|---|
| 27 | <copy todir="${builddir}/webclient/resources">
|
|---|
| 28 | <fileset refid="filesGnuboatIcons"/>
|
|---|
| 29 | </copy>
|
|---|
| 30 |
|
|---|
| 31 | <copy todir="${builddir}/webclient/resources">
|
|---|
| 32 | <fileset refid="filesCommonResources"/>
|
|---|
| 33 | </copy>
|
|---|
| 34 | <copy todir="${builddir}/webclient/css">
|
|---|
| 35 | <fileset refid="filesCommonCss"/>
|
|---|
| 36 | </copy>
|
|---|
| 37 | </target>
|
|---|
| 38 | <target name="buildwebservice" depends="prepare">
|
|---|
| 39 | <fileset dir="./webservice" id="filesWebservice">
|
|---|
| 40 | <exclude name="mbtiles/**"/>
|
|---|
| 41 | <exclude name="tests/**"/>
|
|---|
| 42 | <exclude name="config/**"/>
|
|---|
| 43 | </fileset>
|
|---|
| 44 | <fileset dir="./webservice/mbtiles" id="filesWebserviceMaps">
|
|---|
| 45 | <!-- <exclude name=""/> -->
|
|---|
| 46 | </fileset>
|
|---|
| 47 |
|
|---|
| 48 | <copy todir="${builddir}/webservice">
|
|---|
| 49 | <fileset refid="filesWebservice"/>
|
|---|
| 50 | </copy>
|
|---|
| 51 | <copy todir="${builddir}/webservice/maps">
|
|---|
| 52 | <fileset refid="filesWebserviceMaps"/>
|
|---|
| 53 | </copy>
|
|---|
| 54 | </target>
|
|---|
| 55 |
|
|---|
| 56 | <fileset dir="${builddir}" id="filesWebApp"/>
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 | <target name="dist" depends="buildwebservice,buildwebclient,test">
|
|---|
| 60 | <echo msg="Creating archive"/>
|
|---|
| 61 | <tar destfile="${builddir}/..//gnuboat-webapp.tar.gz" compression="gzip">
|
|---|
| 62 | <fileset refid="filesWebApp"/>
|
|---|
| 63 | </tar>
|
|---|
| 64 | <echo msg="Files copied and compressed in build directory weblcient.tar.gz OK!" />
|
|---|
| 65 | </target>
|
|---|
| 66 |
|
|---|
| 67 | <target name="testdist" depends="buildwebservice,buildwebclient,test">
|
|---|
| 68 | <echo msg="Install project into ${user.home}/public_html/gnuboat"/>
|
|---|
| 69 | <fileset id="filesConfig" dir="./webservice/config">
|
|---|
| 70 | <include name="config.php"/>
|
|---|
| 71 | </fileset>
|
|---|
| 72 | <fileset id="filesLogs" dir="./webservice/tests/logs">
|
|---|
| 73 | <include name="*.log"/>
|
|---|
| 74 | </fileset>
|
|---|
| 75 |
|
|---|
| 76 | <copy todir="${user.home}/public_html/gnuboat">
|
|---|
| 77 | <fileset refid="filesWebApp"/>
|
|---|
| 78 | </copy>
|
|---|
| 79 | <copy todir="${user.home}/public_html/gnuboat/webservice/tests/logs">
|
|---|
| 80 | <fileset refid="filesLogs"/>
|
|---|
| 81 | </copy>
|
|---|
| 82 | <copy todir="${user.home}/public_html/gnuboat/webservice/config">
|
|---|
| 83 | <fileset refid="filesConfig"/>
|
|---|
| 84 | </copy>
|
|---|
| 85 | </target>
|
|---|
| 86 |
|
|---|
| 87 | <target name="test">
|
|---|
| 88 | <exec command="php phpunit-7.4.3.phar" passthru="true" checkreturn="true"/>
|
|---|
| 89 | <!--<phpunit pharlocation="phpunit-4.8.9.phar" configuration="phpunit.xml" haltonfailure="true" haltonerror="true" printsummary="true" codecoverage="false">
|
|---|
| 90 | <formatter type="plain" usefile="false"/> -->
|
|---|
| 91 | <!--<formatter type="JUnit" usefile="true"/>-->
|
|---|
| 92 | <!-- <batchtest>
|
|---|
| 93 | <fileset dir="webservice">
|
|---|
| 94 | <include name="tests/*Test.php"/>
|
|---|
| 95 | </fileset>
|
|---|
| 96 | </batchtest>
|
|---|
| 97 | </phpunit>-->
|
|---|
| 98 | </target>
|
|---|
| 99 |
|
|---|
| 100 | <target name="testdist-sample-logs" depends="testdist">
|
|---|
| 101 | <echo msg="Install sample logs"/>
|
|---|
| 102 | <fileset id="filesSampleLogs" dir="../../sample-logs">
|
|---|
| 103 | <include name="*.log"/>
|
|---|
| 104 | </fileset>
|
|---|
| 105 | <fileset id="filesCalcLogs" dir="../../sample-logs/calc-demo">
|
|---|
| 106 | <include name="*.log"/>
|
|---|
| 107 | </fileset>
|
|---|
| 108 | <copy todir="${user.home}/public_html/gnuboat/webservice/tests/logs">
|
|---|
| 109 | <fileset refid="filesSampleLogs"/>
|
|---|
| 110 | <fileset refid="filesCalcLogs"/>
|
|---|
| 111 | </copy>
|
|---|
| 112 | </target>
|
|---|
| 113 | </project>
|
|---|