-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: add an example using dune site and build info
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
(env | ||
(_ | ||
(js_of_ocaml | ||
(compilation_mode separate)))) | ||
|
||
(executable | ||
(name main) | ||
(modes js byte native) | ||
(modules main mysites) | ||
(libraries dune-build-info dune-site)) | ||
|
||
(generate_sites_module | ||
(module mysites) | ||
(sites js_of_ocaml-tests)) | ||
|
||
(install | ||
(section libexec) | ||
(package js_of_ocaml-tests) | ||
(files | ||
(main.bc.js as test-build-info.bc.js) | ||
(main.exe as test-build-info.exe))) |
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,6 @@ | ||
(lang dune 3.7) | ||
(using dune_site 0.1) | ||
|
||
(package | ||
(name js_of_ocaml-tests) | ||
(sites (share tests))) |
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,18 @@ | ||
let version = | ||
match Build_info.V1.version () with | ||
| None -> "unknown" | ||
| Some v -> Build_info.V1.Version.to_string v | ||
|
||
let () = | ||
print_endline "Version:"; | ||
match String.split_on_char '-' version with | ||
| [ tag; plus; _commit; dirty ] -> | ||
Printf.printf "%s-%s-%s-%s\n%!" tag plus "xxxxx" dirty | ||
| [ tag; plus; _commit ] -> | ||
Printf.printf "%s-%s-%s\n%!" tag plus "xxxxx" | ||
| [ x ] -> print_endline x | ||
| _ -> Printf.printf "unexpected: %s\n%!" version | ||
|
||
let () = | ||
print_endline "Sites:"; | ||
List.iter print_endline Mysites.Sites.tests |