diff --git a/CHANGES.md b/CHANGES.md index c2fceb22..984a694c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -102,6 +102,8 @@ next when not defined by the user and make `@@default` be the default target (#926, @diml) +- Add `%{profile}` variable. (#938, @rgrinberg) + 1.0+beta20 (10/04/2018) ----------------------- diff --git a/doc/jbuild.rst b/doc/jbuild.rst index 3e8b4065..6a515ac1 100644 --- a/doc/jbuild.rst +++ b/doc/jbuild.rst @@ -822,6 +822,7 @@ Jbuilder supports the following variables: not be exactly the same as what you can see in the output of ``ocamlc -config``. In particular, variables added in new versions of OCaml needs to be registered in Jbuilder before they can be used +- ``profile`` the profile selected via ``--profile`` In addition, ``(action ...)`` fields support the following special variables: diff --git a/src/super_context.ml b/src/super_context.ml index 181de7b5..f769a995 100644 --- a/src/super_context.ml +++ b/src/super_context.ml @@ -309,7 +309,7 @@ let create ; "ext_lib" , string context.ext_lib ; "ext_dll" , string context.ext_dll ; "ext_exe" , string context.ext_exe - ; "build_profile" , string context.profile + ; "profile" , string context.profile ] in let vars = diff --git a/test/blackbox-tests/test-cases/workspaces/custom-profile/dune b/test/blackbox-tests/test-cases/workspaces/custom-profile/dune index 1517a8a5..72b034ed 100644 --- a/test/blackbox-tests/test-cases/workspaces/custom-profile/dune +++ b/test/blackbox-tests/test-cases/workspaces/custom-profile/dune @@ -1,3 +1,3 @@ (alias (name runtest) - (action (echo "build profile: %{build_profile}"))) \ No newline at end of file + (action (echo "build profile: %{profile}"))) \ No newline at end of file