Question

I've downloaded the current version of PHPUnit from Github and made a small customization. I now want to create my own phar archive for it. I see there is a build.xml file included with PHPUnit that looks like it contains the directives needed for creation of the phar archive, but after reading up on phar for a bit, it's still not clear to me what the commands are to make it happen for PHPUnit. Any advise is appreciated!

No correct solution

OTHER TIPS

Cloning the repo. I guess you have this already but to be complete

$ git clone https://github.com/sebastianbergmann/phpunit

Change into it

$ cd phpunit

A build.xml files means (mostly) that Ant is used as build management system. To figure out which targets the project (-p) provides just ask ant itself:

$ ant -p

Then you should get this output:

Buildfile: /private/tmp/phpunit/build.xml

Main targets:

clean       Cleanup build artifacts
composer    Install dependencies with Composer
pdepend     Calculate software metrics using PHP_Depend
pear        Create PEAR package of PHPUnit and all its dependencies (release)
phar        Create PHAR archive of PHPUnit and all its dependencies (release)
phar-alpha  Create PHAR archive of PHPUnit and all its dependencies (alpha)
phar-beta   Create PHAR archive of PHPUnit and all its dependencies (beta)
phpab       Generate autoloader script
phpcpd      Find duplicate code using PHPCPD
phpcs       Find coding standard violations using PHP_CodeSniffer
phpcs-ci    Find coding standard violations using PHP_CodeSniffer
phpdox      Generate software project documentation using phpDox
phploc      Measure project size using PHPLOC
phpmd       Perform project mess detection using PHPMD
phpmd-ci    Perform project mess detection using PHPMD
phpunit     Run unit tests with PHPUnit
prepare     Prepare for build

Default target: build

The rest is simple - just type

$ ant phar

The task will install Composer (even if you already have it, but copies it into the current folder) and downloads all dependencies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top