elnebuloso/phing-commons

此包已被放弃,不再维护。未建议替代包。

phing commons 构建栈

9.4.0 2016-11-25 20:57 UTC

README

abandoned

关于

这是一个使用PHING作为构建工具的完整交付构建栈。Phing Commons构建栈为您提供了预定义的目标,您可以通过build.properties文件进行配置。

安装

composer create-project elnebuloso/phing-commons /path/to/your/phing-commons-installation

使用方法

在项目根目录下创建build.xml文件,内容如下。要使用Phing Commons,只需调用/path/to/your/phing-commons-installation/bin/phing

<?xml version="1.0" encoding="UTF-8"?>


<project basedir="." default="help">


    <!-- ============================================ -->
    <!-- import phing commons                         -->
    <!-- ============================================ -->
    <import file="${phing.home}/../../../commons/commons.xml" />


</project>

配置

如果您想配置通用目标,请在项目根目录下使用build.properties文件。对于本地添加或本地行为,添加build.properties.local文件。这是一个可选文件。对于全局添加,添加/[home]/phing-commons/build.properties文件。这是一个可选文件。但不要将build.properties.local提交到您的VCS。

build.properties文件是可选的,并在可用时加载。

构建链

每个调用的步骤都会调用之前定义的步骤。如果运行phing init,则init在clean之前调用。如果运行phing build,则build调用完整链。

  • build:before
  • clean:before
  • clean:main
  • clean:after
  • clean
  • init:before
  • init:main
  • init:after
  • init
  • test:before
  • test:main
  • test:after
  • test
  • bundle:before
  • bundle:main
  • bundle:after
  • bundle
  • package:before
  • package:main
  • package:after
  • package
  • deploy:before
  • deploy:main
  • deploy:after
  • deploy
  • build:main
  • build:after
  • build

操作链

要操作步骤,您可以在XML中覆盖每个步骤,就像这样。

<target name="test:main" hidden="true" depends="test.phplint, test.phpunit" />

如果您想使用phing-commons预定义的链,可以将此列表添加到属性中:project.chains。使用逗号分隔链

  • project.chains = php-composer-package
  • project.chains = foo,bar,baz

默认链

在链中,clean:main调用

  • clean.tmp:init
  • clean.tmp:before
  • clean.tmp:main
  • clean.tmp:after
  • clean.tmp

php-composer-package 链

在链中,init:main调用

  • composer.validate:init
  • composer.validate:before
  • composer.validate:main
  • composer.validate:after
  • composer.validate
  • composer.update:init
  • composer.update:before
  • composer.update:main
  • composer.update:after
  • composer.update

在默认链中,test:main调用

  • test.phplint:init
  • test.phplint:before
  • test.phplint:main
  • test.phplint:after
  • test.phplint
  • test.phpunit:init
  • test.phpunit:before
  • test.phpunit:main
  • test.phpunit:after
  • test.phpunit

链接