OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 |
| 3 ICU_VER = 54 |
| 4 icu_gen_dir = "$target_gen_dir/icudt${ICU_VER}l" |
| 5 icu_gen_tmp_dir = "$target_gen_dir/tmp_icudt${ICU_VER}l" |
| 6 |
| 7 vars = exec_script("//build/gypi_to_gn.py", |
| 8 [ |
| 9 rebase_path("../icu_data.gypi"), |
| 10 "--replace=<(icu_gen_dir)=$icu_gen_dir", |
| 11 "--replace=<(icu_gen_tmp_dir)=$icu_gen_tmp_dir", |
| 12 ], |
| 13 "scope", |
| 14 [ "../icu_data.gypi" ]) |
| 15 |
| 16 genrb_exe = rebase_path(get_label_info("../gn_tool_build_system:genrb", |
| 17 "root_out_dir") + "/genrb") |
| 18 |
| 19 gencnval_exe = rebase_path(get_label_info("../gn_tool_build_system:gencnval", |
| 20 "root_out_dir") + "/gencnval") |
| 21 |
| 22 icupkg_exe = rebase_path(get_label_info("../gn_tool_build_system:icupkg", |
| 23 "root_out_dir") + "/icupkg") |
| 24 |
| 25 makeconv_exe = rebase_path(get_label_info("../gn_tool_build_system:makeconv", |
| 26 "root_out_dir") + "/makeconv") |
| 27 |
| 28 gendict_exe = rebase_path(get_label_info("../gn_tool_build_system:gendict", |
| 29 "root_out_dir") + "/gendict") |
| 30 |
| 31 genbrk_exe = rebase_path(get_label_info("../gn_tool_build_system:genbrk", |
| 32 "root_out_dir") + "/genbrk") |
| 33 |
| 34 gencfu_exe = rebase_path(get_label_info("../gn_tool_build_system:gencfu", |
| 35 "root_out_dir") + "/gencfu") |
| 36 |
| 37 pkgdata_exe = rebase_path(get_label_info("../gn_tool_build_system:pkgdata", |
| 38 "root_out_dir") + "/pkgdata") |
| 39 |
| 40 |
| 41 local_icu_data_curr_res_raw_sources = vars.icu_data_curr_res_raw_sources |
| 42 local_icu_data_region_res_sources = vars.icu_data_region_res_sources |
| 43 local_icu_data_region_res_alias_sources = vars.icu_data_region_res_alias_sources |
| 44 |
| 45 icu_data_generated_contents = ([ ] + |
| 46 # Coll |
| 47 vars.icu_data_coll_res_root_generated + |
| 48 vars.icu_data_coll_res_generated + |
| 49 vars.icu_data_coll_res_alias_generated + |
| 50 ["$icu_gen_dir/coll/res_index.res"] + |
| 51 # Brk_brk |
| 52 vars.icu_data_brkitr_brk_generated + |
| 53 # Brk_res |
| 54 vars.icu_data_brkitr_res_root_generated + |
| 55 vars.icu_data_brkitr_res_generated + |
| 56 ["$icu_gen_dir/brkitr/res_index.res"] + |
| 57 # Brk_dict |
| 58 ["$icu_gen_dir/brkitr/burmesedict.dict"] + |
| 59 ["$icu_gen_dir/brkitr/cjdict.dict"] + |
| 60 ["$icu_gen_dir/brkitr/khmerdict.dict"] + |
| 61 ["$icu_gen_dir/brkitr/laodict.dict"] + |
| 62 ["$icu_gen_dir/brkitr/thaidict.dict"] + |
| 63 # Locales |
| 64 vars.icu_data_locales_res_root_generated + |
| 65 vars.icu_data_locales_res_generated + |
| 66 # Misc + end of Locales |
| 67 vars.icu_data_locales_res_alias_generated + |
| 68 vars.icu_data_misc_res_generated + |
| 69 ["$icu_gen_dir/res_index.res"] + |
| 70 ["$icu_gen_dir/pool.res"] + |
| 71 # Lang |
| 72 vars.icu_data_lang_res_root_generated + |
| 73 vars.icu_data_lang_res_generated + |
| 74 vars.icu_data_lang_res_alias_generated + |
| 75 ["$icu_gen_dir/lang/res_index.res"] + |
| 76 ["$icu_gen_dir/lang/pool.res"] + |
| 77 # Region |
| 78 vars.icu_data_region_res_root_generated + |
| 79 vars.icu_data_region_res_generated + |
| 80 vars.icu_data_region_res_alias_generated + |
| 81 ["$icu_gen_dir/region/res_index.res"] + |
| 82 ["$icu_gen_dir/region/pool.res"] + |
| 83 # Zone |
| 84 vars.icu_data_zone_res_root_generated + |
| 85 vars.icu_data_zone_res_generated + |
| 86 vars.icu_data_zone_res_alias_generated + |
| 87 vars.icu_data_zone_res_extra_generated + |
| 88 ["$icu_gen_dir/zone/res_index.res"] + |
| 89 ["$icu_gen_dir/zone/pool.res"] + |
| 90 # Unit |
| 91 vars.icu_data_unit_res_root_generated + |
| 92 vars.icu_data_unit_res_generated + |
| 93 vars.icu_data_unit_res_alias_generated + |
| 94 ["$icu_gen_dir/unit/res_index.res"] + |
| 95 ["$icu_gen_dir/unit/pool.res"] + |
| 96 # Random data |
| 97 ["$icu_gen_dir/cnvalias.icu"] + |
| 98 ["$icu_gen_dir/coll/ucadata.icu"] + |
| 99 ["$icu_gen_dir/nfkc.nrm"] + |
| 100 ["$icu_gen_dir/nfkc_cf.nrm"] + |
| 101 ["$icu_gen_dir/uts46.nrm"] + |
| 102 |
| 103 # converters |
| 104 vars.icu_data_ucm_generated + |
| 105 |
| 106 # Currency |
| 107 vars.icu_data_curr_res_root_generated + |
| 108 vars.icu_data_curr_res_supplemental_generated + |
| 109 vars.icu_data_curr_res_generated + |
| 110 vars.icu_data_curr_res_alias_generated + |
| 111 ["$icu_gen_dir/curr/res_index.res"] + |
| 112 ["$icu_gen_dir/curr/pool.res"] + |
| 113 |
| 114 # RBNF |
| 115 ["$icu_gen_dir/rbnf/res_index.res"] + |
| 116 |
| 117 # Translit (note css3transform.txt -> root.txt) |
| 118 ["$icu_gen_dir/translit/root.res"] + |
| 119 |
| 120 # Confusables |
| 121 ["$icu_gen_dir/confusables.cfu"] |
| 122 ) |
| 123 |
| 124 put_icu_data_on_diet = target_os == "android" |
| 125 |
| 126 languages_to_minimize = "bn,et,gu,kn,ml,mr,ms,ta,te" # Move to gypi? |
| 127 |
| 128 if (put_icu_data_on_diet) { |
| 129 icu_data_generated_contents += [ |
| 130 # Workaround items for not having cjdict.dict |
| 131 "$icu_gen_dir/brkitr/word_ja.brk", |
| 132 "$icu_gen_dir/brkitr/ja.res", |
| 133 ] |
| 134 icu_data_generated_contents -= ( |
| 135 # Region data is fetched from the Android API on Android. |
| 136 vars.icu_data_region_res_root_generated + |
| 137 vars.icu_data_region_res_generated + |
| 138 vars.icu_data_region_res_alias_generated + |
| 139 |
| 140 [ |
| 141 # Languages from 'languages_to_minimize' above. |
| 142 "$icu_gen_dir/curr/bn.res", |
| 143 "$icu_gen_dir/curr/et.res", |
| 144 "$icu_gen_dir/curr/gu.res", |
| 145 "$icu_gen_dir/curr/kn.res", |
| 146 "$icu_gen_dir/curr/ml.res", |
| 147 "$icu_gen_dir/curr/mr.res", |
| 148 "$icu_gen_dir/curr/ms.res", |
| 149 "$icu_gen_dir/curr/ta.res", |
| 150 "$icu_gen_dir/curr/te.res", |
| 151 |
| 152 # Too big to include. |
| 153 "$icu_gen_dir/brkitr/cjdict.dict", |
| 154 ] |
| 155 ) |
| 156 # Remove from raw_sources since raw_sources is used when building |
| 157 # res_index.txt. |
| 158 local_icu_data_curr_res_raw_sources -= [ |
| 159 # Languages from 'languages_to_minimize' above. |
| 160 "source/data/curr/bn.txt", |
| 161 "source/data/curr/et.txt", |
| 162 "source/data/curr/gu.txt", |
| 163 "source/data/curr/kn.txt", |
| 164 "source/data/curr/ml.txt", |
| 165 "source/data/curr/mr.txt", |
| 166 "source/data/curr/ms.txt", |
| 167 "source/data/curr/ta.txt", |
| 168 "source/data/curr/te.txt", |
| 169 ] |
| 170 local_icu_data_region_res_sources = [] |
| 171 local_icu_data_region_res_alias_sources = [] |
| 172 } else { |
| 173 # Workaround files listed in case cjdict.dict is missing. Not needed |
| 174 # since we'll include cjdict.dict. |
| 175 icu_data_generated_contents -= [ |
| 176 "$icu_gen_dir/brkitr/word_ja.brk", |
| 177 "$icu_gen_dir/brkitr/ja.res", |
| 178 ] |
| 179 } |
| 180 |
| 181 icu_resource_files_file = "$icu_gen_tmp_dir/icu_data_resource_list.tmp" |
| 182 write_file(icu_resource_files_file, icu_data_generated_contents) |
| 183 |
| 184 group("icu_cnv_base_files") { |
| 185 deps = [ |
| 186 ":icu_cnvalias", |
| 187 ":icu_icupkg_nrm", |
| 188 ":icu_ucadata_icu", |
| 189 ] |
| 190 } |
| 191 |
| 192 action_foreach("icu_icupkg_nrm") { |
| 193 script = "run.py" |
| 194 sources = rebase_path(vars.icu_data_nrm_sources, |
| 195 ".", |
| 196 "..") |
| 197 inputs = [ |
| 198 icupkg_exe, |
| 199 ] |
| 200 outputs = [ |
| 201 "$icu_gen_dir/{{source_file_part}}", |
| 202 ] |
| 203 args = [ |
| 204 icupkg_exe, |
| 205 "-tl", |
| 206 "{{source}}", |
| 207 rebase_path("$icu_gen_dir/{{source_file_part}}"), |
| 208 ] |
| 209 } |
| 210 |
| 211 action("icu_cnvalias") { |
| 212 script = "run.py" |
| 213 inputs = [ |
| 214 gencnval_exe, |
| 215 "../source/data/mappings/convrtrs.txt", |
| 216 ] |
| 217 outputs = [ |
| 218 "$icu_gen_dir/cnvalias.icu", |
| 219 ] |
| 220 |
| 221 args = [ |
| 222 gencnval_exe, |
| 223 "-d", |
| 224 rebase_path(icu_gen_dir), |
| 225 rebase_path("../source/data/mappings/convrtrs.txt"), |
| 226 ] |
| 227 } |
| 228 |
| 229 action("icu_ucadata_icu") { |
| 230 script = "run.py" |
| 231 inputs = [ |
| 232 icupkg_exe, |
| 233 "../source/data/in/coll/ucadata-implicithan.icu", |
| 234 ] |
| 235 outputs = [ |
| 236 "$icu_gen_dir/coll/ucadata.icu", |
| 237 ] |
| 238 |
| 239 args = [ |
| 240 icupkg_exe, |
| 241 "-tl", |
| 242 rebase_path("../source/data/in/coll/ucadata-implicithan.icu"), |
| 243 rebase_path("$icu_gen_dir/coll/ucadata.icu"), |
| 244 ] |
| 245 } |
| 246 |
| 247 action_foreach("icu_cnv_ucm_files") { |
| 248 script = "run.py" |
| 249 sources = rebase_path(vars.icu_data_ucm_sources, |
| 250 ".", |
| 251 "..") |
| 252 inputs = [ |
| 253 makeconv_exe, |
| 254 ] |
| 255 outputs = [ |
| 256 "$icu_gen_dir/{{source_name_part}}.cnv", |
| 257 ] |
| 258 args = [ |
| 259 makeconv_exe, |
| 260 "-c", |
| 261 "-d", |
| 262 rebase_path(icu_gen_dir), |
| 263 "{{source}}", |
| 264 ] |
| 265 } |
| 266 |
| 267 action("icu_filtered_for_size_files") { |
| 268 script = "../build_tools/filter_data_for_size.py" |
| 269 inputs = ([ |
| 270 # Order here is important. See indexing below. |
| 271 "../source/data/brkitr/word.txt", |
| 272 "../source/data/brkitr/root.txt", |
| 273 "../source/data/brkitr/ja.txt", |
| 274 "../source/data/locales/pool.res", |
| 275 "../source/data/curr/pool.res", |
| 276 "../source/data/lang/pool.res", |
| 277 "../source/data/zone/pool.res", |
| 278 ] + |
| 279 rebase_path(local_icu_data_curr_res_raw_sources + |
| 280 vars.icu_data_curr_res_alias_raw_sources + |
| 281 vars.icu_data_curr_res_supplemental_raw_sources + |
| 282 vars.icu_data_locales_res_raw_sources + |
| 283 vars.icu_data_locales_res_alias_raw_sources + |
| 284 vars.icu_data_lang_res_raw_sources + |
| 285 vars.icu_data_lang_res_alias_raw_sources + |
| 286 vars.icu_data_zone_res_raw_sources + |
| 287 vars.icu_data_zone_res_alias_raw_sources, |
| 288 ".", |
| 289 "..") |
| 290 ) |
| 291 outputs = ([ |
| 292 # Order here is important. See indexing below. |
| 293 "$icu_gen_tmp_dir/brkitr/word.txt", |
| 294 "$icu_gen_tmp_dir/brkitr/root.txt", |
| 295 "$icu_gen_tmp_dir/brkitr/ja.txt", |
| 296 "$icu_gen_tmp_dir/locales/pool.res", |
| 297 "$icu_gen_tmp_dir/curr/pool.res", |
| 298 "$icu_gen_tmp_dir/lang/pool.res", |
| 299 "$icu_gen_tmp_dir/zone/pool.res", |
| 300 ] + |
| 301 vars.icu_data_curr_res_filtered_sources + |
| 302 vars.icu_data_curr_res_alias_filtered_sources + |
| 303 vars.icu_data_curr_res_supplemental_filtered_sources + |
| 304 vars.icu_data_locales_res_filtered_sources + |
| 305 vars.icu_data_locales_res_alias_filtered_sources + |
| 306 vars.icu_data_lang_res_filtered_sources + |
| 307 vars.icu_data_lang_res_alias_filtered_sources + |
| 308 vars.icu_data_zone_res_filtered_sources + |
| 309 vars.icu_data_zone_res_alias_filtered_sources |
| 310 ) |
| 311 |
| 312 # To go from inputs to outputs in gn: |
| 313 # outputs = rebase_path(rebase_path(inputs, "../source/data"), |
| 314 # ".", icu_gen_tmp_dir) |
| 315 # But then we would diverge from icu_data.gyp and might not catch |
| 316 # errors in the vars above (that would not be needed if we only had gn). |
| 317 computed_outputs = rebase_path(rebase_path(inputs, "../source/data"), |
| 318 ".", icu_gen_tmp_dir) |
| 319 assert(rebase_path(computed_outputs) == rebase_path(outputs)) |
| 320 |
| 321 if (put_icu_data_on_diet) { |
| 322 filter_mode = "strip-for-size" |
| 323 } else { |
| 324 filter_mode = "clean-copy" |
| 325 } |
| 326 args = [ |
| 327 "--mode", |
| 328 filter_mode, |
| 329 "--in-word-txt", |
| 330 rebase_path(inputs[0]), |
| 331 "--out-word-txt", |
| 332 rebase_path(outputs[0]), |
| 333 "--in-brkitr-root-txt", |
| 334 rebase_path(inputs[1]), |
| 335 "--out-brkitr-root-txt", |
| 336 rebase_path(outputs[1]), |
| 337 "--in-brkitr-ja-txt", |
| 338 rebase_path(inputs[2]), |
| 339 "--out-brkitr-ja-txt", |
| 340 rebase_path(outputs[2]), |
| 341 "--currency-keep-list", |
| 342 rebase_path("../android/currencies.list"), |
| 343 "--in-curr-dir", |
| 344 rebase_path("../source/data/curr"), |
| 345 "--out-curr-dir", |
| 346 rebase_path("$icu_gen_tmp_dir/curr"), |
| 347 "--minimize-language-list", |
| 348 languages_to_minimize, |
| 349 "--in-locales-dir", |
| 350 rebase_path("../source/data/locales"), |
| 351 "--out-locales-dir", |
| 352 rebase_path("$icu_gen_tmp_dir/locales"), |
| 353 "--in-lang-dir", |
| 354 rebase_path("../source/data/lang"), |
| 355 "--out-lang-dir", |
| 356 rebase_path("$icu_gen_tmp_dir/lang"), |
| 357 "--in-zone-dir", |
| 358 rebase_path("../source/data/zone"), |
| 359 "--out-zone-dir", |
| 360 rebase_path("$icu_gen_tmp_dir/zone"), |
| 361 "--remove-data-already-existing-in-android", |
| 362 ] |
| 363 } |
| 364 |
| 365 dicts_with_transform = [ |
| 366 ["burmesedict", "0x1000"], |
| 367 ["khmerdict", "0x1780"], |
| 368 ["thaidict", "0xe00"], |
| 369 ["laodict", "0xe80"], |
| 370 ] |
| 371 |
| 372 if (!put_icu_data_on_diet) { |
| 373 dicts_with_transform += [["cjdict", ""]] |
| 374 } |
| 375 |
| 376 foreach(dict_with_transform, dicts_with_transform) { |
| 377 dict_to_compile = dict_with_transform[0] |
| 378 dict_transform_offset = dict_with_transform[1] |
| 379 |
| 380 action("icu_dict_" + dict_to_compile) { |
| 381 script = "run.py" |
| 382 inputs = [ |
| 383 gendict_exe, |
| 384 "../source/data/brkitr/$dict_to_compile.txt", |
| 385 ] |
| 386 outputs = [ |
| 387 "$icu_gen_dir/brkitr/$dict_to_compile.dict", |
| 388 ] |
| 389 |
| 390 if (dict_transform_offset == "") { |
| 391 target_args = ["--uchars"] |
| 392 } else { |
| 393 target_args = [ |
| 394 "--bytes", |
| 395 "--transform", |
| 396 "offset-$dict_transform_offset", |
| 397 ] |
| 398 } |
| 399 args = [ |
| 400 gendict_exe, |
| 401 ] + target_args + [ |
| 402 "-c", |
| 403 "-i", |
| 404 rebase_path(icu_gen_dir), |
| 405 rebase_path(inputs[1]), |
| 406 rebase_path(outputs[0]), |
| 407 ] |
| 408 } |
| 409 } |
| 410 |
| 411 action_foreach("icu_brk_files") { |
| 412 script = "run.py" |
| 413 deps = [ |
| 414 ":icu_cnv_base_files", |
| 415 ":icu_filtered_for_size_files", |
| 416 ] |
| 417 inputs = [ |
| 418 genbrk_exe, |
| 419 ] |
| 420 sources = rebase_path(vars.icu_data_brkitr_brk_sources, |
| 421 ".", |
| 422 "..") |
| 423 |
| 424 outputs = [ "$icu_gen_dir/brkitr/{{source_name_part}}.brk" ] |
| 425 args = [ |
| 426 genbrk_exe, |
| 427 "-c", |
| 428 "-i", |
| 429 rebase_path(icu_gen_dir), |
| 430 "-r", |
| 431 "{{source}}", |
| 432 "-o", |
| 433 rebase_path("$icu_gen_dir/brkitr/{{source_name_part}}.brk"), |
| 434 ] |
| 435 } |
| 436 |
| 437 action_foreach("icu_locales_res_files") { |
| 438 script = "run.py" |
| 439 deps = [ |
| 440 ":icu_cnv_base_files", |
| 441 ":icu_filtered_for_size_files", |
| 442 ] |
| 443 inputs = [ |
| 444 genrb_exe, |
| 445 "$icu_gen_tmp_dir/locales/pool.res", |
| 446 ] |
| 447 sources = rebase_path(vars.icu_data_locales_res_root_sources + |
| 448 vars.icu_data_locales_res_filtered_sources + |
| 449 vars.icu_data_locales_res_alias_filtered_sources, |
| 450 ".", |
| 451 "..") |
| 452 |
| 453 outputs = [ "$icu_gen_dir/{{source_name_part}}.res" ] |
| 454 args = [ |
| 455 genrb_exe, |
| 456 "--usePoolBundle", |
| 457 "-k", |
| 458 "-R", |
| 459 "-i", |
| 460 rebase_path(icu_gen_dir), |
| 461 "-s", |
| 462 rebase_path(icu_gen_tmp_dir + "/locales"), |
| 463 "-d", |
| 464 rebase_path(icu_gen_dir), |
| 465 "{{source_file_part}}", |
| 466 ] |
| 467 } |
| 468 |
| 469 action_foreach("icu_misc_res_files") { |
| 470 script = "run.py" |
| 471 deps = [ |
| 472 ":icu_cnv_base_files", |
| 473 ] |
| 474 inputs = [ |
| 475 genrb_exe, |
| 476 ] |
| 477 sources = rebase_path(vars.icu_data_misc_res_sources, |
| 478 ".", |
| 479 "..") |
| 480 |
| 481 outputs = [ "$icu_gen_dir/{{source_name_part}}.res" ] |
| 482 args = [ |
| 483 genrb_exe, |
| 484 "-k", |
| 485 "-R", |
| 486 "-q", |
| 487 "-i", |
| 488 rebase_path(icu_gen_dir), |
| 489 "-s", |
| 490 rebase_path("../source/data/misc"), |
| 491 "-d", |
| 492 rebase_path(icu_gen_dir), |
| 493 "{{source_file_part}}", |
| 494 ] |
| 495 } |
| 496 |
| 497 res_indexes = [ |
| 498 # In-dir, out-dir, uses-pool, source-name-list. |
| 499 ["locales", "", true, vars.icu_data_locales_res_raw_sources], |
| 500 ["curr", "/curr", true, local_icu_data_curr_res_raw_sources], |
| 501 ["lang", "/lang", true, vars.icu_data_lang_res_raw_sources], |
| 502 ["region", "/region", true, local_icu_data_region_res_sources], |
| 503 ["zone", "/zone", true, vars.icu_data_zone_res_raw_sources], |
| 504 ["unit", "/unit", true, vars.icu_data_unit_res_sources], |
| 505 ["coll", "/coll", false, vars.icu_data_coll_res_sources], |
| 506 ["brkitr", "/brkitr", false, vars.icu_data_brkitr_res_sources + |
| 507 vars.icu_data_brkitr_res_filtered_sources], |
| 508 ["rbnf", "/rbnf", false, []], |
| 509 ] |
| 510 |
| 511 foreach(res_index, res_indexes) { |
| 512 res_index_dir = res_index[0] |
| 513 res_index_output_dir = res_index[1] |
| 514 res_index_uses_pool = res_index[2] |
| 515 res_index_sources = [] # Or we will fail to overwrite the value |
| 516 # from the last iteration. |
| 517 res_index_sources = res_index[3] |
| 518 |
| 519 action("icu_write_${res_index_dir}_res_index_txt") { |
| 520 script = "../build_tools/write_res_index.py" |
| 521 inputs = [ |
| 522 # Only using file names, not file contents of source files. |
| 523 ] |
| 524 outputs = [ |
| 525 icu_gen_tmp_dir + res_index_output_dir + "/res_index.txt", |
| 526 ] |
| 527 args = [] |
| 528 if (res_index_dir == "locales") { |
| 529 args += [ |
| 530 "--cldr-version", |
| 531 "1.9", # FIXME: Move somewhere |
| 532 ] |
| 533 } |
| 534 |
| 535 args += [ |
| 536 "--outfile", |
| 537 rebase_path(outputs[0]), |
| 538 ] |
| 539 args += rebase_path(res_index_sources, |
| 540 ".", |
| 541 "..") |
| 542 } |
| 543 |
| 544 action("icu_${res_index_dir}_res_index_res_file") { |
| 545 script = "run.py" |
| 546 deps = [ |
| 547 ":icu_write_${res_index_dir}_res_index_txt" |
| 548 # Simple resources, do not need anything from icu_cnv_base_files. |
| 549 # ":icu_cnv_base_files", |
| 550 ] |
| 551 inputs = [ |
| 552 genrb_exe, |
| 553 icu_gen_tmp_dir + res_index_output_dir + "/res_index.txt", |
| 554 ] |
| 555 outputs = [ |
| 556 icu_gen_dir + res_index_output_dir + "/res_index.res", |
| 557 ] |
| 558 args = [ |
| 559 genrb_exe, |
| 560 "--quiet", # Chromium addition to silence warnings. |
| 561 "-k", |
| 562 "-R", |
| 563 "-i", |
| 564 rebase_path(icu_gen_dir), |
| 565 "-d", |
| 566 rebase_path(icu_gen_dir + res_index_output_dir), |
| 567 rebase_path(inputs[1]), |
| 568 ] |
| 569 } |
| 570 |
| 571 if (res_index_uses_pool) { |
| 572 action("icu_${res_index_dir}_pool_res") { |
| 573 script = "run.py" |
| 574 inputs = [ |
| 575 icupkg_exe, |
| 576 "../source/data/$res_index_dir/pool.res", |
| 577 ] |
| 578 outputs = [ |
| 579 icu_gen_dir + res_index_output_dir + "/pool.res", |
| 580 ] |
| 581 args = [ |
| 582 icupkg_exe, |
| 583 "-tl", |
| 584 rebase_path(inputs[1]), |
| 585 rebase_path(outputs[0]), |
| 586 ] |
| 587 } |
| 588 } |
| 589 } |
| 590 |
| 591 res_chunks = [ |
| 592 # Dir, source_files, is_filtered. |
| 593 ["curr", vars.icu_data_curr_res_root_sources + |
| 594 vars.icu_data_curr_res_supplemental_filtered_sources + |
| 595 vars.icu_data_curr_res_filtered_sources + |
| 596 vars.icu_data_curr_res_alias_filtered_sources, true], |
| 597 ["lang", vars.icu_data_lang_res_root_sources + |
| 598 vars.icu_data_lang_res_filtered_sources + |
| 599 vars.icu_data_lang_res_alias_filtered_sources, true], |
| 600 ["region", vars.icu_data_region_res_root_sources + |
| 601 local_icu_data_region_res_sources + |
| 602 local_icu_data_region_res_alias_sources, false], |
| 603 ["zone", vars.icu_data_zone_res_root_sources + |
| 604 vars.icu_data_zone_res_filtered_sources + |
| 605 vars.icu_data_zone_res_alias_filtered_sources + |
| 606 vars.icu_data_zone_res_extra_sources, true], |
| 607 ["unit", vars.icu_data_unit_res_root_sources + |
| 608 vars.icu_data_unit_res_sources + |
| 609 vars.icu_data_unit_res_alias_sources, false], |
| 610 ] |
| 611 |
| 612 foreach(res_chunk, res_chunks) { |
| 613 chunk_dir = res_chunk[0] |
| 614 files = [] |
| 615 files = res_chunk[1] |
| 616 is_filtered = res_chunk[2] |
| 617 |
| 618 if (is_filtered) { |
| 619 source_dir = icu_gen_tmp_dir |
| 620 } else { |
| 621 source_dir = "../source/data" |
| 622 } |
| 623 |
| 624 action_foreach("icu_${chunk_dir}_res_files") { |
| 625 script = "run.py" |
| 626 deps = [ |
| 627 ":icu_cnv_base_files", |
| 628 ":icu_filtered_for_size_files", # Some have this. Keep it simple. |
| 629 ] |
| 630 |
| 631 inputs = [ |
| 632 genrb_exe, |
| 633 "$source_dir/$chunk_dir/pool.res", |
| 634 ] |
| 635 sources = rebase_path(files, |
| 636 ".", |
| 637 "..") |
| 638 |
| 639 outputs = [ "$icu_gen_dir/$chunk_dir/{{source_name_part}}.res" ] |
| 640 args = [ |
| 641 genrb_exe, |
| 642 "--quiet", # Chromium addition to silence warnings. |
| 643 "--usePoolBundle", |
| 644 "-k", |
| 645 "-R", |
| 646 "-i", |
| 647 rebase_path(icu_gen_dir), |
| 648 "-s", |
| 649 rebase_path("$source_dir/$chunk_dir"), |
| 650 "-d", |
| 651 rebase_path("$icu_gen_dir/$chunk_dir"), |
| 652 "{{source_file_part}}", |
| 653 ] |
| 654 } |
| 655 } |
| 656 # START COLL |
| 657 action_foreach("icu_coll_res_files") { |
| 658 script = "run.py" |
| 659 deps = [ |
| 660 ":icu_cnv_base_files", |
| 661 ":icu_misc_res_files", # Specifically keyTypeData for sr_Latn.txt |
| 662 ] |
| 663 section_dir = "coll" |
| 664 inputs = [ |
| 665 genrb_exe, |
| 666 "$icu_gen_dir/keyTypeData.res", |
| 667 ] |
| 668 sources = rebase_path(vars.icu_data_coll_res_root_sources + |
| 669 vars.icu_data_coll_res_sources + |
| 670 vars.icu_data_coll_res_alias_sources, |
| 671 ".", |
| 672 "..") |
| 673 |
| 674 outputs = [ "$icu_gen_dir/$section_dir/{{source_name_part}}.res" ] |
| 675 args = [ |
| 676 genrb_exe, |
| 677 "-k", |
| 678 "-R", |
| 679 "-i", |
| 680 rebase_path(icu_gen_dir), |
| 681 "-s", |
| 682 rebase_path("../source/data/$section_dir"), |
| 683 "-d", |
| 684 rebase_path("$icu_gen_dir/$section_dir"), |
| 685 "{{source_file_part}}", |
| 686 ] |
| 687 } |
| 688 # END COLL |
| 689 |
| 690 # START BRKITR |
| 691 action_foreach("icu_brkitr_res_files") { |
| 692 # icu_brkitr_res_filtered_files is the same except that -s (source |
| 693 # dir) is icu_gen_tmp_dir in that action. |
| 694 script = "run.py" |
| 695 deps = [ |
| 696 ":icu_cnv_base_files", |
| 697 ] |
| 698 section_dir = "brkitr" |
| 699 inputs = [ |
| 700 genrb_exe, |
| 701 "$icu_gen_dir/brkitr/cjdict.dict", |
| 702 "$icu_gen_dir/brkitr/burmesedict.dict", |
| 703 "$icu_gen_dir/brkitr/khmerdict.dict", |
| 704 "$icu_gen_dir/brkitr/laodict.dict", |
| 705 "$icu_gen_dir/brkitr/thaidict.dict" |
| 706 ] + vars.icu_data_brkitr_brk_generated |
| 707 |
| 708 if (put_icu_data_on_diet) { |
| 709 inputs -= [ |
| 710 "$icu_gen_dir/brkitr/cjdict.dict", |
| 711 ] |
| 712 } |
| 713 |
| 714 sources = rebase_path( |
| 715 vars.icu_data_brkitr_res_sources, |
| 716 ".", |
| 717 "..") |
| 718 |
| 719 outputs = [ "$icu_gen_dir/$section_dir/{{source_name_part}}.res" ] |
| 720 args = [ |
| 721 genrb_exe, |
| 722 "-k", |
| 723 "-R", |
| 724 "-i", |
| 725 rebase_path(icu_gen_dir), |
| 726 "-s", |
| 727 rebase_path("../source/data/$section_dir"), |
| 728 "-d", |
| 729 rebase_path("$icu_gen_dir/$section_dir"), |
| 730 "{{source_file_part}}", |
| 731 ] |
| 732 } |
| 733 |
| 734 action_foreach("icu_brkitr_res_filtered_files") { |
| 735 # Same as icu_brkitr_res_files except that -s (source dir) is |
| 736 # icu_gen_tmp_dir. |
| 737 script = "run.py" |
| 738 deps = [ |
| 739 ":icu_cnv_base_files", |
| 740 ":icu_filtered_for_size_files", |
| 741 ] |
| 742 section_dir = "brkitr" |
| 743 inputs = [ |
| 744 genrb_exe, |
| 745 "$icu_gen_dir/brkitr/cjdict.dict", |
| 746 "$icu_gen_dir/brkitr/burmesedict.dict", |
| 747 "$icu_gen_dir/brkitr/khmerdict.dict", |
| 748 "$icu_gen_dir/brkitr/laodict.dict", |
| 749 "$icu_gen_dir/brkitr/thaidict.dict" |
| 750 ] + vars.icu_data_brkitr_brk_generated |
| 751 |
| 752 if (put_icu_data_on_diet) { |
| 753 inputs -= [ |
| 754 "$icu_gen_dir/brkitr/cjdict.dict", |
| 755 ] |
| 756 } |
| 757 |
| 758 sources = rebase_path( |
| 759 vars.icu_data_brkitr_res_root_filtered_sources + |
| 760 vars.icu_data_brkitr_res_filtered_sources, |
| 761 ".", |
| 762 "..") |
| 763 |
| 764 outputs = [ "$icu_gen_dir/$section_dir/{{source_name_part}}.res" ] |
| 765 args = [ |
| 766 genrb_exe, |
| 767 "-k", |
| 768 "-R", |
| 769 "-i", |
| 770 rebase_path(icu_gen_dir), |
| 771 "-s", |
| 772 rebase_path("$icu_gen_tmp_dir/$section_dir"), |
| 773 "-d", |
| 774 rebase_path("$icu_gen_dir/$section_dir"), |
| 775 "{{source_file_part}}", |
| 776 ] |
| 777 } |
| 778 # END BRKITR |
| 779 |
| 780 # START RBNF |
| 781 # END RBNF |
| 782 |
| 783 # START TRANSLIT |
| 784 action("icu_data_translit") { |
| 785 script = "run.py" |
| 786 deps = [ |
| 787 ":icu_cnv_base_files", |
| 788 ] |
| 789 section_dir = "translit" |
| 790 inputs = [ |
| 791 genrb_exe, |
| 792 "../source/data/$section_dir/css3transform.txt", |
| 793 ] |
| 794 outputs = [ "$icu_gen_dir/$section_dir/root.res" ] |
| 795 args = [ |
| 796 genrb_exe, |
| 797 "-k", |
| 798 "-R", |
| 799 "-i", |
| 800 rebase_path(icu_gen_dir), |
| 801 "-s", |
| 802 rebase_path("../source/data/$section_dir"), |
| 803 "-d", |
| 804 rebase_path("$icu_gen_dir/$section_dir"), |
| 805 "css3transform.txt", |
| 806 ] |
| 807 } |
| 808 # END TRANSLIT |
| 809 |
| 810 # START CONFUSABLES |
| 811 action("icu_data_confusables") { |
| 812 script = "run.py" |
| 813 inputs = [ |
| 814 gencfu_exe, |
| 815 "$icu_gen_dir/cnvalias.icu", |
| 816 "../source/data/unidata/confusables.txt", |
| 817 "../source/data/unidata/confusablesWholeScript.txt", |
| 818 ] |
| 819 outputs = [ |
| 820 "$icu_gen_dir/confusables.cfu", |
| 821 ] |
| 822 |
| 823 args = [ |
| 824 gencfu_exe, |
| 825 "-c", |
| 826 "-i", |
| 827 rebase_path(icu_gen_dir), |
| 828 "-r", |
| 829 rebase_path("../source/data/unidata/confusables.txt"), |
| 830 "-w", |
| 831 rebase_path("../source/data/unidata/confusablesWholeScript.txt"), |
| 832 "-o", |
| 833 rebase_path(outputs[0]) |
| 834 ] |
| 835 } |
| 836 # END CONFUSABLES |
| 837 |
| 838 # START icudata.lst/icupkg.inc/icudtl.dat |
| 839 action("icu_write_icudata_lst") { |
| 840 write_file(icu_resource_files_file, icu_data_generated_contents) |
| 841 script = "../build_tools/write_icudata_lst.py" |
| 842 inputs = [ |
| 843 icu_resource_files_file, |
| 844 ] |
| 845 outputs = [ |
| 846 "$icu_gen_tmp_dir/icudata.lst", |
| 847 ] |
| 848 |
| 849 args = [ |
| 850 "--inroot", |
| 851 rebase_path(icu_gen_dir), |
| 852 "--infile", |
| 853 rebase_path(icu_resource_files_file), |
| 854 "--gn-root", |
| 855 rebase_path("//."), |
| 856 "--outfile", |
| 857 rebase_path(outputs[0]) |
| 858 ] |
| 859 } |
| 860 |
| 861 action("icu_write_icupkg_inc") { |
| 862 script = "../build_tools/write_icupkg_inc.py" |
| 863 outputs = [ |
| 864 "$icu_gen_tmp_dir/icupkg.inc", |
| 865 ] |
| 866 |
| 867 args = [ |
| 868 "--outfile", |
| 869 rebase_path(outputs[0]), |
| 870 "--ver", |
| 871 "$ICU_VER", |
| 872 "--icu-dir", |
| 873 rebase_path(".."), |
| 874 ] |
| 875 } |
| 876 |
| 877 import("//third_party/icu/config.gni") |
| 878 |
| 879 action("icu_pkgdata") { |
| 880 script = "run.py" |
| 881 inputs = [ |
| 882 pkgdata_exe, |
| 883 "$icu_gen_tmp_dir/icudata.lst", |
| 884 "$icu_gen_tmp_dir/icupkg.inc", |
| 885 ] + icu_data_generated_contents |
| 886 |
| 887 deps = ["../gn_tool_build_system:pkgdata"] |
| 888 |
| 889 if (icu_use_data_file) { |
| 890 pkgdata_args = [ |
| 891 "-m", # Mode |
| 892 "common", |
| 893 ] |
| 894 outputs = [ |
| 895 "$icu_gen_tmp_dir/result/icudt${ICU_VER}l.dat", |
| 896 ] |
| 897 } else { |
| 898 pkgdata_args = [ |
| 899 "-m", # Mode |
| 900 "dll", |
| 901 "-e", # Entry point |
| 902 "icudt<(ICU_VER)", |
| 903 "-L", # Lib name |
| 904 "icudata", |
| 905 "-T<(icu_gen_tmp_dir)", |
| 906 ] |
| 907 |
| 908 if (is_win) { |
| 909 outputs = [ |
| 910 "$icu_gen_dir/icudt${ICU_VER}l.dll", |
| 911 ] |
| 912 } else { |
| 913 pkgdata_args += [ |
| 914 "-O", |
| 915 "<(icu_gen_tmp_dir)/icupkg.inc", |
| 916 ] |
| 917 outputs = [ |
| 918 "$icu_gen_dir/libicudata.so.${ICU_VER}.1", |
| 919 ] |
| 920 } |
| 921 } |
| 922 args = [ |
| 923 pkgdata_exe, |
| 924 ] + pkgdata_args + [ |
| 925 "-q", # Quiet |
| 926 "-c", # Default copyright |
| 927 "-s", # Source |
| 928 rebase_path(icu_gen_dir), |
| 929 "-d", # Destination |
| 930 rebase_path(icu_gen_tmp_dir + "/result"), |
| 931 "-T", # Temporary directory |
| 932 rebase_path(icu_gen_tmp_dir), |
| 933 "-p", # Data name |
| 934 "icudt${ICU_VER}l", |
| 935 "-r", # Revision |
| 936 "${ICU_VER}.1", |
| 937 rebase_path("$icu_gen_tmp_dir/icudata.lst"), |
| 938 ] |
| 939 } |
| 940 |
| 941 if (icu_use_data_file && is_ios) { |
| 942 # TODO(GYP): Support mac resource bundle shown below. |
| 943 # 'link_settings': { |
| 944 # 'mac_bundle_resources': [ |
| 945 # "$icu_gen_tmp_dir/icudt${ICU_VER}l.dat", |
| 946 # ], |
| 947 # } |
| 948 } else if (icu_use_data_file || is_win) { |
| 949 copy("icu_data") { |
| 950 if (icu_use_data_file) { |
| 951 sources = [ "$icu_gen_tmp_dir/result/icudt${ICU_VER}l.dat", ] |
| 952 outputs = [ "$root_out_dir/icudtl.dat", ] |
| 953 } else { |
| 954 sources = [ "$icu_gen_dir/icud${ICU_VER}.dll", ] |
| 955 outputs = [ "$root_out_dir/icudt.dll", ] |
| 956 } |
| 957 } |
| 958 } else { |
| 959 source_set("icu_data") { |
| 960 sources = [ |
| 961 "$icu_gen_tmp_dir/icudt${ICU_VER}l_dat.S", |
| 962 ] |
| 963 } |
| 964 defines = [ "U_HIDE_DATA_SYMBOL" ] |
| 965 } |
| 966 # END icudata.lst/icudtl.dat |
OLD | NEW |