Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ before_install:

script:
- sudo chown $USER /opt
- ant composer-init
- ant -Dprepare.distribution.build=false build
- php ocular.phar code-coverage:upload --format=php-clover $TRAVIS_BUILD_DIR/target/reports/unit/clover.xml

Expand Down
3 changes: 2 additions & 1 deletion build.default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ webapps.version.example = latest
# ---- Package Naming and Release Settings --------------------------------------
# Download URL + version
appserver.url = https://github.com/appserver-io/appserver
appserver.version = master
appserver.version = 1.0.0
appserver.tag = master

# Suffix is used to mark versions as alpha, beta, etc. set it to e.g. "alpha." to do so, leave empty ("") otherwise
appserver.version.suffix = alpha.
Expand Down
74 changes: 19 additions & 55 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@
<property file="${basedir}/build.default.properties"/>
<property file="${basedir}/build.${os.family}.${os.distribution}.properties"/>
<property file="${basedir}/build.${os.family}.properties"/>

<!-- initialize the library specific properties -->
<property name="codepool" value="vendor"/>

<!-- initialize the directory where we can find the real build files -->
<property name="vendor.dir" value ="${basedir}/${codepool}" />
<property name="build.dir" value="${vendor.dir}/appserver-io/build" />

<!-- ==================================================================== -->
<!-- Import the common build configuration file -->
<!-- ==================================================================== -->
<import file="${build.dir}/common.xml" optional="true"/>

<!-- ==================================================================== -->
<!-- Create some basic properties which we need for further processing -->
Expand All @@ -43,6 +31,9 @@
<property name="lib.dir" value="${basedir}/lib" />
<property name="hub.address" value="appserver.io"/>
<property name="custom-lib.dir" value="${basedir}/custom-lib" />
<property name="php-src.dir" value="${basedir}/src" />
<property name="php-test.dir" value="${basedir}/tests" />
<property name="php-target.dir" value="${basedir}/target"/>
<property name="hub.snapshot-path" value="/var/www/builds.appserver.io/${os.qualified.path}"/>

<!-- ==================================================================== -->
Expand All @@ -54,49 +45,14 @@
<property name="package.specific-dir" value="${php-target.dir}/"/>

<!-- ==================================================================== -->
<!-- Checks if composer has installed it's dependencies -->
<!-- ==================================================================== -->
<target name="is-composer-installed">
<condition property="composer.present">
<available file="${build.dir}" type="dir"/>
</condition>
</target>

<!-- ==================================================================== -->
<!-- Installs all dependencies defined in composer.json -->
<!-- ==================================================================== -->
<target name="composer-install" depends="is-composer-installed" unless="composer.present" description="Installs all dependencies defined in composer.json">
<exec dir="${basedir}" executable="composer">
<arg line="--no-interaction --dev install"/>
</exec>
</target>

<!-- ==================================================================== -->
<!-- Updates composer dependencies defined in composer.json -->
<!-- ==================================================================== -->
<target name="composer-update" depends="is-composer-installed" if="composer.present" description="Updates composer dependencies defined in composer.json">
<exec dir="${basedir}" executable="composer">
<arg line="--no-interaction --dev update"/>
</exec>
</target>

<!-- ===================================================================== -->
<!-- Checks if the build- and deployment stub has already been initialized -->
<!-- ===================================================================== -->
<target name="composer-init">
<antcall target="composer-install"/>
<antcall target="composer-update"/>
</target>

<!-- ==================================================================== -->
<!-- Deletes the directory with the generated artefacts -->
<!-- Cleans the directories with the generated source files -->
<!-- ==================================================================== -->
<target name="clean" description="Cleans build directory in preparation for new build.">
<delete dir="${php-target.dir}" includeemptydirs="true" quiet="false" verbose="true" failonerror="true"/>
</target>

<!-- ==================================================================== -->
<!-- Prepares the directory to temporarily store generated artefacts -->
<!-- Prepares all the required directories -->
<!-- ==================================================================== -->
<target name="prepare" depends="clean" description="Prepares all the required directories.">
<mkdir dir="${php-target.dir}" />
Expand Down Expand Up @@ -144,7 +100,7 @@
<!-- Builds the runtime -->
<!-- ==================================================================== -->
<target name="build" description="Runs the PHPUnit tests and generates a report.">
<antcall target="build-runtime"/>
<antcall target="install-sources"/>
<antcall target="run-integration-tests"/>
</target>

Expand Down Expand Up @@ -338,8 +294,10 @@
<!-- Get the latest versions of the default webapps -->
<!-- ==================================================================== -->
<target name="get-default-webapps" depends="prepare" description="Get the latest versions of the default webapps">
<get src="${webapps.download.baseurl}${webapps.name.admin}/${webapps.name.admin}-${webapps.version.admin}.phar" dest="${basedir}/webapps/${webapps.name.admin}.phar" usetimestamp="true"/>
<!--
<get src="${webapps.download.baseurl}${webapps.name.admin}/${webapps.name.admin}-${webapps.version.admin}.phar" dest="${basedir}/webapps/${webapps.name.admin}.phar" usetimestamp="true"/>
<get src="${webapps.download.baseurl}${webapps.name.api}/${webapps.name.api}-${webapps.version.api}.phar" dest="${basedir}/webapps/${webapps.name.api}.phar" usetimestamp="true"/>
-->
<get src="${webapps.download.baseurl}${webapps.name.example}/${webapps.name.example}-${webapps.version.example}.phar" dest="${basedir}/webapps/${webapps.name.example}.phar" usetimestamp="true"/>
</target>

Expand Down Expand Up @@ -1093,7 +1051,7 @@
<target name="install-sources" unless="${runtime.only}" depends="install-composer" description="Install ApplicationServer packages.">
<!-- clone the sources from github -->
<exec dir="${php-target.dir}" executable="git">
<arg line="clone ${appserver.url} --branch=${appserver.version} download" />
<arg line="clone ${appserver.url} --branch=${appserver.tag} download" />
</exec>
<!-- copy the sources to the target directory -->
<copy todir="${appserver.compile.prefix}">
Expand All @@ -1109,9 +1067,15 @@
<!-- Runs the PHPUnit integration tests -->
<!-- ==================================================================== -->
<target name="run-integration-tests" description="Runs the PHPUnit integration tests.">
<!-- install the build utilities (PHPUnit etc.) -->
<exec dir="${basedir}" executable="${appserver.compile.prefix}/bin/php">
<arg line="${appserver.compile.prefix}/bin/composer.phar install"/>
</exec>
<!-- execute the integration tests for the runtime -->
<exec executable="${appserver.compile.prefix}/bin/php" dir="${basedir}" failonerror="true">
<arg line="${vendor.dir}/bin/phpunit --bootstrap bootstrap.php --configuration phpunit.xml" />
<arg line="${basedir}/vendor/bin/phpunit --bootstrap bootstrap.php --configuration phpunit.xml" />
</exec>
<!-- exectue PHP unit tests here -->
</target>

<!-- ==================================================================== -->
Expand Down Expand Up @@ -1764,7 +1728,7 @@
</exec>
<!-- clone the sources from github -->
<exec dir="${php-target.dir}" executable="git">
<arg line="clone ${appserver.url} --branch=${appserver.version} download" />
<arg line="clone ${appserver.url} --branch=${appserver.tag} download" />
</exec>
<!-- copy the sources to the target directory -->
<copy todir="${php-target.dir}/appserver">
Expand Down