Skip to content

Commit

Permalink
Merge branch 'release/0.9.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed May 22, 2018
2 parents 79c2800 + c61131b commit 4d969a0
Show file tree
Hide file tree
Showing 62 changed files with 4,101 additions and 730 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
20 changes: 9 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
build-vendor/
vendor/
composer.lock
composer-compat.json
composer-compat.lock
manual/
dist/
__pycache__
.php_cs.cache
psysh.phar
psysh-compat.phar
/build/
/dist/
/composer.lock
/manual/
/psysh
/__pycache__
/.php_cs.cache
/vendor/
/vendor-bin/*/vendor/
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ matrix:
- php: 5.4
env: 'COMPOSER_FLAGS="--prefer-lowest --prefer-stable"'
- php: hhvm
fast_finish: true

install: travis_retry composer update --no-interaction $COMPOSER_FLAGS

script: vendor/bin/phpunit --verbose
script:
- vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
- '[[ $TRAVIS_PHP_VERSION = 7.2* ]] && make build || true'

before_deploy: bin/package -v $TRAVIS_TAG
after_success:
- bash <(curl -s https://codecov.io/bash)

before_deploy: make dist

deploy:
provider: releases
Expand All @@ -35,4 +41,4 @@ deploy:
on:
tags: true
repo: bobthecow/psysh
condition: (($TRAVIS_PHP_VERSION = 5.4* && -z "$COMPOSER_FLAGS") || $TRAVIS_PHP_VERSION = 7.0*)
condition: $TRAVIS_PHP_VERSION = 7.2*
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2012-2017 Justin Hileman
Copyright (c) 2012-2018 Justin Hileman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
93 changes: 93 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
PSYSH_SRC = bin src box.json.dist composer.json build/stub
PSYSH_SRC_FILES = $(shell find src -type f -name "*.php")
VERSION = $(shell git describe --tag --always --dirty=-dev)

COMPOSER_OPTS = --no-interaction --no-progress --verbose
COMPOSER_REQUIRE_OPTS = $(COMPOSER_OPTS) --no-update
COMPOSER_UPDATE_OPTS = $(COMPOSER_OPTS) --prefer-stable --no-dev --classmap-authoritative --prefer-dist


# Commands

.PHONY: help clean build dist
.DEFAULT_GOAL := help

help:
@echo "\033[33mUsage:\033[0m\n make TARGET\n\n\033[33mTargets:\033[0m"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-7s\033[0m %s\n", $$1, $$2}'

clean: ## Clean all created artifacts
rm -rf build/*
rm -rf dist/*
rm -rf vendor-bin/*/vendor/

build: ## Compile PHARs
build: build/psysh/psysh build/psysh-compat/psysh build/psysh-php54/psysh build/psysh-php54-compat/psysh

dist: ## Build tarballs for distribution
dist: dist/psysh-$(VERSION).tar.gz dist/psysh-$(VERSION)-compat.tar.gz dist/psysh-$(VERSION)-php54.tar.gz dist/psysh-$(VERSION)-php54-compat.tar.gz


# All the composer stuffs

composer.lock: composer.json
composer install
touch $@

vendor/autoload.php: composer.lock
composer install
touch $@

vendor/bin/box: vendor/autoload.php
composer bin box install
touch $@


# Lots of PHARs

build/stub: bin/build-stub bin/psysh LICENSE
bin/build-stub

build/psysh: $(PSYSH_SRC) $(PSYSH_SRC_FILES)
rm -rf $@ || true
mkdir $@
cp -R $(PSYSH_SRC) $@/
composer config --working-dir $@ platform.php 7.0
composer require --working-dir $@ $(COMPOSER_REQUIRE_OPTS) php:'>=7.0.0'
composer update --working-dir $@ $(COMPOSER_UPDATE_OPTS)

build/psysh-compat: $(PSYSH_SRC) $(PSYSH_SRC_FILES)
rm -rf $@ || true
mkdir $@
cp -R $(PSYSH_SRC) $@/
composer config --working-dir $@ platform.php 7.0
composer require --working-dir $@ $(COMPOSER_REQUIRE_OPTS) php:'>=7.0.0'
composer require --working-dir $@ $(COMPOSER_REQUIRE_OPTS) symfony/polyfill-iconv symfony/polyfill-mbstring hoa/console
composer update --working-dir $@ $(COMPOSER_UPDATE_OPTS)

build/psysh-php54: $(PSYSH_SRC) $(PSYSH_SRC_FILES)
rm -rf $@ || true
mkdir $@
cp -R $(PSYSH_SRC) $@/
composer config --working-dir $@ platform.php 5.4
composer update --working-dir $@ $(COMPOSER_UPDATE_OPTS)

build/psysh-php54-compat: $(PSYSH_SRC) $(PSYSH_SRC_FILES)
rm -rf $@ || true
mkdir $@
cp -R $(PSYSH_SRC) $@/
composer config --working-dir $@ platform.php 5.4
composer require --working-dir $@ $(COMPOSER_REQUIRE_OPTS) symfony/polyfill-iconv symfony/polyfill-mbstring hoa/console:^2.15
composer update --working-dir $@ $(COMPOSER_UPDATE_OPTS)

build/%/psysh: vendor/bin/box build/%
vendor/bin/box compile --working-dir $(dir $@)


# Dist packages

dist/psysh-$(VERSION).tar.gz: build/psysh/psysh
tar -czf $@ $<

dist/psysh-$(VERSION)-%.tar.gz: build/psysh-%/psysh
tar -czf $@ $<
13 changes: 0 additions & 13 deletions bin/build

This file was deleted.

Loading

0 comments on commit 4d969a0

Please sign in to comment.