• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.unicode.cldr.util;
2 
3 import java.util.List;
4 
5 import org.unicode.cldr.tool.ToolConstants;
6 
7 import com.google.common.collect.ImmutableList;
8 
9 /**
10  * Constant paths (moved here from CldrUtility).
11  * These must not be used by any code destined for the SurveyTool, as this class will not be included.
12  * @author srl
13  *
14  */
15 
16 public class CLDRPaths {
17     /** default working directory for Eclipse is . = ${workspace_loc:cldr}, which is <CLDR>/tools/java/ */
18     // set the base directory with -Dcldrdata=<value>
19     // if the main is different, use -Dcldrmain=<value>
20 
21     public static final String BASE_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("CLDR_DIR", null)); // new
22     public static final String LOCAL_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("LOCAL_DIR", BASE_DIRECTORY + "/../"));
23     public static final String EXTERNAL_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("UCD_DIR", LOCAL_DIRECTORY));
24     // File(Utility.getProperty("CLDR_DIR",
25     // null)).getPath();
26     // // get up to
27     // <CLDR>
28     public static final String COMMON_DIRECTORY = CldrUtility.getPath(BASE_DIRECTORY, "common/");
29     public static final String COLLATION_DIRECTORY = CldrUtility.getPath(COMMON_DIRECTORY, "collation/");
30     public static final String CASING_DIRECTORY = CldrUtility.getPath(COMMON_DIRECTORY, "casing/");
31     public static final String MAIN_DIRECTORY = CldrUtility.getProperty("CLDR_MAIN",
32         CldrUtility.getPath(CLDRPaths.COMMON_DIRECTORY, "main"));
33 
34     public static final String RBNF_DIRECTORY = CldrUtility.getPath(CLDRPaths.COMMON_DIRECTORY, "rbnf/");
35     public static final String TRANSFORMS_DIRECTORY = CldrUtility.getPath(CLDRPaths.COMMON_DIRECTORY, "transforms/");
36     public static final String ANNOTATIONS_DIRECTORY = CldrUtility.getPath(CLDRPaths.COMMON_DIRECTORY, "annotations/");
37     public static final String SUBDIVISIONS_DIRECTORY = CldrUtility.getPath(CLDRPaths.COMMON_DIRECTORY, "subdivisions/");
38     public static final String ANNOTATIONS_DERIVED_DIRECTORY = CldrUtility.getPath(CLDRPaths.COMMON_DIRECTORY, "annotationsDerived/");
39 
40     public static final String SEED_DIRECTORY = CldrUtility.getProperty("CLDR_SEED",
41         CldrUtility.getPath(CLDRPaths.COMMON_DIRECTORY, "../seed/main"));
42     public static final String SEED_COLLATION_DIRECTORY = CldrUtility.getPath(SEED_DIRECTORY, "../collation/");
43     public static final String SEED_CASING_DIRECTORY = CldrUtility.getPath(SEED_DIRECTORY, "../casing/");
44     public static final String SEED_ANNOTATIONS_DIRECTORY = CldrUtility.getPath(SEED_DIRECTORY, "../annotations/");
45     public static final String VALIDITY_DIRECTORY = CldrUtility.getPath(CLDRPaths.COMMON_DIRECTORY, "validity/");
46 
47     public static final String EXEMPLARS_DIRECTORY = CldrUtility.getPath(CLDRPaths.BASE_DIRECTORY, "exemplars/main/");
48 
49     public static final String TMP_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("CLDR_TMP_DIR",
50         CldrUtility.getPath(BASE_DIRECTORY, "../cldr-tmp/")));
51     public static final String AUX_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("CLDR_TMP_DIR",
52         CldrUtility.getPath(BASE_DIRECTORY, "../cldr-aux/")));
53     public static final String TMP2_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("CLDR_TMP_DIR",
54         CldrUtility.getPath(BASE_DIRECTORY, "../cldr-tmp2/")));
55     // external data
56     public static final String ARCHIVE_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("ARCHIVE",
57         CldrUtility.getPath(BASE_DIRECTORY, "../cldr-archive/")));
58     public static final String LAST_DIRECTORY = ARCHIVE_DIRECTORY + "cldr-" +
59         ToolConstants.PREVIOUS_CHART_VERSION +
60         "/";
61     public static final String LAST_RELEASE_DIRECTORY = ARCHIVE_DIRECTORY + "cldr-" +
62         ToolConstants.LAST_RELEASE_VERSION +
63         "/";
64     public static final String CLDR_PRIVATE_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("CLDR_PRIVATE_DATA",
65         CldrUtility.getPath(BASE_DIRECTORY, "../cldr-private/")));
66 
67     public static final String LAST_COMMON_DIRECTORY = CldrUtility.getPath(CLDRPaths.LAST_DIRECTORY, "common/");
68     public static final String LAST_TRANSFORMS_DIRECTORY = CldrUtility.getPath(CLDRPaths.LAST_COMMON_DIRECTORY, "transforms/");
69 
70     public static final String GEN_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("CLDR_GEN_DIR",
71         CldrUtility.getPath(LOCAL_DIRECTORY, "Generated/cldr/")));
72     public static final String DATA_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty("CLDR_EXT_DATA_DIR",
73         CldrUtility.getPath(LOCAL_DIRECTORY, "Data/")));
74 
75     public static final String UCD_DATA_DIRECTORY = CldrUtility.getPath(EXTERNAL_DIRECTORY + "unicodetools/draft/");
76     public static final String ICU_DATA_DIR = CldrUtility.getPath(CldrUtility.getProperty("ICU_DATA_DIR", null)); // eg
77     public static final String BIRTH_DATA_DIR = CldrUtility.getPath(BASE_DIRECTORY, "tools/java/org/unicode/cldr/util/data/births/");
78     /**
79      * @deprecated please use XMLFile and CLDRFILE getSupplementalDirectory()
80      * @see DEFAULT_SUPPLEMENTAL_DIRECTORY
81      */
82     public static final String SUPPLEMENTAL_DIRECTORY = CldrUtility.getPath(COMMON_DIRECTORY, "supplemental/");
83     /**
84      * Only the default, if no other directory is specified.
85      */
86     public static final String DEFAULT_SUPPLEMENTAL_DIRECTORY = CldrUtility.getPath(COMMON_DIRECTORY, "supplemental/");
87     public static final String CHART_DIRECTORY = CldrUtility.getPath(AUX_DIRECTORY + "charts/", ToolConstants.CHART_VERSION);
88     public static final String LOG_DIRECTORY = CldrUtility.getPath(TMP_DIRECTORY, "logs/");
89     public static final String TEST_DIR = CldrUtility.getPath(CLDRPaths.BASE_DIRECTORY, "test/");
90     /** If the generated BAT files are to work, this needs to be set right */
91     public static final String COMPARE_PROGRAM = "\"C:\\Program Files (x86)\\Compare It!\\wincmp3.exe\"";
92     /**
93      * @deprecated Don't use this from any code that is run from the .JAR (SurveyTool, tests, etc).
94      *             If it must be used, add a comment next to the usage to explain why it is needed.
95      */
96     public static final String UTIL_DATA_DIR = FileReaders.getRelativeFileName(
97         CldrUtility.class, "data/");
98 
99     public enum DIRECTORIES {
100         common_dtd, common_properties, common_uca,
101 
102         common_bcp47(DtdType.ldmlBCP47),
103 
104         common_annotations(DtdType.ldml), common_casing(DtdType.ldml), common_collation(DtdType.ldml), common_main(DtdType.ldml), common_rbnf(
105             DtdType.ldml), common_segments(DtdType.ldml), common_subdivisions(DtdType.ldml),
106 
107         common_supplemental(DtdType.supplementalData), common_transforms(DtdType.supplementalData), common_validity(DtdType.supplementalData),
108 
109         keyboards_android(DtdType.keyboard, DtdType.platform), keyboards_chromeos(DtdType.keyboard, DtdType.platform), keyboards_dtd(DtdType.keyboard,
110             DtdType.platform), keyboards_osx(DtdType.keyboard,
111                 DtdType.platform), keyboards_und(DtdType.keyboard, DtdType.platform), keyboards_windows(DtdType.keyboard, DtdType.platform),
112                 ;
113 
114         public final List<DtdType> dtdType;
115 
DIRECTORIES(DtdType... dtdType)116         private DIRECTORIES(DtdType... dtdType) {
117             this.dtdType = ImmutableList.copyOf(dtdType);
118         }
119     }
120 
121     @Deprecated //use DtdType.ldml.directories
122 //    public static final Set<String> LDML_DIRECTORIES = ImmutableSet.of(
123 //        "main",
124 //        "annotations",
125 //        "casing",
126 //        "collation",
127 //        "rbnf",
128 //        "segments",
129 //        "subdivisions"
130 //        );
131     public static final String UNICODE_VERSION = "10.0.0";
132 }
133