setbased/phing-extensions

A collection of Phing extensions

3.2.0 2024-09-22 08:41 UTC

This package is auto-updated.

Last update: 2024-12-22 09:12:19 UTC


README

A set of Phing extensions.

Gitter License Latest Stable Version Scrutinizer Code Quality

Overview

This collection of Phing extensions provides:

  • BumpBuildNumberTask
  • LastCommitTimeTask
  • ReadSemanticVersionTask
  • RemoveEmptyDirectoriesTask
  • SetDirectoryMTimeTask

BumpBuildNumberTask

BumpBuildNumberTask bumps a build number to the next build number. The build number is published under supplied property for further usage in the Phing build script.

Parameters

Example

<project>
    <taskdef name="BumpBuildNumberTask" classname="\SetBased\Phing\Task\BumpBuildNumberTask"/>
    <BumpBuildNumberTask file=".build_number.txt" buildNumberProperty="BUILD_NUMBER" haltOnError="true"/>
    <echo message="${BUILD_NUMBER}"/>
</project>

LastCommitTimeTask

LastCommitTimeTask sets the modification time of files to the last commit time in Git.

Parameters

Example

<project>
    <taskdef name="LastCommitTimeTask" classname="vendor.setbased.phing-extensions.src.Task.LastCommitTimeTask"/>
    <LastCommitTimeTask Dir="build"/>
</project>

ReadSemanticVersionTask

ReadSemanticVersionTask asks the user for Semantic version and validates the given input is a valid Semantic version. The version and its parts are published under supplied properties for further usage in the Phing build script.

Parameters

Example

<project>
    <taskdef name="ReadSemanticVersion" classname="vendor.setbased.phing-extensions.src.Task.ReadSemanticVersionTask"/>
    <ReadSemanticVersion File=".version" VersionProperty="VERSION"/>
    <echo message="${VERSION}"/>
</project>

RemoveEmptyDirectoriesTask

RemoveEmptyDirectoriesTask removes recursively empty directories under a parent directory.

Parameters

Example

<project>
    <taskdef name="RemoveEmptyDirs" classname="vendor.setbased.phing-extensions.src.Task.RemoveEmptyDirsTask"/>
    <RemoveEmptyDirectoriesTask Dir="build/www/js" RemoveParent="false"/>
</project>

SetDirectoryMTimeTask

SetDirectoryMTimeTask sets recursively the modification time of directories to the maximum modification time of its entries.

Parameters

Example

<project>
    <taskdef name="SetDirectoryMTimeTask" classname="vendor.setbased.phing-extensions.src.Task.SetDirectoryMTimeTask"/>
    <SetDirectoryMTimeTask Dir="build"/>
</project>

Installation

We recommend to install setbased/phing via Composer:

{
  "require-dev": {
    "setbased/phing-extensions": "2.*"
  }
}