forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d52cba
commit 38421d7
Showing
24 changed files
with
263 additions
and
347 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,47 @@ | ||
(use_meta_lang) | ||
(* -*- tuareg -*- *) | ||
|
||
open StdLabels | ||
|
||
let commands = | ||
[ "build" | ||
; "build-package" | ||
; "external-lib-deps" | ||
; "install" | ||
; "installed-libraries" | ||
; "runtest" | ||
; "uninstall" | ||
] | ||
|
||
let jbuild = | ||
String.concat ~sep:"" | ||
({| | ||
(jbuild_version 1) | ||
|
||
(install | ||
((section doc) | ||
(files (manual.org)))) | ||
|
||
(:let :commands | ||
(build | ||
build-package | ||
external-lib-deps | ||
install | ||
installed-libraries | ||
runtest | ||
uninstall)) | ||
|
||
(:let-macro (:man-file :cmd) | ||
(:concat "" (jbuilder- (:cmd) .1))) | ||
|
||
(rule | ||
((targets (jbuilder.1)) | ||
(action (with-stdout-to ${@} | ||
(run ${bin:jbuilder} --help=groff))))) | ||
|
||
(:foreach :cmd (:commands) | ||
(rule | ||
((targets ((:man-file (:cmd)))) | ||
(action (with-stdout-to ${@} | ||
(run ${bin:jbuilder} (:cmd) --help=groff)))))) | ||
|
||
|} :: List.map commands ~f:(fun cmd -> | ||
Printf.sprintf {| | ||
(rule | ||
((targets (jbuilder-%s.1)) | ||
(action (with-stdout-to ${@} | ||
(run ${bin:jbuilder} %s --help=groff))))) | ||
|} cmd cmd) | ||
@ [ Printf.sprintf {| | ||
(install | ||
((section man) | ||
(files ( | ||
jbuilder.1 | ||
(:foreach :cmd (:commands) (:man-file (:cmd))) | ||
%s | ||
)))) | ||
|} (String.concat ~sep:"\n " | ||
(List.map commands ~f:(Printf.sprintf "jbuilder-%s.1"))) | ||
]) | ||
|
||
(alias | ||
((name runtest) | ||
(deps (jbuild)) | ||
(action (run ${bin:cinaps} ${<})))) | ||
let () = | ||
Jbuild_plugin.V1.send jbuild |
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,17 @@ | ||
(** API for jbuild plugins *) | ||
|
||
module V1 : sig | ||
(** Current build context *) | ||
val context : string | ||
|
||
(** OCaml version for the current buid context. It might not be the | ||
same as [Sys.ocaml_version] *) | ||
val ocaml_version : string | ||
|
||
(** Output of [ocamlc -config] for this context *) | ||
val ocamlc_config : (string * string) list | ||
|
||
(** [send s] send [s] to jbuilder. [s] should be the contents of a | ||
jbuild file following the specification described in the manual. *) | ||
val send : string -> unit | ||
end |
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
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
;; This program must have no dependencies outside of the compiler | ||
;; distribution as it is used to build all of Jane Street packages | ||
(jbuild_version 1) | ||
|
||
(library | ||
((name jbuilder) | ||
(public_name jbuilder) | ||
(libraries (unix jbuilder_re)) | ||
(preprocess no_preprocessing))) | ||
(libraries (unix jbuilder_re)))) | ||
|
||
(ocamllex (sexp_lexer meta_lexer rewrite_generated_file glob_lexer)) |
Oops, something went wrong.