-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andriy Berestovskyy <[email protected]>
- Loading branch information
0 parents
commit f595770
Showing
33 changed files
with
14,831 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "i18n"] | ||
path = i18n | ||
url = https://github.com/WMEValidator/i18n.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## Path to Closure Compiler | ||
COMPILER=${HOME}/bin/compiler.jar | ||
|
||
EXT_NAME=WV | ||
EXT_FILE_NAME="WME_Validator" | ||
|
||
EXT_VER="1.1.20" | ||
CUR_VER="git" | ||
|
||
SRC_DIR="." | ||
DST_DIR="build" | ||
TMP_DIR="build/tmp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
. ./00.config.sh | ||
|
||
EXTRA_PARAMS="--compilation_level ADVANCED_OPTIMIZATIONS" | ||
|
||
. ./99.build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
. ./00.config.sh | ||
|
||
EXTRA_PARAMS="--define DEF_DEBUG=true \ | ||
--compilation_level SIMPLE_OPTIMIZATIONS \ | ||
--formatting PRETTY_PRINT" | ||
|
||
. ./99.build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "${SRC_DIR}" ]; then | ||
echo "No config found" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p "${TMP_DIR}" | ||
|
||
LOC_FILE="${TMP_DIR}/gen-i18n.js" | ||
rm -f "${LOC_FILE}" | ||
|
||
## Generate localization file | ||
cat "${SRC_DIR}/meta/i18n-begin.js" > "${LOC_FILE}" | ||
printf "Localizations:" | ||
for FILE in $(ls -r ${SRC_DIR}/i18n/*.js); do | ||
CODE="${FILE##*/}" | ||
CODE="${CODE%%.js}" | ||
if [ "${CODE}" = "default" ]; then | ||
CODE="EN" | ||
fi | ||
printf " ${CODE}" | ||
echo "\"${CODE}\": {" >> "${LOC_FILE}" | ||
echo "\".codeISO\": \"${CODE}\"," >> "${LOC_FILE}" | ||
cat "${FILE}" >> "${LOC_FILE}" | ||
echo "}, // ${CODE}" >> "${LOC_FILE}" | ||
done | ||
echo | ||
cat "${SRC_DIR}/meta/i18n-end.js" >> "${LOC_FILE}" | ||
|
||
java -jar "${COMPILER}" \ | ||
--language_in ECMASCRIPT5 \ | ||
--js "${SRC_DIR}/src/release.js" \ | ||
--js "${LOC_FILE}" \ | ||
--js "${SRC_DIR}/src/enc.js" \ | ||
--js "${SRC_DIR}/src/helpers.js" \ | ||
--js "${SRC_DIR}/src/data.js" \ | ||
--js "${SRC_DIR}/src/basic.js" \ | ||
--js "${SRC_DIR}/src/report.js" \ | ||
--js "${SRC_DIR}/src/validate.js" \ | ||
--js "${SRC_DIR}/src/login.js" \ | ||
--js "${SRC_DIR}/src/encrypted.js" \ | ||
--js "${SRC_DIR}/src/lib/i18n.js" \ | ||
--js "${SRC_DIR}/src/lib/audio.js" \ | ||
--js "${SRC_DIR}/src/lib/thui.js" \ | ||
--js "${SRC_DIR}/src/lib/compressor.js" \ | ||
--js "${SRC_DIR}/src/ext/tea-block.js" \ | ||
--js "${SRC_DIR}/src/ext/base64.js" \ | ||
--js "${SRC_DIR}/src/ext/utf8.js" \ | ||
--js "${SRC_DIR}/src/ext/sha256.js" \ | ||
--externs "${SRC_DIR}/meta/wme-externs.js" \ | ||
--externs "${SRC_DIR}/meta/jquery-1.9.js" \ | ||
--js_output_file "${TMP_DIR}/gen-${EXT_NAME}-compiled.js" \ | ||
--use_types_for_optimization \ | ||
--warning_level=VERBOSE \ | ||
--jscomp_warning=checkTypes \ | ||
--jscomp_warning=missingProperties \ | ||
--jscomp_off es5Strict \ | ||
--process_jquery_primitives \ | ||
${EXTRA_PARAMS} | ||
|
||
if [ $? != 0 ]; then | ||
read -p "Stop on error. Press enter to exit..." | ||
exit 1 | ||
fi | ||
|
||
mkdir -p "${DST_DIR}" | ||
cat "${SRC_DIR}/meta/meta-begin.js" \ | ||
"${TMP_DIR}/gen-${EXT_NAME}-compiled.js" \ | ||
"${SRC_DIR}/meta/meta-end.js" \ | ||
> "${DST_DIR}/${EXT_FILE_NAME}.user.js" |
Oops, something went wrong.