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