Skip to content

Commit

Permalink
Merge pull request #4 from hendrikmaus/update-drafter
Browse files Browse the repository at this point in the history
Update drafter to 3.0.0
  • Loading branch information
hendrikmaus authored Aug 6, 2016
2 parents 2c19f70 + 81fb2da commit 582e699
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ language: php
php:
- 5.6
- 7.0
- 7.1
- hhvm

matrix:
Expand All @@ -11,11 +12,16 @@ matrix:
- php: hhvm

before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
- sudo apt-get install -y g++

install:
- sudo apt-get install -yqq g++-4.8
- export CXX="g++-4.8"

before_script:
- composer install --prefer-source --no-interaction --dev
- composer install-drafter
- git config --global user.name travis-ci
- git config --global user.email [email protected]

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The change log itself is written the way that [keepachangelog.com](http://keepac

## [Unreleased]

## [4.0.0] - 2016-08-05
## Changed
- Update drafter dependency to v3.0.0 [BC]

## [3.0.0] - 2016-03-31
## Changed
- Updated drafter dependency to v2.2.0 in composer.json and readme [BC]
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,22 @@ If you do not already have, add a `scripts` section to your root composer.json:
"scripts": {
"post-install-cmd": [
"if ! [[ -d ext/drafter ]]; then echo \"### Installing drafter to ./ext; drafter bin to ./vendor/bin/ ###\"; fi",
"if ! [[ -d ext/drafter ]]; then git clone --branch v2.2.0 --recursive https://github.com/apiaryio/drafter.git ext/drafter; fi",
"if ! [[ -d ext/drafter ]]; then git clone --branch v3.0.0 --recursive https://github.com/apiaryio/drafter.git ext/drafter; fi",
"if ! [[ -d vendor/bin ]]; then mkdir -p vendor/bin; fi",
"if ! [[ -f vendor/bin/drafter ]]; then cd ext/drafter && ./configure && make drafter; fi",
"if ! [[ -f vendor/bin/drafter ]]; then cd vendor/bin && ln -s ../../ext/drafter/bin/drafter drafter; fi"
]
}
```

> Note: the above example checks out a specific given tag `v2.2.0`
> Note: the above example checks out a specific given tag `v3.0.0`
Now run `composer install`; it should start building drafter within an `ext/` folder in your project root.
If you want the script to put drafter somewhere else, modify every occurrence of `ext/drafter` to another one.

> Note: there is an open Composer feature request for downloading binaries and
> compiling from source: https://github.com/composer/composer/issues/4381
> compiling from source: https://github.com/composer/composer/issues/4381
> Update: The feature was closed without being tackled for the time being
You would see this method used by default, when [contributing to drafter-php](CONTRIBUTING.md).
Installing Drafter using composer has only been tested on **Mac OS X and Linux (Ubuntu 12)**.
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@
},
"scripts": {
"clean": "rm -rf vendor/ ext/ composer.lock",
"post-install-cmd": [
"test": "vendor/bin/phpunit",
"quicktest": "vendor/bin/phpunit --no-coverage",
"install-drafter": [
"if ! [[ -d ext/drafter ]]; then echo \"### Installing drafter to ./ext; drafter bin to ./vendor/bin/ ###\"; fi",
"if ! [[ -d ext/drafter ]]; then git clone --branch v2.2.0 --recursive https://github.com/apiaryio/drafter.git ext/drafter; fi",
"if ! [[ -d ext/drafter ]]; then git clone --branch v3.0.0 --recursive https://github.com/apiaryio/drafter.git ext/drafter; fi",
"if ! [[ -d vendor/bin ]]; then mkdir -p vendor/bin; fi",
"if ! [[ -f vendor/bin/drafter ]]; then cd ext/drafter && ./configure && make drafter; fi",
"if ! [[ -f vendor/bin/drafter ]]; then cd vendor/bin && ln -s ../../ext/drafter/bin/drafter drafter; fi"
]
],
"post-install-cmd": "@install-drafter"
}
}

0 comments on commit 582e699

Please sign in to comment.