1
+ module Bsb_dir_index : sig
2
+ #1 " bsb_dir_index.mli"
3
+ (* Copyright (C) 2017 Authors of BuckleScript
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Lesser General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * In addition to the permissions granted to you by the LGPL, you may combine
11
+ * or link a "work that uses the Library" with a publicly distributed version
12
+ * of this file to produce a combined library or application, then distribute
13
+ * that combined work under the terms of your choosing, with no requirement
14
+ * to comply with the obligations normally placed on you by section 4 of the
15
+ * LGPL version 3 (or the corresponding section of a later version of the LGPL
16
+ * should you choose to use a later version).
17
+ *
18
+ * This program is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ * GNU Lesser General Public License for more details.
22
+ *
23
+ * You should have received a copy of the GNU Lesser General Public License
24
+ * along with this program; if not, write to the Free Software
25
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
26
+
27
+ (* * Used to index [.bsbuildcache] may not be needed if we flatten dev
28
+ into a single group
29
+ *)
30
+ type t = private int
31
+
32
+ val lib_dir_index : t
33
+
34
+ val is_lib_dir : t -> bool
35
+
36
+ val get_dev_index : unit -> t
37
+
38
+ val of_int : int -> t
39
+
40
+ val get_current_number_of_dev_groups : unit -> int
41
+
42
+
43
+ val string_of_bsb_dev_include : t -> string
44
+
45
+ (* * TODO: Need reset
46
+ when generating each ninja file to provide stronger guarantee.
47
+ Here we get a weak guarantee because only dev group is
48
+ inside the toplevel project
49
+ *)
50
+ val reset : unit -> unit
51
+ end = struct
52
+ #1 " bsb_dir_index.ml"
53
+ (* Copyright (C) 2017 Authors of BuckleScript
54
+ *
55
+ * This program is free software: you can redistribute it and/or modify
56
+ * it under the terms of the GNU Lesser General Public License as published by
57
+ * the Free Software Foundation, either version 3 of the License, or
58
+ * (at your option) any later version.
59
+ *
60
+ * In addition to the permissions granted to you by the LGPL, you may combine
61
+ * or link a "work that uses the Library" with a publicly distributed version
62
+ * of this file to produce a combined library or application, then distribute
63
+ * that combined work under the terms of your choosing, with no requirement
64
+ * to comply with the obligations normally placed on you by section 4 of the
65
+ * LGPL version 3 (or the corresponding section of a later version of the LGPL
66
+ * should you choose to use a later version).
67
+ *
68
+ * This program is distributed in the hope that it will be useful,
69
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
70
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
71
+ * GNU Lesser General Public License for more details.
72
+ *
73
+ * You should have received a copy of the GNU Lesser General Public License
74
+ * along with this program; if not, write to the Free Software
75
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
76
+
77
+ type t = int
78
+
79
+ (* *
80
+ 0 : lib
81
+ 1 : dev 1
82
+ 2 : dev 2
83
+ *)
84
+ external of_int : int -> t = " %identity"
85
+ let lib_dir_index = 0
86
+
87
+ let is_lib_dir x = x = lib_dir_index
88
+
89
+ let dir_index = ref 0
90
+
91
+ let get_dev_index ( ) =
92
+ incr dir_index ; ! dir_index
93
+
94
+ let get_current_number_of_dev_groups =
95
+ (fun () -> ! dir_index )
96
+
97
+
98
+ (* * bsb generate pre-defined variables [bsc_group_i_includes]
99
+ for each rule, there is variable [bsc_extra_excludes]
100
+ [g_dev_incls] are for app test etc
101
+ it will be like
102
+ {[
103
+ g_dev_incls = ${bsc_group_1_includes}
104
+ ]}
105
+ where [bsc_group_1_includes] will be pre-calcuated
106
+ *)
107
+ let bsc_group_1_includes = " bsc_group_1_includes"
108
+ let bsc_group_2_includes = " bsc_group_2_includes"
109
+ let bsc_group_3_includes = " bsc_group_3_includes"
110
+ let bsc_group_4_includes = " bsc_group_4_includes"
111
+ let string_of_bsb_dev_include i =
112
+ match i with
113
+ | 1 -> bsc_group_1_includes
114
+ | 2 -> bsc_group_2_includes
115
+ | 3 -> bsc_group_3_includes
116
+ | 4 -> bsc_group_4_includes
117
+ | _ ->
118
+ " bsc_group_" ^ string_of_int i ^ " _includes"
119
+
120
+
121
+ let reset () = dir_index := 0
122
+ end
1
123
module Ext_buffer : sig
2
124
#1 " ext_buffer.mli"
3
125
(* **********************************************************************)
@@ -1416,8 +1538,8 @@ let rec mem_string (xs : string list) (x : string) =
1416
1538
| a ::l -> a = x || mem_string l x
1417
1539
1418
1540
end
1419
- module Bsb_arg : sig
1420
- #1 " bsb_arg .mli"
1541
+ module Bsb_helper_arg : sig
1542
+ #1 " bsb_helper_arg .mli"
1421
1543
1422
1544
1423
1545
@@ -1441,7 +1563,7 @@ val parse_exn :
1441
1563
1442
1564
1443
1565
end = struct
1444
- #1 " bsb_arg .ml"
1566
+ #1 " bsb_helper_arg .ml"
1445
1567
1446
1568
type key = string
1447
1569
type doc = string
@@ -1596,128 +1718,6 @@ let parse_exn (speclist : t) anonfun errmsg =
1596
1718
;;
1597
1719
*)
1598
1720
1599
- end
1600
- module Bsb_dir_index : sig
1601
- #1 " bsb_dir_index.mli"
1602
- (* Copyright (C) 2017 Authors of BuckleScript
1603
- *
1604
- * This program is free software: you can redistribute it and/or modify
1605
- * it under the terms of the GNU Lesser General Public License as published by
1606
- * the Free Software Foundation, either version 3 of the License, or
1607
- * (at your option) any later version.
1608
- *
1609
- * In addition to the permissions granted to you by the LGPL, you may combine
1610
- * or link a "work that uses the Library" with a publicly distributed version
1611
- * of this file to produce a combined library or application, then distribute
1612
- * that combined work under the terms of your choosing, with no requirement
1613
- * to comply with the obligations normally placed on you by section 4 of the
1614
- * LGPL version 3 (or the corresponding section of a later version of the LGPL
1615
- * should you choose to use a later version).
1616
- *
1617
- * This program is distributed in the hope that it will be useful,
1618
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1619
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1620
- * GNU Lesser General Public License for more details.
1621
- *
1622
- * You should have received a copy of the GNU Lesser General Public License
1623
- * along with this program; if not, write to the Free Software
1624
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
1625
-
1626
- (* * Used to index [.bsbuildcache] may not be needed if we flatten dev
1627
- into a single group
1628
- *)
1629
- type t = private int
1630
-
1631
- val lib_dir_index : t
1632
-
1633
- val is_lib_dir : t -> bool
1634
-
1635
- val get_dev_index : unit -> t
1636
-
1637
- val of_int : int -> t
1638
-
1639
- val get_current_number_of_dev_groups : unit -> int
1640
-
1641
-
1642
- val string_of_bsb_dev_include : t -> string
1643
-
1644
- (* * TODO: Need reset
1645
- when generating each ninja file to provide stronger guarantee.
1646
- Here we get a weak guarantee because only dev group is
1647
- inside the toplevel project
1648
- *)
1649
- val reset : unit -> unit
1650
- end = struct
1651
- #1 " bsb_dir_index.ml"
1652
- (* Copyright (C) 2017 Authors of BuckleScript
1653
- *
1654
- * This program is free software: you can redistribute it and/or modify
1655
- * it under the terms of the GNU Lesser General Public License as published by
1656
- * the Free Software Foundation, either version 3 of the License, or
1657
- * (at your option) any later version.
1658
- *
1659
- * In addition to the permissions granted to you by the LGPL, you may combine
1660
- * or link a "work that uses the Library" with a publicly distributed version
1661
- * of this file to produce a combined library or application, then distribute
1662
- * that combined work under the terms of your choosing, with no requirement
1663
- * to comply with the obligations normally placed on you by section 4 of the
1664
- * LGPL version 3 (or the corresponding section of a later version of the LGPL
1665
- * should you choose to use a later version).
1666
- *
1667
- * This program is distributed in the hope that it will be useful,
1668
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1669
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1670
- * GNU Lesser General Public License for more details.
1671
- *
1672
- * You should have received a copy of the GNU Lesser General Public License
1673
- * along with this program; if not, write to the Free Software
1674
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
1675
-
1676
- type t = int
1677
-
1678
- (* *
1679
- 0 : lib
1680
- 1 : dev 1
1681
- 2 : dev 2
1682
- *)
1683
- external of_int : int -> t = " %identity"
1684
- let lib_dir_index = 0
1685
-
1686
- let is_lib_dir x = x = lib_dir_index
1687
-
1688
- let dir_index = ref 0
1689
-
1690
- let get_dev_index ( ) =
1691
- incr dir_index ; ! dir_index
1692
-
1693
- let get_current_number_of_dev_groups =
1694
- (fun () -> ! dir_index )
1695
-
1696
-
1697
- (* * bsb generate pre-defined variables [bsc_group_i_includes]
1698
- for each rule, there is variable [bsc_extra_excludes]
1699
- [g_dev_incls] are for app test etc
1700
- it will be like
1701
- {[
1702
- g_dev_incls = ${bsc_group_1_includes}
1703
- ]}
1704
- where [bsc_group_1_includes] will be pre-calcuated
1705
- *)
1706
- let bsc_group_1_includes = " bsc_group_1_includes"
1707
- let bsc_group_2_includes = " bsc_group_2_includes"
1708
- let bsc_group_3_includes = " bsc_group_3_includes"
1709
- let bsc_group_4_includes = " bsc_group_4_includes"
1710
- let string_of_bsb_dev_include i =
1711
- match i with
1712
- | 1 -> bsc_group_1_includes
1713
- | 2 -> bsc_group_2_includes
1714
- | 3 -> bsc_group_3_includes
1715
- | 4 -> bsc_group_4_includes
1716
- | _ ->
1717
- " bsc_group_" ^ string_of_int i ^ " _includes"
1718
-
1719
-
1720
- let reset () = dir_index := 0
1721
1721
end
1722
1722
module Ext_digest : sig
1723
1723
#1 " ext_digest.mli"
@@ -4494,7 +4494,7 @@ let anonymous filename =
4494
4494
let usage = " Usage: bsb_helper.exe [options] \n Options are:"
4495
4495
4496
4496
let () =
4497
- Bsb_arg . parse_exn [
4497
+ Bsb_helper_arg . parse_exn [
4498
4498
" -g" , Set_int dev_group ,
4499
4499
" Set the dev group (default to be 0)"
4500
4500
;
0 commit comments