-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathcldr-generate-json.sh
More file actions
executable file
·67 lines (55 loc) · 1.81 KB
/
cldr-generate-json.sh
File metadata and controls
executable file
·67 lines (55 loc) · 1.81 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
#!/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.
set -e
. ./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
export MAVEN_OPTS="-Xmx16384m -Dexec.cleanupDaemonThreads=false"
MVN="mvn ${MVN_OPTS} --file=${CLDR_DIR}/tools/pom.xml -pl cldr-code"
set -x
${MVN} compile
if [[ "$INDATA" == "generate" ]];
then
export INDATA="target/data"
mkdir -p "${INDATA}"
${MVN} exec:java -Dexec.mainClass=org.unicode.cldr.tool.GenerateProductionData -DCLDR_DIR=${CLDR_DIR} -Dexec.args="-d ${INDATA}/common"
fi
# for now, seed has to exist.
mkdir -p -v ${OUT} ${INDATA}/seed/main ${INDATA}/seed/annotations ${DIST}
for type in ${TYPES}; do
${MVN} exec:java -Dexec.mainClass=org.unicode.cldr.json.Ldml2JsonConverter -DCLDR_DIR=${INDATA} -Dexec.args="-m ${MATCH} -p true -o true -r true -t ${type} -d ${OUT} -s ${DRAFTSTATUS} -V ${VERSION} ${EXTRA_JSON_OPTS}"
done
echo "Finshed converting '${TYPES}' to ${OUT}"
if [[ "$INDATA" == "target/data" ]];
then
rm -r "$INDATA"
fi
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