Project

General

Profile

1
#!/bin/sh
2

    
3
#
4
# Script to build compressed single file version of OpenLayers library
5
#
6

    
7
OUTPUT_FILENAME=OpenLayers.js
8
TMP_OUTPUT_FILENAME=tmp.${OUTPUT_FILENAME}
9

    
10
TOOLS_DIR=../tools
11

    
12
CFG_FILENAME=library.cfg
13

    
14
SRC_DIR=../lib
15

    
16
CMD_MERGE_JS=${TOOLS_DIR}/mergejs.py
17

    
18
CMD_SHRINKSAFE=${TOOLS_DIR}/shrinksafe.py
19
CMD_JSMIN=${TOOLS_DIR}/jsmin.py
20

    
21
LICENSE_HEADER_FILENAME=license.txt
22

    
23

    
24
## Generate "fat" single file library version
25
${CMD_MERGE_JS} -c ${CFG_FILENAME} ${TMP_OUTPUT_FILENAME} ${SRC_DIR}
26

    
27

    
28
## Compress ("shrink") the single file library version
29

    
30
echo
31
echo Shrinking and post-processing...
32
# (We also append the license header here.)
33
cat ${LICENSE_HEADER_FILENAME} > ${OUTPUT_FILENAME}
34
${CMD_JSMIN} <${TMP_OUTPUT_FILENAME} >> ${OUTPUT_FILENAME}
35

    
36
echo Cleaning up...
37
rm $TMP_OUTPUT_FILENAME
38

    
39
echo
40
echo Done.
(3-3/6)