Skip to content

Commit 7b35284

Browse files
authored
Merge pull request #1192 from bloomberg/non_node_module_resolution
1. clean up the build system to use node_moduels/bs-platform/ instead of inferred path\n 2. allow append bsc-flags so that we can provide a built in (allow reset later)
2 parents e52859b + e8bc689 commit 7b35284

33 files changed

+930
-492
lines changed

docs/docson/build-schema.json

Lines changed: 134 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
"$ref": "#/definitions/single-ppx-spec"
3737
}
3838
},
39-
"bs-dependency" : {
40-
"type" : "string",
39+
"bs-dependency": {
40+
"type": "string",
4141
"title": "dependency"
42-
},
42+
},
4343
"bs-dependencies": {
4444
"type": "array",
4545
"items": {
@@ -49,128 +49,131 @@
4949
},
5050
"sourceItem": {
5151
"title": "sourceItem",
52-
"oneOf" : [
52+
"oneOf": [
5353
{
54-
"type" : "object",
55-
"properties": {
56-
"dir": {
57-
"type": "string"
58-
},
59-
"ppx-specs": {
60-
"$ref": "#/definitions/ppx-specs"
61-
},
62-
"type" : {
63-
"enum" : ["dev", "lib"]
64-
},
65-
"files": {
66-
"oneOf": [
67-
{
68-
"type": "array",
69-
"items": {
70-
"type": "string"
71-
},
72-
"description": "if files are empty, the build tool will populate it automatically, this is useful for initial adoption"
54+
"type": "object",
55+
"properties": {
56+
"dir": {
57+
"type": "string"
7358
},
74-
{
75-
"type": "object",
76-
"properties": {
77-
"slow-re": {
78-
"type": "string",
79-
"description": "Regex to glob the patterns, syntax is documented here: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html, if users want to have better performance for incremental build, we would suggest list it explicitly"
80-
},
81-
"excludes": {
59+
"ppx-specs": {
60+
"$ref": "#/definitions/ppx-specs"
61+
},
62+
"type": {
63+
"enum": [
64+
"dev",
65+
"lib"
66+
]
67+
},
68+
"files": {
69+
"oneOf": [
70+
{
8271
"type": "array",
8372
"items": {
8473
"type": "string"
8574
},
86-
"description": "A list of strings to be excluded "
75+
"description": "if files are empty, the build tool will populate it automatically, this is useful for initial adoption"
76+
},
77+
{
78+
"type": "object",
79+
"properties": {
80+
"slow-re": {
81+
"type": "string",
82+
"description": "Regex to glob the patterns, syntax is documented here: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html, if users want to have better performance for incremental build, we would suggest list it explicitly"
83+
},
84+
"excludes": {
85+
"type": "array",
86+
"items": {
87+
"type": "string"
88+
},
89+
"description": "A list of strings to be excluded "
90+
}
91+
},
92+
"required": [
93+
"slow-re"
94+
]
8795
}
88-
},
89-
"required": [
90-
"slow-re"
9196
]
92-
}
93-
]
94-
},
95-
"bs-dependencies": {
96-
"$ref": "#/definitions/bs-dependencies",
97-
"description": "More dependencies added to this group"
98-
},
99-
"public": {
100-
"oneOf": [
101-
{
102-
"enum": [
103-
"all"
97+
},
98+
"bs-dependencies": {
99+
"$ref": "#/definitions/bs-dependencies",
100+
"description": "More dependencies added to this group"
101+
},
102+
"public": {
103+
"oneOf": [
104+
{
105+
"enum": [
106+
"all"
107+
],
108+
"description": "All modules in this directory"
109+
},
110+
{
111+
"type": "array",
112+
"items": {
113+
"type": "string"
114+
},
115+
"description": "Selected modules, for example, [Module_a, Module_b] "
116+
}
104117
],
105-
"description": "All modules in this directory"
118+
"description": "default: export all modules by default, it is recommended for library developers to hide some interfaces"
106119
},
107-
{
120+
"resources": {
108121
"type": "array",
109122
"items": {
110123
"type": "string"
111-
},
112-
"description": "Selected modules, for example, [Module_a, Module_b] "
113-
}
114-
],
115-
"description": "default: export all modules by default, it is recommended for library developers to hide some interfaces"
116-
},
117-
"resources": {
118-
"type": "array",
119-
"items": {
120-
"type": "string"
121-
}
122-
},
123-
"subdirs": {
124-
"$ref" : "#/definitions/sources",
125-
"description": "nested specifications inside"
126-
},
127-
"group": {
128-
"oneOf": [
129-
{
130-
"type": "string",
131-
"description": "A _unique_ name for each directory to refer as an internal dependency later"
124+
}
125+
},
126+
"subdirs": {
127+
"$ref": "#/definitions/sources",
128+
"description": "nested specifications inside"
132129
},
133-
{
134-
"properties": {
135-
"name": {
136-
"type": "string"
130+
"group": {
131+
"oneOf": [
132+
{
133+
"type": "string",
134+
"description": "A _unique_ name for each directory to refer as an internal dependency later"
137135
},
138-
"hierachy": {
139-
"type": "boolean",
140-
"description": "When true, all subdirs are considered as a whole as dependency"
136+
{
137+
"properties": {
138+
"name": {
139+
"type": "string"
140+
},
141+
"hierachy": {
142+
"type": "boolean",
143+
"description": "When true, all subdirs are considered as a whole as dependency"
144+
}
145+
}
141146
}
147+
],
148+
"description": "Not implemented yet"
149+
},
150+
"internal-depends": {
151+
"type": "array",
152+
"items": {
153+
"type": "string",
154+
"description": "internal dependencies, if unspecified, all existing listed source files are considered potential dependencies"
142155
}
143156
}
144-
],
145-
"description": "Not implemented yet"
157+
},
158+
"required": [
159+
"dir"
160+
]
146161
},
147-
"internal-depends": {
148-
"type": "array",
149-
"items": {
150-
"type": "string",
151-
"description": "internal dependencies, if unspecified, all existing listed source files are considered potential dependencies"
152-
}
162+
{
163+
"title": "single non nested directory",
164+
"type": "string",
165+
"description": "directory name (no nested)"
153166
}
154-
},
155-
"required": [
156-
"dir"
157-
]
158-
},
159-
{
160-
"title": "single non nested directory",
161-
"type" : "string",
162-
"description": "directory name (no nested)"
163-
}
164167
]
165168
},
166-
"sources" : {
167-
"oneOf": [
169+
"sources": {
170+
"oneOf": [
168171
{
169172
"type": "array",
170173
"items": {
171174
"$ref": "#/definitions/sourceItem"
172175
},
173-
"description" : "A list of source items"
176+
"description": "A list of source items"
174177
},
175178
{
176179
"$ref": "#/definitions/sourceItem",
@@ -179,6 +182,33 @@
179182
],
180183
"description": "can be either a single sourceItem or an array of sourceItems, sourceItem can be either a single string(non nested directory) or an detailed object config"
181184
},
185+
"bsc-flags": {
186+
"oneOf": [
187+
{
188+
"type": "array",
189+
"items": {
190+
"type": "string"
191+
},
192+
"description": "It will append flags to the default"
193+
},
194+
{
195+
"properties": {
196+
"kind" :
197+
{
198+
"enum": [
199+
"reset",
200+
"prefix",
201+
"append"
202+
]
203+
},
204+
"flags" : {
205+
"$ref" : "#/definitions/stringArray"
206+
}
207+
},
208+
"description": "Not implemented yet"
209+
}
210+
]
211+
},
182212
"stringArray": {
183213
"type": "array",
184214
"items": {
@@ -241,13 +271,16 @@
241271
"description": "external include directories, which will be applied -I to all compilation units, it is *not needed* in most cases"
242272
},
243273
"sources": {
244-
"$ref" : "#/definitions/sources",
245-
"description": "specication of where source code is "
274+
"$ref": "#/definitions/sources",
275+
"description": "specication of where source code is "
246276
},
247-
248277
"generate-merlin": {
249278
"type": "boolean",
250279
"description": "default true (generate .merlin)"
280+
},
281+
"use-stdlib" : {
282+
"type" : "boolean",
283+
"description": "default true(Set use OCaml stdlib or not)"
251284
}
252285
},
253286
"additionalProperties": false,

jscomp/all.depend

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ core/lam_analysis.cmx : core/lam.cmx core/lam_analysis.cmi
346346
core/lam_closure.cmx : core/lam_analysis.cmx core/lam.cmx ext/ident_set.cmx \
347347
ext/ident_map.cmx core/lam_closure.cmi
348348
core/js_cmj_format.cmx : ext/string_map.cmx core/lam.cmx \
349-
common/js_config.cmx ext/ext_pervasives.cmx core/js_cmj_format.cmi
349+
common/js_config.cmx ext/ext_string.cmx ext/ext_pervasives.cmx \
350+
core/js_cmj_format.cmi
350351
core/js_fun_env.cmx : ext/ident_set.cmx ext/ext_list.cmx core/js_fun_env.cmi
351352
core/js_call_info.cmx : core/js_call_info.cmi
352353
core/js_closure.cmx : ext/ident_set.cmx core/js_closure.cmi
@@ -654,17 +655,17 @@ bsb/bsb_build_util.cmx : ext/literals.cmx ext/ext_sys.cmx ext/ext_string.cmx \
654655
bsb/bsb_build_util.cmi
655656
bsb/bsb_config.cmx : ext/string_set.cmx ext/literals.cmx ext/ext_string.cmx \
656657
ext/ext_filename.cmx bsb/bsb_config.cmi
657-
bsb/bsb_config_parse.cmx : ext/string_hash_set.cmx ext/literals.cmx \
658-
ext/ext_string.cmx ext/ext_json.cmx ext/ext_filename.cmx \
658+
bsb/bsb_config_parse.cmx : ext/string_map.cmx ext/string_hash_set.cmx \
659+
ext/literals.cmx ext/ext_string.cmx ext/ext_json.cmx ext/ext_filename.cmx \
659660
ext/ext_file_pp.cmx bsb/bsb_default.cmx bsb/bsb_config_types.cmx \
660661
bsb/bsb_config.cmx bsb/bsb_build_util.cmx bsb/bsb_build_ui.cmx \
661662
bsb/bsb_build_schemas.cmx bsb/bsb_config_parse.cmi
662663
bsb/bsb_config_types.cmx : ext/string_hash_set.cmx bsb/bsb_config.cmx \
663664
bsb/bsb_build_ui.cmx
664665
bsb/bsb_default.cmx : ext/string_set.cmx ext/literals.cmx \
665666
ext/ext_pervasives.cmx ext/ext_filename.cmx bsb/bsb_config_types.cmx \
666-
bsb/bsb_config.cmx bsb/bsb_build_util.cmx common/bs_pkg.cmx \
667-
bsb/bsb_default.cmi
667+
bsb/bsb_config.cmx bsb/bsb_build_util.cmx common/bs_version.cmx \
668+
common/bs_pkg.cmx bsb/bsb_default.cmi
668669
bsb/bsb_dep_infos.cmx : bsb/bsb_dep_infos.cmi
669670
bsb/bsb_dir.cmx : bsb/bsb_dir.cmi
670671
bsb/bsb_file.cmx : bsb/bsb_file.cmi

0 commit comments

Comments
 (0)