-
Notifications
You must be signed in to change notification settings - Fork 62
/
cldr-generate-json.sh
55 lines (47 loc) · 1.59 KB
/
cldr-generate-json.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# Copyright © 1991-2023 Unicode, Inc. All rights reserved. Distributed under
# the Terms of Use in http://www.unicode.org/copyright.html.
#
# Creates JSON data under ./cldr-json in this directory.
. ./cldr-config.sh
if [ -x ./local-config.sh ];
then
echo "Using local-config.sh"
. ./local-config.sh
fi
if [[ -z "$VERSION" ]];
then
echo "VERSION is undefined, exiting from $0"
exit 1
fi
# for now, seed has to exist.
mkdir -p -v ${OUT} ${INDATA}/seed/main ${INDATA}/seed/annotations ${DIST}
MAIN_CLASS=org.unicode.cldr.json.Ldml2JsonConverter
export MAVEN_OPTS="-Xmx16384m -Dexec.cleanupDaemonThreads=false -Dexec.mainClass=${MAIN_CLASS}"
MVN="mvn ${MVN_OPTS} --file=${CLDR_DIR}/tools/pom.xml -pl cldr-code"
MVN_COMPILE="${MVN} compile"
MVN_EXEC="${MVN} -DCLDR_DIR=${INDATA} exec:java"
set -x
${MVN_COMPILE} || exit 1
for type in ${TYPES}; do
${MVN_EXEC} -Dexec.args="-m ${MATCH} -p true -o true -r true -t ${type} -d ${OUT} -s ${DRAFTSTATUS} -V ${VERSION} ${EXTRA_JSON_OPTS}" || exit 1
done
echo "Finshed converting '${TYPES}' to ${OUT}"
if [ -x ./local-config.sh ];
then
echo "REMINDER: you have a local-config.sh - may not be a standard build"
fi
## Example options for the generator:
#[-p, true, -o, false, -r, true, -t, supplemental, -d, ./cldr-json, -s, contributed]
#-c commondir ≝ /Users/srl295/src/cldr-staging/production/common/
#-d destdir ≔ ./cldr-json
#-m match ≝ .*
#-t type ≔ supplemental
#-r resolved ≔ true
#-s draftstatus ≔ contributed
#-l coverage ≝ optional
#-n fullnumbers ≝ false
#-o other ≔ false
#-p packages ≔ true
#-i identity ≝ true