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 = "37"; 28 public static final String CHART_DISPLAY_VERSION = "37β"; 29 public static final String LAST_RELEASE_VERSION = "36"; 30 31 private static final ChartStatus DEFAULT_CHART_STATUS = ChartStatus.beta; 32 33 // DON'T CHANGE ANY OF THE FOLLOWING; THEY ARE DRIVEN BY THE ABOVE 34 35 // allows overriding with -D 36 public static final String CHART_VERSION = CldrUtility.getProperty("CHART_VERSION", DEFAULT_CHART_VERSION); 37 public static final String LAST_CHART_VERSION = Integer.parseInt(CHART_VERSION) + ".0"; // must have 1 decimal 38 public static final ChartStatus CHART_STATUS = !CHART_VERSION.equals(DEFAULT_CHART_VERSION) ? ChartStatus.release 39 : ChartStatus.valueOf(CldrUtility.getProperty("CHART_STATUS", DEFAULT_CHART_STATUS.toString())); 40 41 // build from the above 42 public static final boolean BETA = CHART_STATUS == ChartStatus.beta; 43 public static final String CHART_SOURCE = "http://unicode.org/repos/cldr/" 44 + (CHART_STATUS != ChartStatus.release ? "trunk/" : "tags/release-" + CHART_VERSION + "/"); 45 46 public static final List<String> CLDR_VERSIONS = ImmutableList.of( 47 "1.1.1", 48 "1.2", 49 "1.3", 50 "1.4.1", 51 "1.5.1", 52 "1.6.1", 53 "1.7.2", 54 "1.8.1", 55 "1.9.1", 56 "2.0.1", 57 "21.0", 58 "22.1", 59 "23.1", 60 "24.0", 61 "25.0", 62 "26.0", 63 "27.0", 64 "28.0", 65 "29.0", 66 "30.0", 67 "31.0", 68 "32.0", 69 "33.0", 70 "33.1", 71 "34.0", 72 "35.0", 73 "35.1" 74 // add to this once the release is final! 75 ); 76 public static final String PREVIOUS_CHART_VERSION; 77 static { 78 String last = ""; 79 for (String current : CLDR_VERSIONS) { 80 if (current.equals(LAST_CHART_VERSION)) { 81 break; 82 } 83 last = current; 84 } 85 PREVIOUS_CHART_VERSION = last; 86 } 87 } 88