cros build-ap: Add build code and config modules.

BUG=chromium:1046012
TEST=new unittest
TEST=cros build-ap -b zork

Change-Id: I81ebe8cddfbc25f86ddbe4c065961a6127d4eda1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2023777
Tested-by: Alex Klein <saklein@chromium.org>
Reviewed-by: Will Bradley <wbbradley@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
diff --git a/lib/build_target_util.py b/lib/build_target_util.py
index 074947f..7214b8f 100644
--- a/lib/build_target_util.py
+++ b/lib/build_target_util.py
@@ -58,6 +58,22 @@
   def name(self):
     return self._name
 
+  def get_command(self, base_command):
+    """Get the build target's variant of the given base command.
+
+    We create wrappers for many scripts that handle the build target's
+    arguments. Build the target-specific variant for such a command.
+    e.g. emerge -> emerge-eve.
+
+    TODO: Add optional validation the command exists.
+
+    Args:
+      base_command (str): The wrapped command.
+
+    Returns:
+      str: The build target's command wrapper.
+    """
+    return '%s-%s' % (base_command, self.name)
 
 def GetDefaultSysrootPath(target_name):
   if target_name: