Skip to content

Commit 043a225

Browse files
committed
Cleanup the build scripts
1 parent 05e0f6b commit 043a225

File tree

6 files changed

+43
-5
lines changed

6 files changed

+43
-5
lines changed

packages/playground/data-liberation/README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ This project aims to help the Data Liberation project and unlock powerful new
44
use cases for WordPress. See [the rationale](RATIONALE.md) and [the plan](PLAN.md)
55
for more details.
66

7-
### Getting started
7+
### Building
88

9-
No instructions yet. TBD.
9+
#### Core libraries (data-liberation-core.phar)
10+
11+
The `nx build:phar playground-data-liberation` command builds the standalone
12+
dist/core-data-liberation.phar.gz file meant for use in the importWxr Blueprint
13+
step. It is built with Box and brings in all the classes required to import the
14+
WXR files, including WP_Stream_Importer, AsyncHttp\Client, and WP_XML_Processor.
15+
16+
The phar is optimized for size and doesn't include the markdown importer and its
17+
dependencies.
18+
19+
#### Full plugin (data-liberation-plugin.zip)
20+
21+
The `nx build:plugin playground-data-liberation` command builds the
22+
dist/data-liberation-plugin.zip file, which contains all the plugin libraries, the
23+
wp-admin page, JavaScript files, etc.
Binary file not shown.

packages/playground/data-liberation/core-build.sh renamed to packages/playground/data-liberation/phar-core-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DIST_DIR=$DATA_LIBERATION_DIR/dist
1717

1818
rm $DIST_DIR/data-liberation-core.* > /dev/null 2>&1 || true
1919
export BOX_BASE_PATH=$(type -a box | grep -v 'alias' | awk '{print $3}')
20-
php $BUILD_DIR/box.php compile -d $DATA_LIBERATION_DIR -c $DATA_LIBERATION_DIR/core-box.json
20+
php $BUILD_DIR/box.php compile -d $DATA_LIBERATION_DIR -c $DATA_LIBERATION_DIR/phar-core-box.json
2121
cd $DIST_DIR
2222
php $BUILD_DIR/smoke-test.php
2323
gzip data-liberation-core.phar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
echo "Running the full build of the data liberation plugin"
4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
6+
# Only include the subset of blueprints-library that we need
7+
# for the importers to work. Don't include the PHP Blueprint
8+
# library yet.
9+
zip -r ./dist/data-liberation-plugin.zip ./*.php ./src \
10+
./blueprints-library/src/WordPress/AsyncHttp \
11+
./blueprints-library/src/WordPress/Zip \
12+
./blueprints-library/src/WordPress/Util \
13+
./blueprints-library/src/WordPress/Streams \
14+
./vendor
15+
16+
echo "Done"

packages/playground/data-liberation/project.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@
1212
"parallel": false
1313
}
1414
},
15-
"build": {
15+
"build:phar": {
1616
"executor": "nx:run-commands",
1717
"options": {
1818
"cwd": "packages/playground/data-liberation",
19-
"commands": ["bash ./core-build.sh"],
19+
"commands": ["bash ./phar-core-build.sh"],
20+
"parallel": false
21+
}
22+
},
23+
"build:plugin": {
24+
"executor": "nx:run-commands",
25+
"options": {
26+
"cwd": "packages/playground/data-liberation",
27+
"commands": ["bash ./plugin-build.sh"],
2028
"parallel": false
2129
}
2230
},

0 commit comments

Comments
 (0)