[cmx] Add cmx to peridot

TESTED=
fx shell '/pkgfs/packages/modular_tests/0/test/run_modular_tests.sh'
booted all layers and played around with it

CF-129 #comment
MF-73 #done

Change-Id: I40705a51ebd3793432986878d698186f1cca7361
diff --git a/bin/agents/clipboard/BUILD.gn b/bin/agents/clipboard/BUILD.gn
index 7c7c38c..95b6e16 100644
--- a/bin/agents/clipboard/BUILD.gn
+++ b/bin/agents/clipboard/BUILD.gn
@@ -6,7 +6,12 @@
 import("//peridot/build/tests_package.gni")
 
 executable_package("clipboard_agent") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/clipboard_agent.cmx"
+      dest = "clipboard_agent.cmx"
+    },
+  ]
 
   sources = [
     "clipboard_agent.cc",
diff --git a/bin/agents/clipboard/meta/clipboard_agent.cmx b/bin/agents/clipboard/meta/clipboard_agent.cmx
new file mode 100644
index 0000000..6930e41
--- /dev/null
+++ b/bin/agents/clipboard/meta/clipboard_agent.cmx
@@ -0,0 +1,20 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "features": [],
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.modular.ModuleContext",
+            "fuchsia.modular.auth.TokenProvider",
+            "fuchsia.modular.AgentContext",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.net.oldhttp.HttpService",
+            "fuchsia.netconnector.NetConnector",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
diff --git a/bin/basemgr/BUILD.gn b/bin/basemgr/BUILD.gn
index 82aab03..1742abb 100644
--- a/bin/basemgr/BUILD.gn
+++ b/bin/basemgr/BUILD.gn
@@ -110,7 +110,12 @@
 }
 
 executable_package("dev_base_shell") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/dev_base_shell.cmx"
+      dest = "dev_base_shell.cmx"
+    },
+  ]
 
   sources = [
     "dev_base_shell.cc",
diff --git a/bin/basemgr/meta/dev_base_shell.cmx b/bin/basemgr/meta/dev_base_shell.cmx
new file mode 100644
index 0000000..bb431a0
--- /dev/null
+++ b/bin/basemgr/meta/dev_base_shell.cmx
@@ -0,0 +1,24 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "features": [
+            "persistent-storage"
+        ],
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.BasemgrMonitor",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.sys.Launcher",
+            "fuchsia.testing.runner.TestRunner",
+            "fuchsia.testing.runner.TestRunnerStore",
+            "fuchsia.tracelink.Registry",
+            "fuchsia.ui.policy.Presenter",
+            "fuchsia.ui.viewsv1.ViewManager"
+        ],
+        "system": [
+            "data/sysui"
+        ]
+    }
+}
diff --git a/bin/context_engine/BUILD.gn b/bin/context_engine/BUILD.gn
index 1c96edd..da1d90a 100644
--- a/bin/context_engine/BUILD.gn
+++ b/bin/context_engine/BUILD.gn
@@ -6,7 +6,12 @@
 import("//peridot/build/tests_package.gni")
 
 executable_package("context_engine") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/context_engine.cmx"
+      dest = "context_engine.cmx"
+    },
+  ]
 
   sources = [
     "context_engine_main.cc",
diff --git a/bin/context_engine/meta/context_engine.cmx b/bin/context_engine/meta/context_engine.cmx
new file mode 100644
index 0000000..dc2f0ff
--- /dev/null
+++ b/bin/context_engine/meta/context_engine.cmx
@@ -0,0 +1,15 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.BasemgrMonitor",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.ui.policy.Presenter",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
diff --git a/bin/sessionmgr/BUILD.gn b/bin/sessionmgr/BUILD.gn
index 8642a7a..d7fafd2 100644
--- a/bin/sessionmgr/BUILD.gn
+++ b/bin/sessionmgr/BUILD.gn
@@ -92,7 +92,12 @@
 }
 
 executable_package("dev_session_shell") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/dev_session_shell.cmx"
+      dest = "dev_session_shell.cmx"
+    },
+  ]
 
   sources = [
     "dev_session_shell.cc",
diff --git a/bin/sessionmgr/meta/dev_session_shell.cmx b/bin/sessionmgr/meta/dev_session_shell.cmx
new file mode 100644
index 0000000..fe2317c
--- /dev/null
+++ b/bin/sessionmgr/meta/dev_session_shell.cmx
@@ -0,0 +1,19 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.BasemgrMonitor",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.sys.Environment",
+            "fuchsia.sys.Launcher",
+            "fuchsia.sys.Loader",
+            "fuchsia.tracelink.Registry",
+            "fuchsia.ui.policy.Presenter",
+            "fuchsia.ui.viewsv1.ViewManager",
+            "fuchsia.ui.viewsv1.ViewSnapshot"
+        ]
+    }
+}
diff --git a/bin/sessionmgr/story_runner/BUILD.gn b/bin/sessionmgr/story_runner/BUILD.gn
index caab08d..eeb4e9e 100644
--- a/bin/sessionmgr/story_runner/BUILD.gn
+++ b/bin/sessionmgr/story_runner/BUILD.gn
@@ -83,8 +83,12 @@
 }
 
 executable_package("dev_story_shell") {
-  deprecated_no_cmx = "//build"
-
+  meta = [
+    {
+      path = "meta/dev_story_shell.cmx"
+      dest = "dev_story_shell.cmx"
+    },
+  ]
   sources = [
     "dev_story_shell.cc",
   ]
diff --git a/bin/sessionmgr/story_runner/meta/dev_story_shell.cmx b/bin/sessionmgr/story_runner/meta/dev_story_shell.cmx
new file mode 100644
index 0000000..cb6bfdd
--- /dev/null
+++ b/bin/sessionmgr/story_runner/meta/dev_story_shell.cmx
@@ -0,0 +1,14 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.BasemgrMonitor",
+            "fuchsia.ui.policy.Presenter",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/bin/token_manager/BUILD.gn b/bin/token_manager/BUILD.gn
index 39f8567..b632f45 100644
--- a/bin/token_manager/BUILD.gn
+++ b/bin/token_manager/BUILD.gn
@@ -5,7 +5,12 @@
 import("//peridot/build/executable_package.gni")
 
 executable_package("dev_token_manager") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/dev_token_manager.cmx"
+      dest = "dev_token_manager.cmx"
+    },
+  ]
 
   sources = [
     "dev_token_manager.cc",
diff --git a/bin/token_manager/meta/dev_token_manager.cmx b/bin/token_manager/meta/dev_token_manager.cmx
new file mode 100644
index 0000000..fe2317c
--- /dev/null
+++ b/bin/token_manager/meta/dev_token_manager.cmx
@@ -0,0 +1,19 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.BasemgrMonitor",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.sys.Environment",
+            "fuchsia.sys.Launcher",
+            "fuchsia.sys.Loader",
+            "fuchsia.tracelink.Registry",
+            "fuchsia.ui.policy.Presenter",
+            "fuchsia.ui.viewsv1.ViewManager",
+            "fuchsia.ui.viewsv1.ViewSnapshot"
+        ]
+    }
+}
diff --git a/examples/simple/BUILD.gn b/examples/simple/BUILD.gn
index b9f8209..5de45dd 100644
--- a/examples/simple/BUILD.gn
+++ b/examples/simple/BUILD.gn
@@ -6,7 +6,12 @@
 import("//peridot/build/executable_package.gni")
 
 executable_package("simple_agent") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/simple_agent.cmx"
+      dest = "simple_agent.cmx"
+    },
+  ]
 
   sources = [
     "simple_agent.cc",
@@ -23,7 +28,12 @@
 }
 
 executable_package("simple_module") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/simple_module.cmx"
+      dest = "simple_module.cmx"
+    },
+  ]
 
   sources = [
     "simple_module.cc",
diff --git a/examples/simple/meta/simple_agent.cmx b/examples/simple/meta/simple_agent.cmx
new file mode 100644
index 0000000..630d985
--- /dev/null
+++ b/examples/simple/meta/simple_agent.cmx
@@ -0,0 +1,20 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "features": [],
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.examples.simple",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.modular.ModuleContext",
+            "fuchsia.modular.auth.TokenProvider",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.net.oldhttp.HttpService",
+            "fuchsia.netconnector.NetConnector",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/examples/simple/meta/simple_module.cmx b/examples/simple/meta/simple_module.cmx
new file mode 100644
index 0000000..a5177f0
--- /dev/null
+++ b/examples/simple/meta/simple_module.cmx
@@ -0,0 +1,19 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "features": [],
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.modular.ModuleContext",
+            "fuchsia.modular.auth.TokenProvider",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.net.oldhttp.HttpService",
+            "fuchsia.netconnector.NetConnector",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/examples/swap_cpp/BUILD.gn b/examples/swap_cpp/BUILD.gn
index afc9fc6..a7b699b 100644
--- a/examples/swap_cpp/BUILD.gn
+++ b/examples/swap_cpp/BUILD.gn
@@ -5,7 +5,12 @@
 import("//peridot/build/executable_package.gni")
 
 executable_package("swap_module1") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/swap_module1.cmx"
+      dest = "swap_module1.cmx"
+    },
+  ]
 
   sources = [
     "swap_module1.cc",
@@ -18,7 +23,12 @@
 }
 
 executable_package("swap_module2") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/swap_module2.cmx"
+      dest = "swap_module2.cmx"
+    },
+  ]
 
   sources = [
     "swap_module2.cc",
@@ -48,7 +58,12 @@
 }
 
 executable_package("swap_recipe") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/swap_recipe.cmx"
+      dest = "swap_recipe.cmx"
+    },
+  ]
 
   sources = [
     "swap_recipe.cc",
diff --git a/examples/swap_cpp/meta/swap_module1.cmx b/examples/swap_cpp/meta/swap_module1.cmx
new file mode 100644
index 0000000..a5177f0
--- /dev/null
+++ b/examples/swap_cpp/meta/swap_module1.cmx
@@ -0,0 +1,19 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "features": [],
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.modular.ModuleContext",
+            "fuchsia.modular.auth.TokenProvider",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.net.oldhttp.HttpService",
+            "fuchsia.netconnector.NetConnector",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/examples/swap_cpp/meta/swap_module2.cmx b/examples/swap_cpp/meta/swap_module2.cmx
new file mode 100644
index 0000000..a5177f0
--- /dev/null
+++ b/examples/swap_cpp/meta/swap_module2.cmx
@@ -0,0 +1,19 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "features": [],
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.modular.ModuleContext",
+            "fuchsia.modular.auth.TokenProvider",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.net.oldhttp.HttpService",
+            "fuchsia.netconnector.NetConnector",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/examples/swap_cpp/meta/swap_recipe.cmx b/examples/swap_cpp/meta/swap_recipe.cmx
new file mode 100644
index 0000000..a5177f0
--- /dev/null
+++ b/examples/swap_cpp/meta/swap_recipe.cmx
@@ -0,0 +1,19 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "features": [],
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.modular.ModuleContext",
+            "fuchsia.modular.auth.TokenProvider",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.net.oldhttp.HttpService",
+            "fuchsia.netconnector.NetConnector",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
\ No newline at end of file
diff --git a/examples/todo_cpp/BUILD.gn b/examples/todo_cpp/BUILD.gn
index c996085..7449036 100644
--- a/examples/todo_cpp/BUILD.gn
+++ b/examples/todo_cpp/BUILD.gn
@@ -5,7 +5,12 @@
 import("//peridot/build/executable_package.gni")
 
 executable_package("todo_cpp") {
-  deprecated_no_cmx = "//build"
+  meta = [
+    {
+      path = "meta/todo_cpp.cmx"
+      dest = "todo_cpp.cmx"
+    },
+  ]
 
   deps = [
     "//garnet/public/lib/component/cpp",
diff --git a/examples/todo_cpp/meta/todo_cpp.cmx b/examples/todo_cpp/meta/todo_cpp.cmx
new file mode 100644
index 0000000..a5177f0
--- /dev/null
+++ b/examples/todo_cpp/meta/todo_cpp.cmx
@@ -0,0 +1,19 @@
+{
+    "program": {
+        "binary": "bin/app"
+    },
+    "sandbox": {
+        "features": [],
+        "services": [
+            "fuchsia.cobalt.LoggerFactory",
+            "fuchsia.modular.ComponentContext",
+            "fuchsia.modular.ModuleContext",
+            "fuchsia.modular.auth.TokenProvider",
+            "fuchsia.net.LegacySocketProvider",
+            "fuchsia.net.oldhttp.HttpService",
+            "fuchsia.netconnector.NetConnector",
+            "fuchsia.sys.Launcher",
+            "fuchsia.tracelink.Registry"
+        ]
+    }
+}
\ No newline at end of file