Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
64 changes: 32 additions & 32 deletions build.lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,62 +11,62 @@
depends="lint-twig,lint-yml"
description="Performs static analysis" />

<!-- This executes the PHP internal linter (php -l) -->
<!-- This executes the PHP internal linter (php -l) -->
<target name="lint-php"
unless="lint-php.done"
description="Perform syntax check of sourcecode files">
<apply executable="php" taskname="lint" failonerror="true">
<arg value="-l" />
<apply executable="php" taskname="lint" failonerror="true">
<arg value="-l" />

<fileset dir="${basedir}/src" errorOnMissingDir = "false">
<include name="**/*.php" />
</fileset>
<fileset dir="${basedir}/src" errorOnMissingDir = "false">
<include name="**/*.php" />
</fileset>

<fileset dir="${basedir}/tests" errorOnMissingDir = "false">
<include name="**/*.php" />
</fileset>
<fileset dir="${basedir}/tests" errorOnMissingDir = "false">
<include name="**/*.php" />
</fileset>

<fileset dir="${basedir}/app" errorOnMissingDir = "false">
<include name="**/*.php" />
</fileset>
<fileset dir="${basedir}/app" errorOnMissingDir = "false">
<include name="**/*.php" />
</fileset>

</apply>
</apply>

<property name="lint-php.done" value="true"/>
<property name="lint-php.done" value="true"/>
</target>

<!-- Executes the symfony provided twig linter -->
<!-- Executes the symfony provided twig linter -->
<target name="lint-twig"
unless="lint-twig.done"
description="Perform syntax check of twig files"
depends="-check-symfony-console"
if="symfony-console.exists">
<apply executable="${symfony-console}" taskname="lint-twig" failonerror="true">
<arg value="lint:twig" />
<dirset dir = "${basedir}">
<include name="app" />
<include name="src" />
</dirset>
</apply>
<apply executable="${symfony4-console}" taskname="lint-twig" failonerror="true">
<arg value="lint:twig" />
<dirset dir = "${basedir}">
<include name="app" />
<include name="src" />
</dirset>
</apply>

<property name="lint-twig.done" value="true"/>
<property name="lint-twig.done" value="true"/>
</target>

<!-- Executes the symfony provided yaml linter -->
<!-- Executes the symfony provided yaml linter -->
<target name="lint-yml"
unless="lint-yml.done"
description="Perform syntax check of yml files"
depends="-check-symfony-console"
if="symfony-console.exists">
<apply executable="${symfony-console}" taskname="lint-yml" failonerror="true">
<arg value="lint:yaml" />
<dirset dir = "${basedir}">
<include name="app" />
<include name="src" />
</dirset>
</apply>
<apply executable="${symfony4-console}" taskname="lint-yml" failonerror="true">
<arg value="lint:yaml" />
<dirset dir = "${basedir}">
<include name="app" />
<include name="src" />
</dirset>
</apply>

<property name="lint-yml.done" value="true"/>
<property name="lint-yml.done" value="true"/>
</target>

</project>
2 changes: 1 addition & 1 deletion build.phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- We define the paths to the executables here, for easier
modification -->
<property name="phpunit" value="${basedir}/vendor/bin/phpunit"/>
<property name="phpunit" value="${basedir}/vendor/bin/simple-phpunit"/>

<!-- Check if composer is available -->
<target name="check-phpunit">
Expand Down
5 changes: 2 additions & 3 deletions build.symfony.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="randock.symfony">
<import file="./build.symfony3.xml" />
<import file="./build.symfony4.xml" />

<target name="symfony-prepare" depends="symfony3-prepare,symfony4-prepare" />
<target name="symfony-prepare" depends="symfony4-prepare" />

<target name="symfony-change-owner"
depends="symfony3-change-owner,symfony4-change-owner" />
depends="symfony4-change-owner" />

</project>
45 changes: 0 additions & 45 deletions build.symfony3.xml

This file was deleted.

57 changes: 54 additions & 3 deletions build.symfony4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,76 @@
<!-- symfony console location -->
<property name="symfony4-console" value="bin/console" />
<property name="yarn" value="/usr/bin/yarn" />
<property environment="env"/>

<!-- Check if symfony is available -->
<target name="symfony4-check">
<available file="${yarn}" property="symfony4.available" />
<available file="${symfony4-console}" property="symfony4.available" />
</target>

<!-- Check if yarn is available -->
<target name="yarn-check">
<available file="${yarn}" property="yarn.available" />
</target>
<target name="symfony4-prepare"
depends="symfony4-check"
if="symfony4.available">
<antcall target= "symfony4-schema:update" />
<antcall target= "symfony4-webpack:build" />
<antcall target= "symfony4-change-owner" />
</target>

<target name="symfony4-webpack:build">
<antcall target="symfony4-webpack:build:prod-with-check"/>
<antcall target="symfony4-webpack:build:dev-with-check"/>
<antcall target="symfony4-webpack:build:test-with-check"/>
</target>

<target name="symfony4-webpack:build:prod-with-check" depends="symfony-environment-check" if="symfony.prod">
<antcall target="symfony4-webpack:build:prod"/>
</target>
<target name="symfony4-webpack:build:dev-with-check" depends="symfony-environment-check" if="symfony.dev">
<antcall target="symfony4-webpack:build:dev"/>
</target>
<target name="symfony4-webpack:build:test-with-check" depends="symfony-environment-check" if="symfony.test">
<antcall target="symfony4-webpack:build:dev"/>
</target>

<target name="symfony-environment-check">
<condition property="symfony.prod">
<equals arg1="${env.APP_ENV}" arg2="prod"/>
</condition>
<condition property="symfony.dev">
<equals arg1="${env.APP_ENV}" arg2="dev"/>
</condition>
<condition property="symfony.test">
<equals arg1="${env.APP_ENV}" arg2="test"/>
</condition>
</target>

<target name="symfony4-webpack:build:prod"
depends="yarn-check"
if="yarn.available">
<exec executable="${yarn}">
<arg value="install" />
</exec>
<exec executable="${yarn}">
<arg value="build" />
</exec>
</target>

<target name="symfony4-webpack:build:dev"
depends="yarn-check"
if="yarn.available">
<exec executable="${yarn}">
<arg value="install" />
</exec>
<exec executable="${yarn}">
<arg value="encore" />
<arg value="dev" />
</exec>
</target>

<target name="symfony4-schema:update">
<exec executable="${symfony4-console}">
<arg value="doctrine:schema:update" />
Expand All @@ -33,10 +84,10 @@
<target name="symfony4-change-owner"
depends="symfony4-check"
if="symfony4.available">
<exec executable="chmod">
<exec executable="chmod">
<arg value = "-R" />
<arg value = "0777" />
<arg value = "var" />
</exec>
</target>
</project>
</project>
6 changes: 3 additions & 3 deletions build.xdebug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Disable xdebug for faster execution of some tasks-->
<target name = "xdebug-disable">
<exec executable="rm">
<arg value = "/etc/php/7.1/cli/conf.d/20-xdebug.ini" />
<arg value = "/etc/php/${php_version}/cli/conf.d/20-xdebug.ini" />
<arg value = "--force" />
</exec>
</target>
Expand All @@ -14,8 +14,8 @@
<antcall target = "xdebug-disable" />
<exec executable="ln">
<arg value = "-s" />
<arg value = "/etc/php/7.1/mods-available/xdebug.ini" />
<arg value = "/etc/php/7.1/cli/conf.d/20-xdebug.ini" />
<arg value = "/etc/php/${php_version}/mods-available/xdebug.ini" />
<arg value = "/etc/php/${php_version}/cli/conf.d/20-xdebug.ini" />
</exec>
</target>
</project>