]> git.saurik.com Git - apple/icu.git/blob - icuSources/data/buildtool/filtration_schema.json
ICU-64232.0.1.tar.gz
[apple/icu.git] / icuSources / data / buildtool / filtration_schema.json
1 // Copyright (C) 2018 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3
4 {
5 "$id": "http://unicode.org/icu-filter-schema",
6 "$schema": "http://json-schema.org/draft-04/schema#",
7 "description": "JSON Schema for an ICU data filter file",
8 "type": "object",
9 "properties": {
10 "localeFilter": { "$ref": "#/definitions/filter" },
11 "featureFilters": {
12 "type": "object",
13 "additionalProperties": { "$ref": "#/definitions/filter" }
14 },
15 "resourceFilters": {
16 "type": "array",
17 "items": {
18 "type": "object",
19 "properties": {
20 "categories": {
21 "type": "array",
22 "items": { "type": "string" }
23 },
24 "files": { "$ref": "#/definitions/filter" },
25 "rules": {
26 "type": "array",
27 "items": {
28 "type": "string",
29 "pattern": "^[+-]/((\\w+|\\*)(/\\w+|/\\*)*)?$"
30 }
31 }
32 },
33 "required": ["categories", "rules"],
34 "additionalProperties": false
35 }
36 },
37 "fileReplacements": {
38 "type": "object",
39 "properties": {
40 "directory": { "type": "string" },
41 "replacements": {
42 "type": "array",
43 "items": {
44 "type": "object",
45 "properties": {
46 "src": { "type": "string" },
47 "dest": { "type": "string" }
48 },
49 "additionalProperties": false,
50 "required": ["src", "dest"]
51 }
52 }
53 },
54 "additionalProperties": false,
55 "required": ["directory", "replacements"]
56 },
57 "collationUCAData": {
58 "type": "string",
59 "enum": ["unihan", "implicithan"]
60 }
61 },
62 "additionalProperties": false,
63 "definitions": {
64 "filter": {
65 "type": "object",
66 "oneOf": [
67 {
68 "properties": {
69 "filterType": {
70 "$ref": "#/definitions/blacklistWhitelistFilterTypes"
71 },
72 "whitelist": { "$ref": "#/definitions/stringList" }
73 },
74 "required": ["whitelist"],
75 "additionalProperties": false
76 },
77 {
78 "properties": {
79 "filterType": {
80 "$ref": "#/definitions/blacklistWhitelistFilterTypes"
81 },
82 "blacklist": { "$ref": "#/definitions/stringList" }
83 },
84 "required": ["blacklist"],
85 "additionalProperties": false
86 },
87 {
88 "properties": {
89 "filterType": {
90 "type": "string",
91 "enum": ["exclude"]
92 }
93 },
94 "required": ["filterType"],
95 "additionalProperties": false
96 },
97 {
98 "properties": {
99 "filterType": {
100 "type": "string",
101 "enum": ["locale"]
102 },
103 "includeChildren": {
104 "type": "boolean"
105 },
106 "includeScripts": {
107 "type": "boolean"
108 },
109 "whitelist": { "$ref": "#/definitions/stringList" }
110 },
111 "required": ["filterType", "whitelist"],
112 "additionalProperties": false
113 },
114 {
115 "properties": {
116 "filterType": {
117 "type": "string",
118 "enum": ["union"]
119 },
120 "unionOf": {
121 "type": "array",
122 "items": { "$ref": "#/definitions/filter" }
123 }
124 },
125 "required": ["filterType", "unionOf"],
126 "additionalProperties": false
127 }
128 ]
129 },
130 "blacklistWhitelistFilterTypes": {
131 "type": "string",
132 "enum": [
133 "language",
134 "regex"
135 ]
136 },
137 "stringList": {
138 "type": "array",
139 "items": {
140 "type": "string"
141 },
142 "minItems": 1,
143 "uniqueItems": true
144 }
145 }
146 }