File tree 2 files changed +47
-4
lines changed
test/blackbox-tests/test-cases/dune-project-meta/main
2 files changed +47
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ let default_build_command =
13
13
[ " dune" " build" " -p" name " @doc" ] {with - doc}
14
14
]
15
15
| }))
16
- and from_1_11 =
16
+ and from_1_11_before_2_07 =
17
17
lazy
18
18
(Opam_file. parse_value
19
19
(Lexbuf. from_string ~fname: " <internal>"
@@ -26,14 +26,30 @@ let default_build_command =
26
26
" @doc" {with - doc}
27
27
]
28
28
]
29
+ | }))
30
+ and from_2_07 =
31
+ lazy
32
+ (Opam_file. parse_value
33
+ (Lexbuf. from_string ~fname: " <internal>"
34
+ {|
35
+ [
36
+ [ " dune" " subst" ] {dev}
37
+ [ " dune" " build" " -p" name " -j" jobs
38
+ " @install"
39
+ " @runtest" {with - test}
40
+ " @doc" {with - doc}
41
+ ]
42
+ ]
29
43
| }))
30
44
in
31
45
fun project ->
32
46
Lazy. force
33
47
( if Dune_project. dune_version project < (1 , 11 ) then
34
- before_1_11
35
- else
36
- from_1_11 )
48
+ before_1_11
49
+ else if Dune_project. dune_version project < (2 , 7 ) then
50
+ from_1_11_before_2_07
51
+ else
52
+ from_2_07 )
37
53
38
54
let package_fields
39
55
{ Package. synopsis
Original file line number Diff line number Diff line change @@ -397,3 +397,30 @@ Same with version of the language >= 2.6, we now add the constraint:
397
397
depends: [
398
398
" dune" {>= " 2.6" }
399
399
]
400
+
401
+ When the version of the language >= 2.7 we use dev instead of pinned
402
+ when calling dune subst :
403
+
404
+ $ cat > dune-project << EOF
405
+ > (lang dune 2.7 )
406
+ > (name foo)
407
+ > (generate_opam_files true)
408
+ > (package (name foo))
409
+ > EOF
410
+
411
+ $ dune build foo. opam
412
+ $ grep -A13 ^ build: foo. opam
413
+ build: [
414
+ [" dune" " subst" ] {dev}
415
+ [
416
+ " dune"
417
+ " build"
418
+ " -p"
419
+ name
420
+ " -j"
421
+ jobs
422
+ " @ install"
423
+ " @ runtest" {with-test}
424
+ " @ doc" {with-doc}
425
+ ]
426
+ ]
You can’t perform that action at this time.
0 commit comments