-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
- Loading branch information
1 parent
a60873e
commit 30537b5
Showing
4 changed files
with
62 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
`enabled_if` in `melange.emit` | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.8) | ||
> (using melange 0.1) | ||
> EOF | ||
|
||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target out) | ||
> (emit_stdlib false) | ||
> (enabled_if %{bin-available:melc})) | ||
> EOF | ||
$ cat > x.ml <<EOF | ||
> let () = Js.log "hello" | ||
> EOF | ||
|
||
$ dune rules @melange | grep '\.cmj' | ||
(File (In_build_dir _build/default/.out.mobjs/melange/melange__X.cmj)))) | ||
.out.mobjs/melange/melange__X.cmj)))) | ||
$ dune build @melange --display short | ||
melc .out.mobjs/melange/melange__X.{cmi,cmj,cmt} | ||
melc out/x.js | ||
|
||
$ dune clean | ||
|
||
`(enabled_if false)` shouldn't build any JS | ||
|
||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target out) | ||
> (emit_stdlib false) | ||
> (enabled_if false)) | ||
> EOF | ||
|
||
$ dune build @melange --display short | ||
|
||
No rules attached to the alias | ||
|
||
$ dune rules @melange |