mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
Phing > update configuration
This commit is contained in:
101
phing/app.xml
101
phing/app.xml
@@ -1,107 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project name="Meritoo Package" basedir="." default="build:main" phingVersion="2.16.0">
|
||||
<!-- Properties -->
|
||||
<if>
|
||||
<available file="phing/properties" property="custom.properties.available"/>
|
||||
<available file="${project.basedir}/phing/properties" property="custom.properties.available"/>
|
||||
<then>
|
||||
<property file="phing/properties"/>
|
||||
<property file="${project.basedir}/phing/properties"/>
|
||||
</then>
|
||||
<else>
|
||||
<property file="phing/properties.dist"/>
|
||||
<property file="${project.basedir}/phing/properties.dist"/>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<!-- Filesets -->
|
||||
<import file="phing/filesets.xml"/>
|
||||
<import file="${project.basedir}/phing/filesets.xml"/>
|
||||
|
||||
<!-- Default / main target -->
|
||||
<target name="build:main"
|
||||
depends="build:app"
|
||||
description="Builds the application"/>
|
||||
/>
|
||||
|
||||
<!-- App target -->
|
||||
<target name="build:app"
|
||||
depends="app:clean, app:composer, app:vendors, app:composer-validate, app:checkout"
|
||||
description="Prepares app to build."/>
|
||||
depends="app:clean,
|
||||
app:composer:self-update,
|
||||
app:composer:install,
|
||||
app:composer:validate,
|
||||
app:checkout"
|
||||
/>
|
||||
|
||||
<!-- Updates Composer -->
|
||||
<target name="app:composer" description="Updates Composer">
|
||||
<echo msg="Updating Composer..."/>
|
||||
|
||||
<target name="app:composer:self-update">
|
||||
<if>
|
||||
<available file="composer.phar"/>
|
||||
<not>
|
||||
<available file="${composer.path}" property="composer.local.unavailable"/>
|
||||
</not>
|
||||
<then>
|
||||
<echo msg="[Skipped] Downloading of Composer skipped, because exist in the project..."/>
|
||||
</then>
|
||||
<else>
|
||||
<if>
|
||||
<os family="windows"/>
|
||||
<then>
|
||||
<fail message="Composer not found! Go to http://getcomposer.org/download and download the Composer."/>
|
||||
</then>
|
||||
<else>
|
||||
<exec command="${composer.download_command}" checkreturn="true"/>
|
||||
<exec command="${composer.download_command}" checkreturn="true" passthru="true"/>
|
||||
</else>
|
||||
</if>
|
||||
</else>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<!-- Update Composer -->
|
||||
<composer command="selfupdate"/>
|
||||
<composer php="${composer.php}" composer="${composer.path}" command="selfupdate">
|
||||
<arg value="--ansi"/>
|
||||
</composer>
|
||||
</target>
|
||||
|
||||
<!-- Validates composer.* files -->
|
||||
<target name="app:composer-validate" description="Validates composer.* files">
|
||||
<echo msg="Validating composer.* files..."/>
|
||||
|
||||
<!-- Validate Composer -->
|
||||
<composer command="validate">
|
||||
<arg line="--no-check-all --strict"/>
|
||||
<target name="app:composer:validate" depends="app:composer:install">
|
||||
<composer php="${composer.php}" composer="${composer.path}" command="validate">
|
||||
<arg value="--no-check-all"/>
|
||||
<arg value="--strict"/>
|
||||
<arg value="--ansi"/>
|
||||
</composer>
|
||||
</target>
|
||||
|
||||
<!-- Project clean -->
|
||||
<target name="app:clean" description="Clears app's directories">
|
||||
<echo msg="Cleaning project..."/>
|
||||
<target name="app:clean">
|
||||
<if>
|
||||
<equals arg1="${env}" arg2="prod"/>
|
||||
<then>
|
||||
<echo message="[Skipped] Cleaning project (and directories cleanup) skipped, because of 'prod' environment..."/>
|
||||
<echo message="[Skipped] Cleaning project (and directories cleanup) -> 'prod' environment"/>
|
||||
</then>
|
||||
<else>
|
||||
<echo msg="Cleaning directories (making them empty)..."/>
|
||||
<foreach list="${directoriesToEmpty}" param="directory" target="app:clean:empty"/>
|
||||
</else>
|
||||
</if>
|
||||
|
||||
<echo msg="Preparing directories structure..."/>
|
||||
<foreach list="${directoriesToCheck}" param="directory" target="app:clean:check"/>
|
||||
|
||||
<echo msg="Creating .gitkeep files..."/>
|
||||
<touch file="${dir.cache}/.gitkeep"/>
|
||||
<touch file="${dir.logs}/.gitkeep"/>
|
||||
<touch file="${dir.sessions}/.gitkeep"/>
|
||||
|
||||
<echo msg="Setting permissions of directories..."/>
|
||||
<foreach list="${directoriesToEmpty}" param="directory" target="app:permissions"/>
|
||||
</target>
|
||||
|
||||
<!-- Cleaning directory (making empty) directory -->
|
||||
<target name="app:clean:empty" description="Empties directory">
|
||||
<target name="app:clean:empty">
|
||||
<if>
|
||||
<available file="${directory}" type="dir"/>
|
||||
<available file="${directory}" type="dir" property="dir_is_available"/>
|
||||
<then>
|
||||
<echo message="Cleaning directory (making empty) ${directory}..."/>
|
||||
<delete includeemptydirs="true" dir="${directory}"/>
|
||||
</then>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<!-- Checking if directory exists -->
|
||||
<target name="app:clean:check" description="Checks if directories exist">
|
||||
<target name="app:clean:check">
|
||||
<if>
|
||||
<not>
|
||||
<available file="${directory}" type="dir"/>
|
||||
<available file="${directory}" type="dir" property="dir_is_available"/>
|
||||
</not>
|
||||
<then>
|
||||
<if>
|
||||
@@ -121,40 +118,24 @@
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<!-- Project Install/update vendors -->
|
||||
<target name="app:vendors" description="Installs / updates vendors">
|
||||
<echo msg="Installing / updating vendors..."/>
|
||||
|
||||
<if>
|
||||
<istrue value="${composer.self-update}"/>
|
||||
<then>
|
||||
<composer php="${composer.php}" composer="${composer.path}" command="self-update"/>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<!-- Installs vendors -->
|
||||
<target name="app:composer:install" depends="app:composer:self-update">
|
||||
<composer php="${composer.php}" composer="${composer.path}" command="install">
|
||||
<arg value="--optimize-autoloader"/>
|
||||
<arg value="--prefer-dist"/>
|
||||
<arg value="--classmap-authoritative"/>
|
||||
<arg value="--ansi"/>
|
||||
</composer>
|
||||
</target>
|
||||
|
||||
<!-- Clearing cache -->
|
||||
<target name="app:cache" description="Clears project cache and logs">
|
||||
<echo msg="Clearing cache..."/>
|
||||
|
||||
<target name="app:cache">
|
||||
<if>
|
||||
<istrue value="${cache.clearWithWarmup}"/>
|
||||
<then>
|
||||
<echo message="...with warm up"/>
|
||||
|
||||
<SymfonyConsole console="bin/console" command="cache:clear">
|
||||
<arg name="env" value="${env}"/>
|
||||
</SymfonyConsole>
|
||||
</then>
|
||||
<else>
|
||||
<echo message="...without warm up"/>
|
||||
|
||||
<SymfonyConsole console="bin/console" command="cache:clear">
|
||||
<arg name="env" value="${env}"/>
|
||||
<arg name="no-warmup"/>
|
||||
@@ -164,9 +145,7 @@
|
||||
</target>
|
||||
|
||||
<!-- Clearing cache (faster) -->
|
||||
<target name="app:cache:faster" description="Clears project cache and logs (faster)">
|
||||
<echo msg="Clearing cache (faster)..."/>
|
||||
|
||||
<target name="app:cache:faster">
|
||||
<SymfonyConsole console="bin/console" command="cache:clear">
|
||||
<arg name="env" value="${env}"/>
|
||||
<arg name="no-optional-warmers"/>
|
||||
@@ -174,16 +153,14 @@
|
||||
</target>
|
||||
|
||||
<!-- Warming up cache -->
|
||||
<target name="app:cache:warmup" description="Warms up project cache">
|
||||
<echo msg="Warming up cache..."/>
|
||||
|
||||
<target name="app:cache:warmup">
|
||||
<SymfonyConsole console="bin/console" command="cache:warmup">
|
||||
<arg name="env" value="${env}"/>
|
||||
</SymfonyConsole>
|
||||
</target>
|
||||
|
||||
<!-- Setting permissions of given directory -->
|
||||
<target name="app:permissions" description="Sets permissions of one of the core directories">
|
||||
<target name="app:permissions">
|
||||
<if>
|
||||
<not>
|
||||
<os family="windows"/>
|
||||
|
||||
Reference in New Issue
Block a user