-
Notifications
You must be signed in to change notification settings - Fork 20
Fixed #138 Added PHP-Scoper to build to prevent dependency conflicts. #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,3 +43,5 @@ intermediate | |
| cache | ||
| node_modules | ||
| vendor | ||
| dist | ||
| build | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #! /bin/sh | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering about testing. Do we, or could we, have tests that ensure that the package as built by this script functions correctly? (For example, could we have the existing test suite test what's built by this script.)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to think about this one for a while. We probably could add tests. We would need to install the test dependencies in seperate vendor directory e.g. I believe at that point the |
||
|
|
||
| set -e | ||
|
|
||
| echo "Building plugin ..." | ||
|
|
||
| ROOT_DIR=$(realpath "$(dirname "$(dirname "$0")")") | ||
|
|
||
| rm -rf "$ROOT_DIR/build" | ||
| mkdir -p "$ROOT_DIR/build" | ||
|
|
||
| echo " - Copying files to build/ ..." | ||
|
|
||
| cp -r "$ROOT_DIR/mu-plugin/" "$ROOT_DIR/build/mu-plugin/" | ||
| cp -r "$ROOT_DIR/public/" "$ROOT_DIR/build/public/" | ||
| cp -r "$ROOT_DIR/src/" "$ROOT_DIR/build/src/" | ||
| cp -r "$ROOT_DIR/templates/" "$ROOT_DIR/build/templates/" | ||
| cp "$ROOT_DIR/composer.json" "$ROOT_DIR/build/" | ||
| cp "$ROOT_DIR/composer.lock" "$ROOT_DIR/build/" | ||
| cp "$ROOT_DIR/LICENSE" "$ROOT_DIR/build/" | ||
| cp "$ROOT_DIR/README.md" "$ROOT_DIR/build/" | ||
| cp "$ROOT_DIR/readme.txt" "$ROOT_DIR/build/" | ||
| cp "$ROOT_DIR/rollbar.php" "$ROOT_DIR/build/" | ||
|
|
||
| echo " - Installing dependencies with Composer ..." | ||
|
|
||
| cd "$ROOT_DIR/build" | ||
|
|
||
| composer install --no-dev --optimize-autoloader | ||
|
|
||
| echo " - Namespace prefixing with PHP-Scoper ..." | ||
|
|
||
| cd "$ROOT_DIR" | ||
|
|
||
| rm -rf "$ROOT_DIR/dist" | ||
| vendor/bin/php-scoper add-prefix "$ROOT_DIR/build" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - intentional to add the space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... that was supposed to be on the other side of the quote. Thanks!