A set of Phing extensions.
This collection of Phing extensions provides:
- BumpBuildNumberTask
- LastCommitTimeTask
- ReadSemanticVersionTask
- RemoveEmptyDirectoriesTask
- SetDirectoryMTimeTask
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.
Name | Type | Description | Default | Required |
---|---|---|---|---|
File | string | Filename for storing the build number. | No | |
HaltOnError | bool | If true the build fails on errors, otherwise this task generates error events. | True | No |
BuildNumberProperty | string | The name of the property for publishing the build number. | No |
<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 sets the modification time of files to the last commit time in Git.
Name | Type | Description | Default | Required |
---|---|---|---|---|
Dir | string | The directory were under which the sources are located. Typically the build directory. | Yes | |
HaltOnError | bool | If true the build fails on errors, otherwise this task generates error events. | True | No |
<project>
<taskdef name="LastCommitTimeTask" classname="vendor.setbased.phing-extensions.src.Task.LastCommitTimeTask"/>
<LastCommitTimeTask Dir="build"/>
</project>
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.
Name | Type | Description | Default | Required |
---|---|---|---|---|
File | string | Filename for storing the entered SemanticVersion. | No | |
HaltOnError | bool | If true the build fails on errors, otherwise this task generates error events. | True | No |
VersionProperty | string | The name of the property for publishing the version (e.g. 1.2.3-alpha.1). | No | |
ReleaseProperty | string | The name of the property for publishing the major, minor, and patch version (e.g. 1.2.3). | No | |
MajorProperty | string | The name of the property for publishing the major version (e.g. 1). | No | |
MinorProperty | string | The name of the property for publishing the minor version (e.g. 2). | No | |
PatchProperty | string | The name of the property for publishing the patch version (e.g. 3). | No | |
PreReleaseProperty | string | The name of the property for publishing the pre-release version (e.g. alpha.1). | No |
<project>
<taskdef name="ReadSemanticVersion" classname="vendor.setbased.phing-extensions.src.Task.ReadSemanticVersionTask"/>
<ReadSemanticVersion File=".version" VersionProperty="VERSION"/>
<echo message="${VERSION}"/>
</project>
RemoveEmptyDirectoriesTask removes recursively empty directories under a parent directory.
Name | Type | Description | Default | Required |
---|---|---|---|---|
Dir | string | The parent directory under which empty directories must be removed. | True | |
RemoveParent | bool | If true the parent directory is removed as well if it is empty. | False | No |
HaltOnError | bool | If true the build fails on errors, otherwise this task generates error events. | True | No |
<project>
<taskdef name="RemoveEmptyDirs" classname="vendor.setbased.phing-extensions.src.Task.RemoveEmptyDirsTask"/>
<RemoveEmptyDirectoriesTask Dir="build/www/js" RemoveParent="false"/>
</project>
SetDirectoryMTimeTask sets recursively the modification time of directories to the maximum modification time of its entries.
Name | Type | Description | Default | Required |
---|---|---|---|---|
Dir | string | The parent directory. | True | |
HaltOnError | bool | If true the build fails on errors, otherwise this task generates error events. | True | No |
<project>
<taskdef name="SetDirectoryMTimeTask" classname="vendor.setbased.phing-extensions.src.Task.SetDirectoryMTimeTask"/>
<SetDirectoryMTimeTask Dir="build"/>
</project>
We recommend to install setbased/phing via Composer:
{
"require-dev": {
"setbased/phing-extensions": "2.*"
}
}