Merge "Added reset-css node module to fix styling"
[osm/UI.git] / skyquake / scripts / build-plugin.sh
1 #!/bin/bash
2
3 #
4 # Copyright 2017 RIFT.IO Inc
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18
19 abort()
20 {
21 echo >&2 '
22 ***************
23 *** ABORTED ***
24 ***************
25 '
26 echo "An error occurred. Exiting..." >&2
27 exit 1
28 }
29
30 trap 'abort' 0
31
32 set -e
33
34 # Add your script below....
35 # If an error occurs, the abort() function will be called.
36 #----------------------------------------------------------
37 CMAKE_BUILD=true
38
39 # change to the directory of this script
40 cd $PLUGIN_DIR
41 cd ..
42
43 echo 'Building plugin '$PLUGIN_NAME
44 echo 'Fetching third-party node_modules for '$PLUGIN_NAME
45 npm install
46 echo 'Fetching third-party node_modules for '$PLUGIN_NAME'...done'
47 echo 'Packaging '$PLUGIN_NAME' using webpack'
48 ui_plugin_cmake_build=$CMAKE_BUILD ./node_modules/.bin/webpack --optimize-minimize --progress --config webpack.production.config.js --bail
49 echo 'Packaging '$PLUGIN_NAME' using webpack... done'
50 echo 'Packaging debug version of '$PLUGIN_NAME' using webpack'
51 ui_plugin_cmake_build=$CMAKE_BUILD ./node_modules/.bin/webpack --progress --config webpack.production.config.js --production-debug --bail
52 echo 'Packaging '$PLUGIN_NAME' using webpack... done'
53 echo 'Building plugin '$PLUGIN_NAME'... done'
54 # Done!
55 trap : 0
56
57 echo >&2 '
58 ************
59 *** DONE ***
60 ************
61 '