Add an sdk_dirs variable to gn

This variable defines the directories to search for SDK components. At the
moment, we just look in the source tree, but in the future, we will search a
prebuilt SDK as well.

Change-Id: Icb131f15aa70c234c886b489ee949adc0dd0feae
diff --git a/config/fuchsia/sdk.gni b/config/fuchsia/sdk.gni
new file mode 100644
index 0000000..6c947b9
--- /dev/null
+++ b/config/fuchsia/sdk.gni
@@ -0,0 +1,11 @@
+# Copyright 2017 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+declare_args() {
+  # The directories to search for parts of the SDK.
+  #
+  # By default, we search the public directories for the various layers.
+  # In the future, we'll search a pre-built SDK as well.
+  sdk_dirs = [ "//garnet/public", "//peridot/public" ]
+}
diff --git a/dart/label_to_package_name.py b/dart/label_to_package_name.py
index 386f1cc..fd26295 100755
--- a/dart/label_to_package_name.py
+++ b/dart/label_to_package_name.py
@@ -6,15 +6,16 @@
 import string
 import sys
 
-_LAYER_PREFIX = [
+# TODO(abarth): Base these paths on the sdk_dirs variable in gn.
+_SDK_DIRS = [
   "garnet/public/",
   "peridot/public/",
 ]
 
 
-# Strip the layer prefix from the given label, if necessary.
-def _remove_layer(label):
-  for prefix in _LAYER_PREFIX:
+# Strip the sdk dirs from the given label, if necessary.
+def _remove_sdk_dir(label):
+  for prefix in _SDK_DIRS:
     if label.startswith(prefix):
       return label[len(prefix):]
   return label
@@ -26,7 +27,7 @@
   if not label.startswith("//"):
       sys.stderr.write("expected label to start with //, got %s\n" % label)
       return 1
-  base = _remove_layer(label[2:])
+  base = _remove_sdk_dir(label[2:])
   separator_index = string.rfind(base, ":")
   if separator_index < 0:
       sys.stderr.write("could not find target name in label %s\n" % label)