source: SRUAggregator/trunk/build.sh @ 6154

Last change on this file since 6154 was 6154, checked in by emanuel.dima@uni-tuebingen.de, 9 years ago
  1. beta-40: fixed bug in build script; improved 'more results' behavior
File size: 2.0 KB
Line 
1#!/bin/bash
2
3ASSETDIR=src/main/resources/assets
4LIBDIR=$ASSETDIR/lib
5FONTDIR=$ASSETDIR/fonts
6JSDIR=$ASSETDIR/js
7
8RUN_BOWER=
9BUILD_JSX=1
10BUILD_JAR=
11BUILD_GO=
12RUN_JAR=
13RUN_JAR_PRODUCTION=
14
15while [[ $# > 0 ]]
16do
17key="$1"
18# echo $# " :" $key
19case $key in
20    --bower)
21    RUN_BOWER=1
22    ;;
23    --jsx)
24    BUILD_JSX=1
25    ;;
26    --jar)
27    BUILD_JAR=1
28    ;;
29    --run)
30    RUN_JAR=1
31    ;;
32    --run-production)
33    RUN_JAR_PRODUCTION=1
34    ;;
35    *)
36    echo "Unknown option:" $1
37    exit 1
38    ;;
39esac
40shift
41done
42
43if [ $RUN_BOWER ]
44then
45        mkdir -p $LIBDIR
46        mkdir -p $FONTDIR
47        mkdir -p $JSDIR
48
49        npm install bower react-tools
50        node_modules/bower/bin/bower install jquery bootstrap react react-addons font-awesome
51
52        cp bower_components/bootstrap/dist/css/bootstrap.min.css $LIBDIR/
53        cp bower_components/bootstrap/dist/js/bootstrap.min.js $LIBDIR/
54        cp bower_components/jquery/dist/jquery.min.js $LIBDIR/
55        cp bower_components/jquery/dist/jquery.min.map $LIBDIR/
56        cp bower_components/react/react-with-addons.js $LIBDIR/
57        cp bower_components/react/react-with-addons.min.js $LIBDIR/
58        cp bower_components/font-awesome/css/font-awesome.min.css $LIBDIR/
59
60        cp bower_components/bootstrap/fonts/*  $FONTDIR/
61        cp bower_components/font-awesome/fonts/* $FONTDIR/
62fi
63
64if [ $BUILD_JSX ]
65then
66        echo; echo "---- jsx"
67        for f in $JSDIR/*.jsx; do
68                cp -v $f $JSDIR/`basename $f .jsx`.js;
69        done
70        node_modules/react-tools/bin/jsx --no-cache-dir $JSDIR $JSDIR
71fi
72
73if [ $BUILD_JAR ]
74then
75        echo; echo "---- mvn clean package"
76        mvn -q clean package
77fi
78
79if [ $RUN_JAR ]
80then
81        echo; echo "---- run devel"
82        JAR=`find target -iname 'aggregator-*.jar'`
83        echo java -cp src/main/resources:$JAR eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_devel.yml
84        java -cp src/main/resources:$JAR eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_devel.yml
85fi
86
87if [ $RUN_JAR_PRODUCTION ]
88then
89        echo; echo "---- run production"
90        JAR=`find target -iname 'aggregator-*.jar'`
91        echo java -jar $JAR server aggregator.yml
92        java -jar $JAR server aggregator.yml
93fi
Note: See TracBrowser for help on using the repository browser.