netty5/run-example.sh
Trustin Lee c77375cf54 Clean up example execution
Motivation:

- example/pom.xml has quite a bit of duplication.
- We expect that we depend on npn-boot in more than one module in the
  near future. (e.g. handler, codec-http, and codec-http2)

Modification:

- Deduplicate the profiles in example/pom.xml
- Move the build configuration related with npn-boot to the parent pom.
- Add run-example.sh that helps a user launch an example easily

Result:

- Cleaner build files
- Easier to add a new example
- Easier to launch an example
- Easier to run the tests that relies on npn-boot in the future
2014-05-20 20:09:05 +09:00

16 lines
371 B
Bash
Executable File

#!/bin/bash -e
cd "`dirname "$0"`"/example
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <example-name>" >&2
echo >&2
echo "Available examples:" >&2
grep -E '^ <id>[-a-z0-9]*</id>' pom.xml | sed -e 's#\(^.*<id>\|</id>.*$\)##g' | sed -e 's#^# #' >&2
exit 1
fi
EXAMPLE_NAME="$1"
echo "[INFO] Running: $EXAMPLE_NAME"
mvn -X -P "$EXAMPLE_NAME" compile exec:exec