forked from dotnet/icu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applied changes from old ICU PR: dotnet#104.
- Loading branch information
1 parent
36c0bf2
commit f7b8e5c
Showing
27 changed files
with
5,501 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Building ICU Shards | ||
|
||
The ICU is divided by locales and features. <br/> | ||
|
||
By locale: | ||
- EFIGS (en, fr, it, de, es) | ||
- CJK (zh, ja, ko) | ||
- no CJK (all locales except for zh, ja, ko) | ||
|
||
By features: | ||
- Collation | ||
- Normalization | ||
- Currency | ||
- Locales | ||
- Zones | ||
|
||
To generate ICU shards run: | ||
|
||
`make -C ./eng -f icu.mk shards` | ||
|
||
which will build all shards from filter files available in `icu-filters/` as well as `icu-dictionary.json`, which maps each parent locale (i.e. en) to relevant files. | ||
|
||
## ICU dictionary | ||
The ICU dictionary is divided into the following format: | ||
|
||
``` | ||
{ | ||
"en": { | ||
"essentials": [ | ||
icudt_currency.dat, | ||
icudt_normalization.dat, | ||
icudt_base.dat | ||
] | ||
"zones": [ relevant timezone data files ], | ||
"locales": [ relevant locale data files ], | ||
"coll": [ relevant collationd data files ] | ||
} | ||
. | ||
. | ||
. | ||
} | ||
``` | ||
|
||
To generate just the ICU dictionary run: | ||
|
||
`make -C ./eng -f icu.mk icu_dictionary.json` | ||
|
||
The dictionary is packaged with the data files to be consumed later by the WASM runtime. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
<Project> | ||
<Target Name="Build" Condition="'$(PackOnly)' != 'true'" DependsOnTargets="PatchEmscripten;CopyEmscriptenVersion"> | ||
<Error Condition="'$(TargetOS)' == ''" Text="TargetOS needs to be specified!" /> | ||
<Error Condition="'$(TargetArchitecture)' == ''" Text="TargetArchitecture needs to be specified!" /> | ||
<Target Name="Build" Condition="'$(PackOnly)' != 'true'" DependsOnTargets="PatchEmscripten;CopyEmscriptenVersion"> | ||
<Error Condition="'$(TargetOS)' == ''" Text="TargetOS needs to be specified!" /> | ||
<Error Condition="'$(TargetArchitecture)' == ''" Text="TargetArchitecture needs to be specified!" /> | ||
|
||
<PropertyGroup> | ||
<_ExtraParams Condition="'$(WasmEnableThreads)' == 'true'">WASM_ENABLE_THREADS=true</_ExtraParams> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<_ExtraParams Condition="'$(WasmEnableThreads)' == 'true'">WASM_ENABLE_THREADS=true</_ExtraParams> | ||
</PropertyGroup> | ||
|
||
<Copy SourceFiles="$(MSBuildThisFileDirectory)\..\icu-filters\curr-root.txt" | ||
DestinationFiles="$(MSBuildThisFileDirectory)\..\icu\icu4c\source\data\curr\root.txt"/> | ||
<Exec WorkingDirectory="$(MSBuildThisFileDirectory)" | ||
Command="make -f icu.mk all TARGET_OS=$(TargetOS.ToLower()) TARGET_ARCHITECTURE=$(TargetArchitecture) ICU_TRACING=$(IcuTracing) $(_ExtraParams) SHELL=/bin/bash" | ||
IgnoreStandardErrorWarningFormat="true" /> | ||
</Target> | ||
<Target Name="Restore" /> | ||
<Target Name="Test" /> | ||
<Target Name="Pack" DependsOnTargets="Build"> | ||
<MSBuild Projects="$(MSBuildThisFileDirectory)nuget\Microsoft.NETCore.Runtime.ICU.Transport.pkgproj" Targets="Build" /> | ||
</Target> | ||
<Copy SourceFiles="$(MSBuildThisFileDirectory)\..\icu-filters\curr-root.txt" | ||
DestinationFiles="$(MSBuildThisFileDirectory)\..\icu\icu4c\source\data\curr\root.txt"/> | ||
<Exec WorkingDirectory="$(MSBuildThisFileDirectory)" | ||
Command="make -f icu.mk all TARGET_OS=$(TargetOS.ToLower()) TARGET_ARCHITECTURE=$(TargetArchitecture) ICU_TRACING=$(IcuTracing) ICU_SHARDING=$(IcuSharding) $(_ExtraParams) SHELL=/bin/bash" | ||
IgnoreStandardErrorWarningFormat="true" /> | ||
</Target> | ||
<Target Name="Restore" /> | ||
<Target Name="Test" /> | ||
<Target Name="Pack" DependsOnTargets="Build"> | ||
<MSBuild Projects="$(MSBuildThisFileDirectory)nuget\Microsoft.NETCore.Runtime.ICU.Transport.pkgproj" Targets="Build" /> | ||
</Target> | ||
|
||
<!-- | ||
<!-- | ||
The version of emscripten we are on, emcmake does not pass 'experimental-wasm-threads' to node. In order for the build to | ||
succeed, we need to provide a patched version of that file. Ideally, fixing upstream would be best, but until then, patch. | ||
--> | ||
<Target Name="PatchEmscripten" Condition="'$(TargetOS)' == 'Browser' and '$(WasmEnableThreads)' == 'true'"> | ||
<Copy SourceFiles="$(MSBuildThisFileDirectory)patches\emcc.py" | ||
DestinationFolder="$(EMSDK_PATH)\upstream\emscripten" /> | ||
</Target> | ||
<Target Name="CopyEmscriptenVersion" Condition="'$(TargetOS)' == 'Browser'"> | ||
<ReadLinesFromFile File="$(EMSDK_PATH)\upstream\emscripten\emscripten-version.txt" > | ||
<Output TaskParameter="Lines" | ||
ItemName="_ItemsFromEmscriptenVersionFile"/> | ||
</ReadLinesFromFile> | ||
<WriteLinesToFile | ||
File="$(RepoRoot)\artifacts\bin\icu-browser-wasm\emscripten-version.txt" | ||
Lines="@(_ItemsFromEmscriptenVersionFile->Replace('"', ''))" | ||
Overwrite="true" /> | ||
</Target> | ||
<Target Name="PatchEmscripten" Condition="'$(TargetOS)' == 'Browser' and '$(WasmEnableThreads)' == 'true'"> | ||
<Copy SourceFiles="$(MSBuildThisFileDirectory)patches\emcc.py" | ||
DestinationFolder="$(EMSDK_PATH)\upstream\emscripten" /> | ||
</Target> | ||
<Target Name="CopyEmscriptenVersion" Condition="'$(TargetOS)' == 'Browser'"> | ||
<ReadLinesFromFile File="$(EMSDK_PATH)\upstream\emscripten\emscripten-version.txt" > | ||
<Output TaskParameter="Lines" | ||
ItemName="_ItemsFromEmscriptenVersionFile"/> | ||
</ReadLinesFromFile> | ||
<WriteLinesToFile | ||
File="$(RepoRoot)\artifacts\bin\icu-browser-wasm\emscripten-version.txt" | ||
Lines="@(_ItemsFromEmscriptenVersionFile->Replace('"', ''))" | ||
Overwrite="true" /> | ||
</Target> | ||
</Project> |
Oops, something went wrong.