Skip to content

Commit dff5e82

Browse files
committed
User '%{bin: ...}' for binaries to have dune locate them correctly
1 parent 182d5eb commit dff5e82

8 files changed

Lines changed: 27 additions & 25 deletions

File tree

bench/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(rule
77
(targets verify.ml)
88
(deps
9-
(:plugin ../src/plugin/protoc_gen_ocaml.exe)
9+
(:plugin %{bin:protoc-gen-ocaml})
1010
(:proto verify.proto))
1111
(action
1212
(run protoc "--plugin=protoc-gen-ocaml=%{plugin}" "--ocaml_out=." %{proto})))

bench/plugin/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
../int64.proto ../string.proto ../float.proto ../enum.proto
1111
../int64_list.proto ../string_list.proto ../float_list.proto ../enum_list.proto
1212
../map.proto)
13-
(:plugin ../../src/plugin/protoc_gen_ocaml.exe)
13+
(:plugin %{bin:protoc-gen-ocaml})
1414
)
1515
(action
1616
(bash "for p in %{proto}; do protoc -I .. --plugin=protoc-gen-ocaml=%{plugin} \"--ocaml_out=annot=[@@deriving show { with_path = false },eq]:.\" $p; done")))

ocaml-protoc-plugin.opam

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ doc: "https://andersfugmann.github.io/ocaml-protoc-plugin/"
99
build: [
1010
["dune" "subst"] {dev}
1111
["dune" "build" "-p" name "-j" jobs]
12-
["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "arm32" & arch != "x86_32"}
12+
["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "arm32" & arch != "x86_32" & os != "win32"}
1313
]
1414

1515
depends: [
@@ -23,7 +23,7 @@ depends: [
2323
"ppx_deriving" {with-test}
2424
"bisect_ppx" {with-test}
2525
"odoc" {with-doc}
26-
"omd"
26+
"omd" {>= "2.0"}
2727
"conf-pkg-config" {build}
2828
"dune-configurator" {with-test}
2929
"yojson" {with-test}
@@ -36,6 +36,8 @@ x-ci-accept-failures: [
3636
"macos-homebrew" # C++ versions less than C++14 are not supported.
3737
]
3838

39+
x-maintenance-intent: ["(latest)"]
40+
3941
synopsis: "Plugin for protoc protobuf compiler to generate ocaml definitions from a .proto file"
4042

4143
description: """ The plugin generates ocaml type definitions,

src/google_types/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
(targets any.ml api.ml descriptor.ml duration.ml empty.ml field_mask.ml
1515
source_context.ml struct.ml timestamp.ml type.ml wrappers.ml)
1616
(deps
17-
(:plugin ../plugin/protoc_gen_ocaml.exe))
17+
(:plugin %{bin:protoc-gen-ocaml}))
1818
(action
19-
(run protoc -I %{read-lines:google_include}
19+
(run %{bin:protoc} -I %{read-lines:google_include}
2020
"--plugin=protoc-gen-ocaml=%{plugin}"
2121
"--ocaml_out=."
2222
%{read-lines:google_include}/google/protobuf/any.proto

test/dune

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
(subdir config
99
(rule
1010
(target support_proto3_optional.conf)
11-
(action (with-accepted-exit-codes (or 0 1) (ignore-stderr (with-stdout-to %{target} (run protoc --experimental_allow_proto3_optional --version)))))))
11+
(action (with-accepted-exit-codes (or 0 1) (ignore-stderr (with-stdout-to %{target} (run %{bin:protoc} --experimental_allow_proto3_optional --version)))))))
1212

1313
(rule
1414
(enabled_if (<> %{read:config/support_proto3_optional.conf} ""))
@@ -52,7 +52,7 @@
5252
options.ml name_clash2.ml empty.ml service_rpc_clash.ml service_empty_package.ml
5353
deprecated.ml json_encoding.ml comments.ml)
5454
(deps
55-
(:plugin ../src/plugin/protoc_gen_ocaml.exe)
55+
(:plugin %{bin:protoc-gen-ocaml})
5656
(:proto
5757
basic.proto primitive_types.proto int_types.proto repeated.proto enum.proto empty_message.proto
5858
message.proto oneof.proto merge.proto map.proto package.proto large.proto
@@ -63,7 +63,7 @@
6363
deprecated.proto json_encoding.proto comments.proto)
6464
)
6565
(action
66-
(run protoc -I %{read-lines:google_include} -I .
66+
(run %{bin:protoc} -I %{read-lines:google_include} -I .
6767
"--plugin=protoc-gen-ocaml=%{plugin}"
6868
"--ocaml_out=open=Google_types_pp;open=Test_runtime;annot=[@@deriving show { with_path = false }, eq]:." %{proto})))
6969

@@ -77,7 +77,7 @@
7777
include_included3_dash.ml
7878
)
7979
(deps
80-
(:plugin ../src/plugin/protoc_gen_ocaml.exe)
80+
(:plugin %{bin:protoc-gen-ocaml})
8181
(:proto
8282
basic.proto
8383
include.proto
@@ -88,7 +88,7 @@
8888
)
8989
)
9090
(action
91-
(run protoc -I %{read-lines:google_include} -I .
91+
(run %{bin:protoc} -I %{read-lines:google_include} -I .
9292
"--plugin=protoc-gen-ocaml=%{plugin}"
9393
"--ocaml_out=open=Google_types_pp;open=Test_runtime;prefix_output_with_package=true;annot=[@@deriving show { with_path = false }, eq]:." %{proto})))
9494

@@ -98,46 +98,46 @@
9898
test_include_b_message.ml
9999
)
100100
(deps
101-
(:plugin ../src/plugin/protoc_gen_ocaml.exe)
101+
(:plugin %{bin:protoc-gen-ocaml})
102102
(:proto
103103
test_include_a/message.proto
104104
test_include_b/message.proto
105105
)
106106
)
107107
(action
108-
(run protoc -I %{read-lines:google_include} -I .
108+
(run %{bin:protoc} -I %{read-lines:google_include} -I .
109109
"--plugin=protoc-gen-ocaml=%{plugin}"
110110
"--ocaml_out=open=Google_types_pp;open=Test_runtime;prefix_output_with_package=true;annot=[@@deriving show { with_path = false }, eq]:." %{proto})))
111111

112112
(rule
113113
(targets int_types_native.ml int_types_native_proto2.ml)
114114
(deps
115-
(:plugin ../src/plugin/protoc_gen_ocaml.exe)
115+
(:plugin %{bin:protoc-gen-ocaml})
116116
(:proto int_types_native.proto int_types_native_proto2.proto))
117117
(action
118-
(run protoc -I %{read-lines:google_include} -I .
118+
(run %{bin:protoc} -I %{read-lines:google_include} -I .
119119
"--plugin=protoc-gen-ocaml=%{plugin}"
120120
"--ocaml_out=open=Google_types_pp;open=Test_runtime;int32_as_int=false;int64_as_int=false;annot=[@@deriving show { with_path = false }, eq]:." %{proto})))
121121

122122
(rule
123123
(targets singleton_record.ml oneof2.ml)
124124
(deps
125-
(:plugin ../src/plugin/protoc_gen_ocaml.exe)
125+
(:plugin %{bin:protoc-gen-ocaml})
126126
(:proto singleton_record.proto oneof2.proto))
127127
(action
128-
(run protoc -I %{read-lines:google_include} -I .
128+
(run %{bin:protoc} -I %{read-lines:google_include} -I .
129129
"--plugin=protoc-gen-ocaml=%{plugin}"
130130
"--ocaml_out=open=Google_types_pp;open=Test_runtime;annot=[@@deriving show { with_path = false }, eq]:." %{proto})))
131131

132132
(rule
133133
(enabled_if (<> %{read:config/support_proto3_optional.conf} ""))
134134
(target proto3_optional.ml)
135135
(deps
136-
(:plugin ../src/plugin/protoc_gen_ocaml.exe)
136+
(:plugin %{bin:protoc-gen-ocaml})
137137
(:proto proto3_optional.proto)
138138
)
139139
(action
140-
(run protoc -I %{read-lines:google_include} -I .
140+
(run %{bin:protoc} -I %{read-lines:google_include} -I .
141141
"--experimental_allow_proto3_optional"
142142
"--plugin=protoc-gen-ocaml=%{plugin}"
143143
"--ocaml_out=open=Google_types_pp;open=Test_runtime;annot=[@@deriving show { with_path = false }, eq]:." %{proto})))

test/google_types_pp/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
(targets any.ml api.ml descriptor.ml duration.ml empty.ml field_mask.ml
1212
source_context.ml struct.ml timestamp.ml type.ml wrappers.ml)
1313
(deps
14-
(:plugin ../../src/plugin/protoc_gen_ocaml.exe))
14+
(:plugin %{bin:protoc-gen-ocaml}))
1515
(action
16-
(run protoc -I %{read-lines:../google_include} -I .
16+
(run %{bin:protoc} -I %{read-lines:../google_include} -I .
1717
"--plugin=protoc-gen-ocaml=%{plugin}"
1818
"--ocaml_out=annot=[@@deriving show { with_path = false }, eq]:."
1919

test/test_params/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
singleton_record_singleton_record.ml
4545
comments_comments.ml)
4646
(deps
47-
(:plugin ../../src/plugin/protoc_gen_ocaml.exe)
47+
(:plugin %{bin:protoc-gen-ocaml})
4848
(:proto
4949
../basic.proto
5050
../deprecated.proto
@@ -84,7 +84,7 @@
8484
../comments.proto)
8585
)
8686
(action
87-
(run protoc -I %{read-lines:../google_include} -I ..
87+
(run %{bin:protoc} -I %{read-lines:../google_include} -I ..
8888
"--plugin=protoc-gen-ocaml=%{plugin}"
8989
"--ocaml_out=open=Google_types_prefixed;singleton_record=true;prefix_output_with_package=true;singleton_oneof_as_option=false:."
9090
%{proto}))

test/test_params/google_types_prefixed/dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
google_protobuf_type.ml
2121
google_protobuf_wrappers.ml)
2222
(deps
23-
(:plugin ../../../src/plugin/protoc_gen_ocaml.exe))
23+
(:plugin %{bin:protoc-gen-ocaml}))
2424
(action
25-
(run protoc -I %{read-lines:../../google_include} -I .
25+
(run %{bin:protoc} -I %{read-lines:../../google_include} -I .
2626
"--plugin=protoc-gen-ocaml=%{plugin}"
2727
"--ocaml_out=singleton_record=true;prefix_output_with_package=true;singleton_oneof_as_option=false:."
2828

0 commit comments

Comments
 (0)