Skip to content

Commit 4a3c968

Browse files
authored
Always use latest Unicode version when building emoji (#918)
1 parent 5471274 commit 4a3c968

File tree

3 files changed

+17
-36
lines changed

3 files changed

+17
-36
lines changed

unicodetools/src/main/java/org/unicode/tools/emoji/CandidateData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ private CandidateData(String sourceFile) {
389389
.length()));
390390
}
391391
}
392-
UnicodeMap<Age_Values> ages = Emoji.LATEST.loadEnum(UcdProperty.Age, Age_Values.class);
392+
UnicodeMap<Age_Values> ages = Emoji.PROPS.loadEnum(UcdProperty.Age, Age_Values.class);
393393
Age_Values minAge =
394394
Age_Values.forName(Emoji.VERSION_LAST_RELEASED_UNICODE.getVersionString(2, 2));
395395
EmojiData releasedData = EmojiData.of(Emoji.VERSION_LAST_RELEASED);

unicodetools/src/main/java/org/unicode/tools/emoji/Emoji.java

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,7 @@
4444
*
4545
* <p>Example: -Demoji-beta
4646
*
47-
* <p>With each new version, set
48-
*
49-
* <ul>
50-
* <li>VERSION_LAST_RELEASED2 = VERSIONxx;
51-
* <li>VERSION_LAST_RELEASED = VERSIONyy;
52-
* <li>VERSION_BETA = VERSIONzz;
53-
* </ul>
54-
*
55-
* <p>Normally, when emoji and Unicode versions are in sync, we should use
56-
* Settings.LATEST_VERSION_INFO etc. here.
57-
*
58-
* <p>You also need to
47+
* <p>With each new version:
5948
*
6049
* <ul>
6150
* <li>add a new constant like <code>VERSION15</code>
@@ -86,8 +75,7 @@ public class Emoji {
8675

8776
/**
8877
* Set the following to true iff the charts for the release should still point to proposed.html
89-
* for TR51. The main function is to add pointers between the release and beta charts. Also
90-
* change the VERSION_LAST_RELEASED2, etc below!!!
78+
* for TR51. The main function is to add pointers between the release and beta charts.
9179
*/
9280
public static final boolean USE_PROPOSED =
9381
true; // set to true between the release of Emoji 5.0 & Unicode 10.0. (or similar
@@ -203,21 +191,15 @@ public class Emoji {
203191
public static final String VERSION_BETA_STRING = VERSION_BETA.getVersionString(2, 4);
204192
public static final String VERSION_BETA_STRING_WITH_COLOR = VERSION_BETA_STRING + BETA_COLORED;
205193

206-
public static final VersionInfo VERSION_TO_GENERATE =
207-
IS_BETA ? VERSION_BETA : VERSION_LAST_RELEASED;
208-
public static final VersionInfo VERSION_TO_GENERATE_PREVIOUS =
209-
IS_BETA ? VERSION_LAST_RELEASED : VERSION_LAST_RELEASED2;
194+
public static final VersionInfo VERSION_TO_GENERATE = VERSION_BETA;
195+
public static final VersionInfo VERSION_TO_GENERATE_PREVIOUS = VERSION_LAST_RELEASED;
210196

211197
public static final String VERSION_STRING = VERSION_TO_GENERATE.getVersionString(2, 4);
212198

213-
public static final VersionInfo VERSION_TO_GENERATE_UNICODE =
214-
IS_BETA ? VERSION_BETA_UNICODE : VERSION_LAST_RELEASED_UNICODE;
199+
public static final VersionInfo VERSION_TO_GENERATE_UNICODE = VERSION_BETA_UNICODE;
215200
public static final String VERSION_UNICODE_STRING =
216201
VERSION_TO_GENERATE_UNICODE.getVersionString(2, 4);
217202

218-
// public static final String TR51_SVN_DIR = Settings.UNICODE_DRAFT_DIRECTORY + "reports/tr51/";
219-
// public static final String TR51_PREFIX = IS_BETA ? "internal-beta/" : "internal/";
220-
221203
public static final String EMOJI_DIR =
222204
Settings.Output.GEN_DIR + "emoji/" + (Emoji.ABBR ? "🏴" : "");
223205
public static final String CHARTS_DIR = EMOJI_DIR + "charts-" + VERSION_STRING + "/";
@@ -956,10 +938,9 @@ public static Iterable<Source> orderedEnum(Source... doFirst) {
956938
return ordered;
957939
}
958940

959-
public static final IndexUnicodeProperties LATEST =
941+
public static final IndexUnicodeProperties PROPS =
960942
IndexUnicodeProperties.make(VERSION_TO_GENERATE_UNICODE);
961-
public static final IndexUnicodeProperties BETA =
962-
IS_BETA ? IndexUnicodeProperties.make(VERSION_BETA_UNICODE) : LATEST;
943+
public static final IndexUnicodeProperties BETA = PROPS;
963944

964945
static final UnicodeMap<Age_Values> VERSION_ENUM =
965946
BETA.loadEnum(UcdProperty.Age, Age_Values.class);
@@ -1095,15 +1076,15 @@ public static boolean isSingleCodePoint(String nvs) {
10951076
DING_MAP.freeze();
10961077
}
10971078

1098-
static final UnicodeMap<String> WHITESPACE = Emoji.LATEST.load(UcdProperty.White_Space);
1079+
static final UnicodeMap<String> WHITESPACE = Emoji.PROPS.load(UcdProperty.White_Space);
10991080

11001081
public static final UnicodeSet JSOURCES = new UnicodeSet();
11011082
private static final boolean DEBUG = false;
11021083

11031084
static {
1104-
UnicodeMap<String> dcmProp = Emoji.LATEST.load(UcdProperty.Emoji_DCM);
1105-
UnicodeMap<String> kddiProp = Emoji.LATEST.load(UcdProperty.Emoji_KDDI);
1106-
UnicodeMap<String> sbProp = Emoji.LATEST.load(UcdProperty.Emoji_SB);
1085+
UnicodeMap<String> dcmProp = Emoji.PROPS.load(UcdProperty.Emoji_DCM);
1086+
UnicodeMap<String> kddiProp = Emoji.PROPS.load(UcdProperty.Emoji_KDDI);
1087+
UnicodeMap<String> sbProp = Emoji.PROPS.load(UcdProperty.Emoji_SB);
11071088
checkDuplicates(dcmProp, kddiProp, sbProp);
11081089
JSOURCES.addAll(dcmProp.keySet())
11091090
.addAll(kddiProp.keySet())

unicodetools/src/main/java/org/unicode/tools/emoji/GenerateEmoji.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,20 +198,20 @@ public class GenerateEmoji {
198198
}
199199

200200
static final UnicodeMap<String> GENERAL_CATEGORY =
201-
Emoji.LATEST.load(UcdProperty.General_Category);
201+
Emoji.PROPS.load(UcdProperty.General_Category);
202202
static final UnicodeMap<General_Category_Values> GENERAL_CATEGORY_E =
203-
Emoji.LATEST.loadEnum(
203+
Emoji.PROPS.loadEnum(
204204
UcdProperty.General_Category, UcdPropertyValues.General_Category_Values.class);
205205
static final UnicodeMap<String> SCRIPT_EXTENSIONS =
206-
Emoji.LATEST.load(UcdProperty.Script_Extensions);
206+
Emoji.PROPS.load(UcdProperty.Script_Extensions);
207207
private static final UnicodeSet COMMON_SCRIPT =
208208
new UnicodeSet()
209209
.addAll(
210210
SCRIPT_EXTENSIONS.getSet(
211211
UcdPropertyValues.Script_Values.Common.toString()))
212212
.freeze();
213213

214-
static final UnicodeMap<String> NFKCQC = Emoji.LATEST.load(UcdProperty.NFKD_Quick_Check);
214+
static final UnicodeMap<String> NFKCQC = Emoji.PROPS.load(UcdProperty.NFKD_Quick_Check);
215215
static final Pattern tab = Pattern.compile("\t");
216216
static final Pattern space = Pattern.compile(" ");
217217
static final String REPLACEMENT_CHARACTER = "\uFFFD";
@@ -1190,7 +1190,7 @@ private static void showTextStyle(Visibility visibility) throws IOException {
11901190
.retainAll(EmojiData.EMOJI_DATA.getSingletonsWithoutDefectives())
11911191
.freeze();
11921192
final UnicodeMap<Age_Values> VERSION =
1193-
Emoji.LATEST.loadEnum(UcdProperty.Age, UcdPropertyValues.Age_Values.class);
1193+
Emoji.PROPS.loadEnum(UcdProperty.Age, UcdPropertyValues.Age_Values.class);
11941194

11951195
ArrayList<Age_Values> ordered = new ArrayList(Arrays.asList(Age_Values.values()));
11961196
Collections.reverse(ordered);

0 commit comments

Comments
 (0)