Skip to content

Commit

Permalink
Build phars with humbug (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Sep 27, 2018
1 parent 7d7e800 commit 702c377
Show file tree
Hide file tree
Showing 11 changed files with 3,242 additions and 3,182 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
.idea/
*.phar
build
tools
vendor/
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -37,5 +37,6 @@ after_success:

before_deploy:
- composer phar:install-tools
- composer require --no-script consolidation/Robo
- composer install --prefer-dist --no-dev --no-interaction
- php box.phar build
- tools/box compile
18 changes: 12 additions & 6 deletions CHANGELOG.md
@@ -1,11 +1,17 @@
# Changelog

### Unreleased
### 1.2.0 - 2018 Sept 26

* List pending changes here.
* Switch to building phars with [humbug/box](https://github.com/humbug/box)

### 0.1.0 - 2018/Mar/13
### 1.1.0 - 2018 May 26

* Customize source files when creating new project
* Create new GitHub repository and push code to it
* Enable Travis testing for new repository
* Add capability for configuration files

### 1.0.2 - 2018 Apr 10

* List other docs that must be customized after a new project is created from the template.

### 1.0.1 - 2018 Apr 8

* Remove 'tests' from .gitattributes, as we need that folder to customize our new projects.
23 changes: 1 addition & 22 deletions LICENSE
Expand Up @@ -21,25 +21,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

DEPENDENCY LICENSES:

Name Version License
consolidation/annotated-command 2.8.4 MIT
consolidation/config 1.1.0 MIT
consolidation/log 1.0.6 MIT
consolidation/output-formatters 3.2.1 MIT
consolidation/robo 1.3.0 MIT
container-interop/container-interop 1.2.0 MIT
dflydev/dot-access-data v1.1.0 MIT
grasmash/expander 1.0.0 MIT
grasmash/yaml-expander 1.4.0 MIT
league/container 2.4.1 MIT
psr/container 1.0.0 MIT
psr/log 1.0.2 MIT
symfony/console v3.4.14 MIT
symfony/debug v3.4.14 MIT
symfony/event-dispatcher v3.4.14 MIT
symfony/filesystem v3.4.14 MIT
symfony/finder v3.4.14 MIT
symfony/polyfill-ctype v1.9.0 MIT
symfony/polyfill-mbstring v1.9.0 MIT
symfony/process v3.4.14 MIT
symfony/yaml v3.4.14 MIT
Name Version License
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -193,7 +193,7 @@ Note that this simple release script does not support `alpha`, `beta` and other

### Commandline tool ###

Your project will be set up to build a commandline tool, and also includes commands to package it as a phar. If your project is a library, you might still wish to include a commandline tool to provide ad-hoc usage to your library functions, either for testing purposes, or perhaps to directly edit any data stores managed by your library. The commandline tool dependencies are declared in the `require-dev` section, so they will not be pulled in when your project is included as the dependency of some other project.
Your project will be set up to build a commandline tool, and also includes commands to package it as a phar using the [humbug/box](https://github.com/humbug/box) project. If your project is a library, you might still wish to include a commandline tool to provide ad-hoc usage to your library functions, either for testing purposes, or perhaps to directly edit any data stores managed by your library. The commandline tool dependencies are declared in the `require-dev` section, so they will not be pulled in when your project is included as the dependency of some other project.

If you do not want the commandline tool, simply delete the directories `src/Cli` and `tests/ExampleCommandsTest.php`, and also remove the `phar:*` commands in your composer.json file, and the files `example` and `box.json.dist`.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.1.8-dev
1.2.0-dev
24 changes: 2 additions & 22 deletions box.json.dist
@@ -1,25 +1,5 @@
{
"alias": "example.phar",
"chmod": "0755",
"compactors": [],
"directories": ["src"],
"files": ["example", "README.md", "VERSION"],
"finder": [
{
"name": "*.php",
"exclude": [
"test",
"tests",
"Test",
"Tests",
"Tester"
],
"in": "vendor"
}
],
"git-commit": "git-commit",
"git-version": "git-version",
"output": "example.phar",
"main": "example",
"stub": true
"output": "example.phar",
"files": ["example", "VERSION"]
}
15 changes: 6 additions & 9 deletions composer.json
Expand Up @@ -20,13 +20,10 @@
}
},
"require": {
"php": ">=5.5.0",
"consolidation/Robo": "^1.2.3",
"symfony/finder": "^2.8|^3|^4",
"symfony/filesystem": "^2.8|^3|^4"
"php": ">=5.5.0"
},
"require-dev": {
"symfony/console": "^2.8|^3|^4",
"consolidation/Robo": "^1.2.3",
"knplabs/github-api": "^2.7",
"php-http/guzzle6-adapter": "^1.1",
"phpunit/phpunit": "^5",
Expand All @@ -39,10 +36,10 @@
"CustomizeProject\\Customizer::customize"
],
"phar:install-tools": [
"gem install mime-types -v 2.6.2",
"curl -LSs https://box-project.github.io/box2/installer.php | php"
"mkdir -p tools",
"curl -L https://github.com/humbug/box/releases/download/3.0.0/box.phar -o tools/box",
"chmod +x tools/box"
],
"phar:build": "box build",
"cs": "phpcs --standard=PSR2 -n src",
"cbf": "phpcbf --standard=PSR2 -n src",
"unit": "phpunit --colors=always",
Expand All @@ -56,7 +53,7 @@
"@cs"
],
"release": [
"( sed -e 's/-dev$//' VERSION > VERSION.tmp && mv -f VERSION.tmp VERSION && ver=\"$(cat VERSION)\" && git add VERSION && git commit -m \"Version $ver\" && git tag \"$ver\" && git push origin \"$ver\" && a=( ${ver//./ } ) && ((a[2]++)) && echo \"${a[0]}.${a[1]}.${a[2]}-dev\" > VERSION && git add VERSION && git commit -m \"Back to -dev\" && git push origin master )"
"release VERSION"
],
"scenario": "scenarios/install",
"post-create-project-cmd": [
Expand Down

0 comments on commit 702c377

Please sign in to comment.