Skip to content

Commit

Permalink
chore: add scripts and docs for common dev tasks (zanata#1134)
Browse files Browse the repository at this point in the history
Add another script to build zanata.war and document any useful scripts which developers might use to get started or do development with Zanata.
  • Loading branch information
carlosmunoz committed Apr 12, 2016
1 parent 23ef404 commit 72d07f0
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,36 @@ translators in seconds.
Zanata is Free software, licensed under the [LGPL][].

[LGPL]: http://www.gnu.org/licenses/lgpl-2.1.html

Developers
----------

### Prerequisites

You will need:
- Java SDK 8 (OpenJDK recommended)
- npm
- Mysql or MariaDB
- JBoss EAP 6 or Wildfly

### Building

#### Quickly build a .war file

[`etc/scripts/quickbuild.sh`](etc/scripts/quickbuild.sh) - Builds the project
as quickly as possible, targeting both Firefox and Chrome when building GWT
components, and skipping all checks and verifications (i.e. tests, checkstyle, etc)

If you wish to build GWT components for chrome or firefox only, you can specify the
`-c` and `-f` arguments respectively.

The `-h` argument prints the script's help.

#### Build and run a server for testing

[`etc/scripts/cargowait.sh`](etc/scripts/cargowait.sh) - Builds the Zanata artifact
and starts a JBoss server using the cargo plugin. This script is particularly
useful for starting a Zanata instance with the aim of running functional tests
from an IDE.

The `-h` argument prints the script's help.
41 changes: 41 additions & 0 deletions etc/scripts/quickbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
#set -x

function usage {
echo ">> Run this script to quickly build the Zanata web archive" >&2
echo ">>>> -c Only build GWT components for Chrome (incompatible with -f)" >&2
echo ">>>> -f Only build GWT components for Firefox (incompatible with -c)" >&2
echo ">>>> Default GWT build is both Chrome and Firefox" >&2
exit 0;
}

gwtMode="-Dchromefirefox"
while getopts "cfh" opt; do
case ${opt} in
c)
if [ $gwtMode == "-Dfirefox" ]
then usage
fi
gwtMode="-Dchrome"
echo ">> Building GWT for Google Chrome"
;;
f)
if [ $gwtMode == "-Dchrome" ]
then usage
fi
gwtMode="-Dfirefox"
echo ">> Building GWT for Mozilla Firefox"
;;
h)
usage
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1;
;;
esac
done

DIR="$( cd -P "$( dirname "$0" )" && pwd )"
cd $DIR/../..
mvn -DskipArqTests -DskipUnitTests -Danimal.sniffer.skip $gwtMode -am -pl zanata-war package

0 comments on commit 72d07f0

Please sign in to comment.