Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Aug 29, 2019
0 parents commit bcd1688
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
composer.lock
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015-2019 Phpro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " run to perform GrumPHP tests"
@echo " compile to compile a shim"

compile:
$(if $(TAG),,$(error TAG is not defined. Pass via "make compile TAG=4.2.1"))
@echo Compiling $(TAG)
BUILD_DIR := $(mktemp -d -t grumphp-shim-build)
@echo Cloning GrumPHP $(TAG) in directory $(BUILD_DIR)
cd $(BUILD_DIR) && git clone [email protected]:phpro/grumphp.git && git checkout tags/$(TAG)
./vendor/bin/box compile --config="box.json" --working-dir=$(BUILD_DIR)
# rmdir -r $(BUILD_DIR)
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# GrumPHP shim

This package provides GrumPHP without the struggle of installing all of its dependencies.

## Usage

Install the package

```bash
composer require --dev phpro/grumphp-shim
```

and use it like the original executable

```bash
vendor/bin/grumphp.phar run
```

Check out the main repo for more options [https://github.com/phpro/grumphp](https://github.com/phpro/grumphp).
16 changes: 16 additions & 0 deletions box.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"alias": "grumphp.phar",
"banner": false,
"force-autodiscovery": true,
"check-requirements": true,
"compactors": [
"KevinGH\\Box\\Compactor\\PhpScoper"
],
"files": ["LICENSE"],
"directories": [
"resources",
"src",
"vendor"
],
"output": "grumphp.phar"
}
45 changes: 45 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "phpro/grumphp-shim",
"description": "GrumPHP Phar distribution",
"type": "composer-plugin",
"license": ["MIT"],
"authors": [
{
"name": "Toon Verwerft",
"email": "[email protected]"
},
{
"name": "Community",
"homepage": "https://github.com/phpro/grumphp/graphs/contributors"
}
],
"bin": [
"grumphp",
"grumphp.phar"
],
"require": {
"php": "^7.1",
"ext-json": "*",
"composer-plugin-api": "~1.0"
},
"require-dev": {
"humbug/box": "^3.8"
},
"replace": {
"phpro/grumphp": "self.version"
},
"config": {
"sort-packages": true
},
"extra": {
"class": "GrumPHP\\Composer\\GrumPHPPlugin"
},
"autoload": {
"psr-4": {
"GrumPHP\\": "src"
}
},
"archive": {
"exclude": ["Makefile", "box.json"]
}
}
17 changes: 17 additions & 0 deletions src/Composer/GrumPHPPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace GrumPHP\Plugin;

use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;

class GrumPHPPlugin implements PluginInterface
{
public function activate(Composer $composer, IOInterface $io)
{
$io->write('<fg=yellow>GrumPHP shim registered. you\'ll need to activate grumphp manually for now.</fg=yellow>');
}
}

0 comments on commit bcd1688

Please sign in to comment.