From 61d33114ee58cba37ecc49457545ba7cf52bf484 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 20 Jul 2018 14:02:14 +0200 Subject: [PATCH] Bump latest version to 1.1 And make this version a pre-req for the env field in workspaces Signed-off-by: Rudi Grinberg --- src/workspace.ml | 9 +++++++-- .../test-cases/workspaces/workspace-env/dune-project | 2 +- .../test-cases/workspaces/workspace-env/dune-workspace | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/workspace.ml b/src/workspace.ml index a8408ac2..ad1e5e4a 100644 --- a/src/workspace.ml +++ b/src/workspace.ml @@ -5,6 +5,11 @@ open Stanza.Of_sexp for simplicity *) let syntax = Stanza.syntax +let env_field = + field_o "env" + (Syntax.since syntax (1, 1) >>= fun () -> + Dune_env.Stanza.t) + module Context = struct module Target = struct type t = @@ -49,7 +54,7 @@ module Context = struct } let t ~profile = - field_o "env" Dune_env.Stanza.t >>= fun env -> + env_field >>= fun env -> field "targets" (list Target.t) ~default:[Target.Native] >>= fun targets -> field "profile" string ~default:profile @@ -155,7 +160,7 @@ include Versioned_file.Make(struct type t = unit end) let () = Lang.register syntax () let t ?x ?profile:cmdline_profile () = - field_o "env" Dune_env.Stanza.t >>= fun env -> + env_field >>= fun env -> field "profile" string ~default:Config.default_build_profile >>= fun profile -> let profile = Option.value cmdline_profile ~default:profile in diff --git a/test/blackbox-tests/test-cases/workspaces/workspace-env/dune-project b/test/blackbox-tests/test-cases/workspaces/workspace-env/dune-project index b2559fa0..6687faf2 100644 --- a/test/blackbox-tests/test-cases/workspaces/workspace-env/dune-project +++ b/test/blackbox-tests/test-cases/workspaces/workspace-env/dune-project @@ -1 +1 @@ -(lang dune 1.0) \ No newline at end of file +(lang dune 1.1) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/workspaces/workspace-env/dune-workspace b/test/blackbox-tests/test-cases/workspaces/workspace-env/dune-workspace index 53fa33c9..4042a1a4 100644 --- a/test/blackbox-tests/test-cases/workspaces/workspace-env/dune-workspace +++ b/test/blackbox-tests/test-cases/workspaces/workspace-env/dune-workspace @@ -1,4 +1,4 @@ -(lang dune 1.0) +(lang dune 1.1) (env (default