• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.unicode.cldr.tool;
2 
3 import java.util.List;
4 
5 import org.unicode.cldr.util.CldrUtility;
6 
7 import com.google.common.collect.ImmutableList;
8 
9 /**
10  * Constants specific to CLDR tools.
11  * Not to be used with the Survey Tool.
12  * Moved here from CldrUtilities
13  * @author srl
14  *
15  */
16 public class ToolConstants {
17 
18     // We are now having charts point to the appropriate source, so this may take some tweaking!
19     public enum ChartStatus {
20         beta, // at the start of the release
21         trunk, // before the release is tagged
22         release // for release version
23     }
24 
25     // Change the following for each release depending on the phase
26 
27     private static final String DEFAULT_CHART_VERSION = "34";
28     private static final ChartStatus DEFAULT_CHART_STATUS = ChartStatus.beta;
29 
30     // DON'T CHANGE ANY OF THE FOLLOWING; THEY ARE DRIVEN BY THE ABOVE
31 
32     // allows overriding with -D
33     public static final String CHART_VERSION = CldrUtility.getProperty("CHART_VERSION", DEFAULT_CHART_VERSION);
34     public static final String LAST_CHART_VERSION = Integer.parseInt(CHART_VERSION) + ".0"; // must have 1 decimal
35     public static final ChartStatus CHART_STATUS = !CHART_VERSION.equals(DEFAULT_CHART_VERSION) ? ChartStatus.release
36         : ChartStatus.valueOf(CldrUtility.getProperty("CHART_STATUS", DEFAULT_CHART_STATUS.toString()));
37 
38     // build from the above
39     public static final boolean BETA = CHART_STATUS == ChartStatus.beta;
40     public static final String CHART_DISPLAY_VERSION = CHART_VERSION + (BETA ? "β" : "");
41     public static final String CHART_SOURCE = "http://unicode.org/repos/cldr/"
42         + (CHART_STATUS != ChartStatus.release ? "trunk/" : "tags/release-" + CHART_VERSION + "/");
43 
44     public static final List<String> CLDR_VERSIONS = ImmutableList.of(
45         "1.1.1",
46         "1.2.0",
47         "1.3.0",
48         "1.4.1",
49         "1.5.1",
50         "1.6.1",
51         "1.7.2",
52         "1.8.1",
53         "1.9.1",
54         "2.0.1",
55         "21.0",
56         "22.1",
57         "23.1",
58         "24.0",
59         "25.0",
60         "26.0",
61         "27.0",
62         "28.0",
63         "29.0",
64         "30.0",
65         "31.0",
66         "32.0",
67         "33.0"
68     // add to this once the release is final!
69     );
70     public static final String PREVIOUS_CHART_VERSION;
71     public static final String LAST_RELEASE_VERSION = "33.1";
72     static {
73         String last = "";
74         for (String current : CLDR_VERSIONS) {
75             if (current.equals(LAST_CHART_VERSION)) {
76                 break;
77             }
78             last = current;
79         }
80         PREVIOUS_CHART_VERSION = last;
81     }
82 }
83