tomegantech/git-meta-data-phing-tasks

A small collection of tasks for obtaining meta-data for a git repo as properties in your phing build file.

v1.0.2 2023-06-26 19:59 UTC

This package is auto-updated.

Last update: 2024-11-26 22:58:49 UTC


README

A small collection of Phing tasks for obtaining meta data for a git repo as properties in your build file.

Installation

These tasks can be installed with Composer.

composer require "tomegantech/git-meta-data-phing-tasks"

Usage

The tasks can the be used in your build.xml:

<taskdef name="git-branch-name" classname="TomEganTech\GitMetaDataPhingTasks\GitBranchNameTask" />
<git-branch-name property="build.branchName" />
<taskdef name="git-commit-id" classname="TomEganTech\GitMetaDataPhingTasks\GitCommitIdTask" />
<git-commit-id property="build.commitId" />

Dependencies

  • Phing 3.0+

Note you do not need a git executable as this library reads the git metadata from the filesystem. Though typically a risky design choice as changes to git internals would break these tasks, the files involved have not changed for multiple major versions and not having a functioning git executable was a design constraint of the work which prompted the creation of this library.