You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by st...@apache.org on 2016/03/06 03:22:15 UTC

[2/4] incubator-mynewt-newt git commit: first cut at rewrite of newt package & project management. can understand multiple package repositories, and uses project nomenclature discussed. packages are now broken into multiple files. commands are broken

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/design.txt
----------------------------------------------------------------------
diff --git a/newt/design.txt b/newt/design.txt
deleted file mode 100644
index eb99d6a..0000000
--- a/newt/design.txt
+++ /dev/null
@@ -1,389 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-                          Design of Newt System
-
-
-
-1. Introduction 
-
-
-The newt tool allows for building and distributing embedded projects.  It's 
-goal is to make it simple for developers to create a source project and 
-manage that project, with an embedded twist.  In embedded systems, the core 
-operating system is often built and distributed along with system libraries
-and applications.  Additionally, there is a fair amount of complexity in 
-managing driver interfaces, board support packages, and both development and 
-production builds.  Right now, all of this is done for every project, and 
-everybody does it in a different way.
-
-Newt introduces the following core concepts: 
-
-Repository
-    The base directory of your embedded software.  A repository can contain 
-    multiple projects, and reflect multiple end products.  It is meant to be 
-    a logical collection of your source code.
-
-Project
-    Projects represent the individual build configurations of your embedded 
-    system.  The project files are what dictate the resulting binary that is 
-    generated.
-
-Package 
-    Packages represent libraries that are distributed.  Packages have multiple
-    types (e.g. "bsp", "library", "os") that represent their function within 
-    the newt system.
-
-
-In order to bring sanity to your embedded life (lonelieness and cat obsession
-left as an exercise for the user), Newt allows you to: 
-
-Build architecture specific binaries 
-    Newt contains the ability to manage and build for multiple different CPU
-    architectures, project definitions and board support packages. 
-
-Manage your drivers, board support and libraries 
-    Newt provides an infrastructure that helps you manage board capabilities, 
-    and drivers based upon what low-level features your libraries and projects 
-    use. 
-
-Distribute Binaries 
-    Newt provides the ability to generate signed firmware images, suitable for
-    booting with n-boot.  Flash can also take n-boot images + project images 
-    and create a full flash map.  
-
-Distribute Source 
-    Newt makes it easy to distribute and download libraries.  By providing a
-    clear interface to the lower layer drivers, and dependency checking across
-    both architecture and board support package: newt makes it easy to 
-    develop reusable software components across embedded projects. 
-
-Test 
-    Newt provides a test framework that allows you to easily define regression
-    and unit tests, and have them run automatically.  
-
-
-2. Usage 
-
-To get started with newt, first create a new repository: 
-
-    $ newt create repo <fw> 
-
-This creates a new repository in the directory specified by <fw>. 
-
-The repository has the following contents: 
-    $ newt repo create test_repo_1
-    Repo test_repo_1 successfully created!
-    $ cd test_repo_1/
-    $ tree
-    .
-    ├── compiler
-    ├── hw
-    │   └── bsp
-    ├── libs
-    ├── project
-    └── repo.yml
-
-
-The arch/ directory contains the architecture specific information for the 
-new repository.  By default, the sim architecture and compiler is installed: 
-which allows you to build new projects and software on your native OS and 
-try it out.  
-
-The newt tool also creates a directory .<fw> -- this contains the
-environment and configuration information for the current project.  More 
-information about this directory is contained in Appendix A. 
-
-Once you have a repo, you can enter that repo, and begin composing your 
-project.
-
-The first step to composing a project is to setup a build environment and 
-board support package for that product.  There are a set of board support 
-packages and architectures available at the following URL: 
-http://www.github.com/XXX. 
-
-Let's start with the board support package for the STM32-E407, which is a 
-test board for the ARM Cortex-M4, provided by Olimex 
-(https://www.olimex.com/Products/ARM/ST/STM32-E407/open-source-hardware). 
-To install the Olimex board support package, cd into the <fw> directory 
-and type: 
-
-    $ newt install bsp http://www.github.com/XXX/STM32-E407 
-    Downloading Board Support Definition from 
-        http://www.github.com/XXX/STM32-E407 ... ok
-    Board Support Definition STM32-E407 requires ARM architecture to be 
-        installed (http://www.github.com/XXX/ARM), is that OK? [Y/n] y
-    Downloading ARM architecture support    ... ok
-    Successfully installed BSP for STM32-E407! 
-    $ 
-
-The "install bsp" command goes out and installs the board support package 
-defined by the URL provided in the link.  In this case, the bsp is defined 
-on github.  Once the newt tool downloads the BSP, it notices that the BSP 
-requires the ARM architecture to be installed, and its currently not in the 
-workspace.  Newt will then download the definiton from the github URL, and 
-install the necessary architecture information.   
-
-After the dependency to the compiler has been fufilled, the bsp support 
-packages are installed into the working directory.  After the command 
-has finished, the following directory structure should exist: 
-
-    $ tree 
-    .
-    └── arch/
-        └── sim/
-            └── compiler/
-                └── compiler.yml 
-        └── arm/
-            └── compiler/
-                └── arm-gcc
-                    └── bin 
-                        └── arm-gcc 
-                        └── arm-as  
-                        └── .. <snip> .. 
-                └── compiler.yml
-            └── include/
-                └── rt_CMSIS.h
-            └── mcu/
-                └── stm32/
-                    └── arch_gpio.c 
-                    └── arch_gpio.h 
-                    └── .. <snip> .. 
-    └── bsp
-        └── stm32-e407
-            └── layout 
-                └── debug 
-                    └── stm32-e407.lds  
-                └── prod  
-                    └── stm32-e407.lds  
-            └── stm32-e407.yml 
-            └── bsp_flash_layout.h 
-            └── bsp_boot.s 
-            └── .. <snip> .. 
-    └── .<fw>
-        └── <fw>.yml 
-        └── <fw>.db 
-
-
-As you can see, a couple of new directories were created: 
-
-arch/arm
-    Definition files specific to the ARM architecture.   This is directory 
-    contains generic definition files across multiple MCU architectures. 
-
-arch/arm/mcu/stm32
-    This directory contains definition files specific to the 
-    STM32 MCU.  This includes things like SPI and UART definitions.  
-
-arch/arm/compiler
-    The compiler for the ARM architecture definition.  This includes an 
-    up-to-date, tested version of the arm-gcc compiler.  By default Newt uses
-    this compiler, however it can be overridden to use a system compiler as 
-    well. 
-
-bsp/stm32-e407 
-    This directory contains the board support files specific to the 
-    STM32-E407 development board. 
-
-bsp/stm32-e407/layout
-    This contains the memory layouts for build layouts, which can often be 
-    different for debug and production builds (e.g. run out of SRAM for debug
-    and Flash for prod.) 
-
-
-The next step is to create a project that will build on the test board.  Let's 
-say the first project is "blink_leds" a project that will load onto the 
-STM32-E407 and blink LED1. 
-
-To create the project, in the main directory enter: 
-
-    $ newt create project blink_leds
-    Creating project blink_leds in project/ ... ok 
-    Creating project scaffolding for blink_leds ... ok
-    $ 
-
-This will create the following directory structure: 
-
-    $ tree 
-    ..<snip>.. (same as previous step) 
-    └── project
-        └── blink_leds
-            └── blink_leds.yml 
-            └── blink_leds.c
-    $ 
-
-The file blink_leds.c will contain base scaffolding in order to build: 
-
-    #include <newt/core.h> 
-
-    int 
-    main(int argc, char **argv)
-    {
-        while (1) { /* your code here */ }
-        return (0);
-    }
-
-
-In order to blink LEDs, the next step is to install the LED package.   The LED
-package contains a standard API definition for controlling board LEDs, and 
-the architecture and board specific definitions for LEDs. 
-
-    $ newt install driver http://www.github.com/XXX/led-driver
-    Downloading driver ... ok
-    Checking for necessary bsp support, bsps found: sim, STM32-E407 ... ok 
-    Installing driver ... ok 
-    $ 
-
-Installing the driver will create the following directories in the root 
-directory of your project: 
-
-    $ tree 
-    ..<snip>.. (same as previous step) 
-    └── drivers
-        └── led-driver 
-            └── led-driver.yml 
-            └── src
-                └── led-driver.c 
-            └── include 
-                └── led-driver.h 
-            └── bsp 
-                └── stm32-e407  
-                    └── stm32-e407.c  
-                    └── stm32-e407.h 
-
-This driver will then be accessible in your project.  The next step is to
-enable it in your project definition, in order to do that, enter: 
-
-    $ newt project blink_leds use driver led-driver
-    Enabling led-driver in blink_leds project.
-
-Now edit project/blink_leds/blink_leds.c, and write the following code: 
-
-    #include <newt/core.h> 
-    #include <led_driver/led_driver.h> 
-
-    int 
-    main(int argc, char **argv)
-    {
-        int toggle = 0; 
-
-        while (1) {
-            if ((toggle++ % 2) == 0) {
-                led_off(LED_DRIVER_LED1);
-            } else {
-                led_on(LED_DRIVER_LED1);
-            }
-        }
-
-        return (0);
-    }
-
-Once this file is edited, you can now build your project.  In order to 
-build an image that can be loaded on the board, create a build definition: 
-
-    $ newt build_def create blink_leds_arm_build 
-    $ newt build_def edit blink_leds_arm_build set bsp=stm32-e407 
-    $ newt build_def edit blink_leds_arm_build set project=blink_leds 
-    $ newt build_def edit blink_leds_arm_build set layout=debug 
-
-This build definition is stored in the project build definition, and can now
-be referenced with the newt build command: 
-
-    $ newt build blink_leds_arm_build  
-    Building project blink_leds with bsp stm32-e407, layout debug ... ok 
-    $ 
-
-In order to see the output of the build, check the bin/ directory in the base 
-directory of your repo: 
-
-    $ cd bin; tree 
-    └── bin
-        └── blink_leds 
-            └── stm32-e407 
-                └── blink_leds.elf  
-                └── blink_leds.map 
-
-
-In order to load these files onto your board using GDB, please see the 
-Debugger Support section of this document. 
-
-3. Packages 
-
-Newt distributes libraries in the form of source packages, making it easy to 
-bundle and reuse source code across multiple repositories and projects.  
-Outside of the core architecture & board specific setup, all source code in 
-a newt project should be encapsulated within a package.
-
-A package has the following directory structure: 
-
-    $ cd pkg/os; tree 
-    └── os
-        └── os.yml 
-        └── include
-            └── arch 
-                └── sim 
-                    └── os_arch.h 
-                └── arm 
-                    └── os_arch.h 
-            └── os 
-                └── os_mutex.h
-                └── os_sem.h 
-            └── os.h 
-        └── src
-            └── arch 
-                └── sim
-                    └── os_arch_sim.c 
-                └── arm
-                    └── os_arch_arm.c 
-            └── os_mutex.c 
-            └── os_sched.c  
-        └── test 
-            └── os_mutex_test 
-                └── os_mutex_test.c 
-
-Building a Package
-
-In order to build a package, either: 
-
-    a) Include it in a project definition, in which case it will be built as a 
-    library and linked with the main application. 
-
-    b) Build it with target "test" in which case the specified regression test 
-    will be executed.  If no regression test is specified, all regression tests
-    will be run. 
-
-
-Running a Package's Unit Tests 
-
-To run a package's unit tests, cd into the package directory and run newt build
-test: 
-
-    $ cd pkg/os
-    $ newt build test 
-    Building regression tests in OS
-    Building OS ... ok 
-    Building Regression Tests ... ok 
-    Running test os_mutex_test ... ok
-    $
-
-Including a Package in a Project file 
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/newt.go
----------------------------------------------------------------------
diff --git a/newt/newt.go b/newt/newt.go
index 16b5818..e9407bf 100644
--- a/newt/newt.go
+++ b/newt/newt.go
@@ -20,1435 +20,29 @@
 package main
 
 import (
-	"bufio"
 	"fmt"
-	"log"
-	"os"
-	"path/filepath"
-	"regexp"
-	"sort"
 	"strings"
 
-	"github.com/spf13/cobra"
 	"mynewt.apache.org/newt/newt/cli"
+	"mynewt.apache.org/newt/newt/pkg"
+	"mynewt.apache.org/newt/newt/project"
+
+	"github.com/spf13/cobra"
 )
 
-var ExitOnFailure bool = false
-var ExportAll bool = false
-var ImportAll bool = false
 var NewtVersion string = "0.8.0"
 var NewtLogLevel string = ""
-var NewtRepo *cli.Repo
-var newtSilent bool
-var newtQuiet bool
-var newtVerbose bool
-var newtForce bool
-var AutoTargets string = "autotargets"
-var NewtBranchPkgList string
-var NewtBranchPkg string
-
-func NewtUsage(cmd *cobra.Command, err error) {
-	if err != nil {
-		sErr := err.(*cli.NewtError)
-		log.Printf("[DEBUG] %s", sErr.StackTrace)
-		fmt.Fprintf(os.Stderr, "Error: %s\n", sErr.Text)
-	}
-
-	if cmd != nil {
-		cmd.Help()
-	}
-	os.Exit(1)
-}
-
-// Display help text with a max line width of 79 characters
-func formatHelp(text string) string {
-	// first compress all new lines and extra spaces
-	words := regexp.MustCompile("\\s+").Split(text, -1)
-	linelen := 0
-	fmtText := ""
-	for _, word := range words {
-		word = strings.Trim(word, "\n ") + " "
-		tmplen := linelen + len(word)
-		if tmplen >= 80 {
-			fmtText += "\n"
-			linelen = 0
-		}
-		fmtText += word
-		linelen += len(word)
-	}
-	return fmtText
-}
-
-// Extracts "<key>=<value>" strings from the supplied slice and inserts them
-// into the specified target's variable map.
-func extractTargetVars(args []string, t *cli.Target) error {
-	for i := 0; i < len(args); i++ {
-		pair := strings.SplitN(args[i], "=", 2)
-		if len(pair) != 2 {
-			return cli.NewNewtError("invalid argument: " + args[i])
-		}
-
-		t.Vars[pair[0]] = pair[1]
-	}
-
-	return nil
-}
-
-func showValidSettings(varName string) error {
-	var err error = nil
-	var values []string
-
-	fmt.Printf("Valid values for target variable \"%s\":\n", varName)
-
-	values, err = cli.VarValues(varName)
-	if err != nil {
-		return err
-	}
-
-	for _, value := range values {
-		fmt.Printf("    %s\n", value)
-	}
-
-	return nil
-}
-
-func targetSetCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify two arguments (sect & k=v) to set"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	ar := strings.SplitN(args[1], "=", 2)
-
-	if len(ar) == 1 {
-		// User entered a variable name without a value.  Display valid values
-		// for the specified variable.
-		err = showValidSettings(ar[0])
-		if err != nil {
-			NewtUsage(cmd, err)
-		}
-		return
-	} else {
-		// Assign value to specified variable.
-		t.SetVar(ar[0], ar[1])
-	}
-
-	if err := t.Save(); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Target %s successfully set %s to %s\n", args[0], ar[0], ar[1])
-}
-
-func targetUnsetCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify two arguments (sect & k) to unset"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := t.DeleteVar(args[1]); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Target %s successfully unset %s\n", args[0], args[1])
-}
-
-// Type for sorting an array of target pointers alphabetically by name.
-type ByName []*cli.Target
-
-func (a ByName) Len() int           { return len(a) }
-func (a ByName) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
-func (a ByName) Less(i, j int) bool { return a[i].Name < a[j].Name }
-
-func targetShowCmd(cmd *cobra.Command, args []string) {
-	dispTarget := ""
-	if len(args) == 1 {
-		dispTarget = args[0]
-	}
-
-	targets, err := cli.GetTargets(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	sort.Sort(ByName(targets))
-
-	for _, target := range targets {
-		if dispTarget == "" || dispTarget == target.Name {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, target.Name+"\n")
-
-			vars := target.GetVars()
-			var keys []string
-			for k := range vars {
-				keys = append(keys, k)
-			}
-
-			sort.Strings(keys)
-			for _, k := range keys {
-				cli.StatusMessage(cli.VERBOSITY_QUIET, "	%s=%s\n", k, vars[k])
-			}
-		}
-	}
-}
-
-func targetCreateCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 1 {
-		NewtUsage(cmd, cli.NewNewtError("Wrong number of args to create cmd."))
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Creating target "+args[0]+"\n")
-
-	if cli.TargetExists(NewtRepo, args[0]) {
-		NewtUsage(cmd, cli.NewNewtError(
-			"Target already exists, cannot create target with same name."))
-	}
-
-	target := cli.NewTarget(NewtRepo, args[0])
-
-	err := target.Save()
-	if err != nil {
-		NewtUsage(nil, err)
-	} else {
-		cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-			"Target %s successfully created!\n", args[0])
-	}
-}
-
-func targetBuildCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target to build"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	if len(args) > 1 && args[1] == "clean" {
-		if len(args) > 2 && args[2] == "all" {
-			err = t.BuildClean(true)
-		} else {
-			err = t.BuildClean(false)
-		}
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-	} else {
-		// Parse any remaining key-value pairs and insert them into the target.
-		err = extractTargetVars(args[1:], t)
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-
-		err = t.Build()
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Successfully run!\n")
-}
-
-func targetDelCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target to delete"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if !newtForce {
-		// Determine if the target directory contains extra user files.  If it
-		// does, a prompt (or force) is required to delete it.
-		userFiles, err := t.ContainsUserFiles()
-		if err != nil {
-			NewtUsage(cmd, err)
-		}
-
-		if userFiles {
-			scanner := bufio.NewScanner(os.Stdin)
-			fmt.Printf("Target directory %s contains some extra content; "+
-				"delete anyway? (y/N): ", t.Name)
-			rc := scanner.Scan()
-			if !rc || strings.ToLower(scanner.Text()) != "y" {
-				return
-			}
-		}
-	}
-
-	// Clean target prior to deletion; ignore errors during clean.
-	t.BuildClean(false)
-
-	if err := t.Remove(); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Target %s successfully removed\n", args[0])
-}
-
-func targetTestCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target to build"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	if len(args) > 1 && args[1] == "clean" {
-		if len(args) > 2 && args[2] == "all" {
-			err = t.Test("testclean", true)
-		} else {
-			err = t.Test("testclean", false)
-		}
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-	} else {
-		// Parse any remaining key-value pairs and insert them into the target.
-		err = extractTargetVars(args[1:], t)
-		if err != nil {
-			NewtUsage(cmd, err)
-		}
-
-		err = t.Test("test", ExitOnFailure)
-		if err != nil {
-			NewtUsage(nil, err)
-		}
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Successfully run!\n")
-}
-
-func targetSizeCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target for sizing"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	txt, err := t.GetSize()
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "%s", txt)
-}
-
-func targetCreateImageCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 2 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target and version"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	err = t.Build()
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	err = t.CreateImage(args[1])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-}
-
-func targetDownloadCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target to download"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	err = t.Download()
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-}
-
-func targetDebugCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd, cli.NewNewtError("Must specify target for debug"))
-	}
-
-	t, err := cli.LoadTarget(NewtRepo, args[0])
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-
-	err = t.Debug()
-	if err != nil {
-		NewtUsage(nil, err)
-	}
-}
-
-func targetExportCmd(cmd *cobra.Command, args []string) {
-	var targetName string
-	if ExportAll {
-		targetName = ""
-	} else {
-		if len(args) < 1 {
-			NewtUsage(cmd, cli.NewNewtError("Must either specify -a flag or name of "+
-				"target to export"))
-		}
-		targetName = args[0]
-	}
-
-	err := cli.ExportTargets(NewtRepo, targetName, ExportAll, os.Stdout)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-}
-
-func targetImportCmd(cmd *cobra.Command, args []string) {
-	var targetName string
-	if ImportAll {
-		targetName = ""
-	} else {
-		if len(args) < 1 {
-			NewtUsage(cmd, cli.NewNewtError("Must either specify -a flag or name of "+
-				"target to import"))
-		}
-
-		targetName = args[0]
-	}
-
-	err := cli.ImportTargets(NewtRepo, targetName, ImportAll, os.Stdin)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Target(s) successfully imported!\n")
-}
-
-func targetAddCmds(base *cobra.Command) {
-	targetHelpText := formatHelp(`Targets tell the newt tool how to build the source
-		code within a given application.`)
-	targetHelpEx := "  newt target create <target-name>\n"
-	targetHelpEx += "  newt target set <target-name> <var-name>=<value>\n"
-	targetHelpEx += "  newt target unset <target-name> <var-name>\n"
-	targetHelpEx += "  newt target show <target-name>\n"
-	targetHelpEx += "  newt target delete <target-name>\n"
-	targetHelpEx += "  newt target build <target-name> [clean[ all]]\n"
-	targetHelpEx += "  newt target test <target-name> [clean[ all]]\n"
-	targetHelpEx += "  newt target size <target-name>\n"
-	targetHelpEx += "  newt target create-image <target-name> <version number>\n"
-	targetHelpEx += "  newt target download <target-name>\n"
-	targetHelpEx += "  newt target debug <target-name>\n"
-	targetHelpEx += "  newt target export [-a -export-all] [<target-name>]\n"
-	targetHelpEx += "  newt target import [-a -import-all] [<target-name>]"
-
-	targetCmd := &cobra.Command{
-		Use:     "target",
-		Short:   "Set and view target information",
-		Long:    targetHelpText,
-		Example: targetHelpEx,
-		PersistentPreRun: func(cmd *cobra.Command, args []string) {
-			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
-
-			var err error
-			NewtRepo, err = cli.NewRepo()
-			if err != nil {
-				NewtUsage(nil, err)
-			}
-
-			// Try to migrate targets from legacy sqlite database.  If any
-			// targets are migrated, recreate the repo from the updated targets
-			// directory.
-			if cli.LegacyMigrateTargets(NewtRepo) {
-				NewtRepo, err = cli.NewRepo()
-				if err != nil {
-					NewtUsage(nil, err)
-				}
-			}
-		},
-
-		Run: func(cmd *cobra.Command, args []string) {
-			cmd.Usage()
-		},
-	}
-
-	setHelpText := formatHelp(`Set a target variable (<var-name>) on target 
-		<target-name> to value <value>.`)
-	setHelpEx := "  newt target set <target-name> <var-name>=<value>\n"
-	setHelpEx += "  newt target set my_target1 var_name=value\n"
-	setHelpEx += "  newt target set my_target1 arch=cortex_m4\n"
-	setHelpEx += "  newt target set my_target1 var_name   (display valid values for <var_name>)"
-
-	setCmd := &cobra.Command{
-		Use:     "set",
-		Short:   "Set target configuration variable",
-		Long:    setHelpText,
-		Example: setHelpEx,
-		Run:     targetSetCmd,
-	}
-
-	targetCmd.AddCommand(setCmd)
-
-	unsetHelpText := formatHelp(`Unset a target variable (<var-name>) on target
-		<target-name>.`)
-	unsetHelpEx := "  newt target unset <target-name> <var-name>\n"
-	unsetHelpEx += "  newt target unset my_target1 var_name"
-
-	unsetCmd := &cobra.Command{
-		Use:     "unset",
-		Short:   "Unset target configuration variable",
-		Long:    unsetHelpText,
-		Example: unsetHelpEx,
-		Run:     targetUnsetCmd,
-	}
-
-	targetCmd.AddCommand(unsetCmd)
-
-	delHelpText := formatHelp(`Delete the target specified by <target-name>.`)
-	delHelpEx := "  newt target delete <target-name>\n"
-	delHelpEx += "  newt target delete my_target1"
-
-	delCmd := &cobra.Command{
-		Use:     "delete",
-		Short:   "Delete target",
-		Long:    delHelpText,
-		Example: delHelpEx,
-		Run:     targetDelCmd,
-	}
-
-	targetCmd.AddCommand(delCmd)
-
-	createHelpText := formatHelp(`Create a target specified by <target-name>.`)
-	createHelpEx := "  newt target create <target-name>\n"
-	createHelpEx += "  newt target create my_target1"
-
-	createCmd := &cobra.Command{
-		Use:     "create",
-		Short:   "Create a target",
-		Long:    createHelpText,
-		Example: createHelpEx,
-		Run:     targetCreateCmd,
-	}
-
-	targetCmd.AddCommand(createCmd)
-
-	showHelpText := formatHelp(`Show all the variables for the target specified 
-		by <target-name>.`)
-	showHelpEx := "  newt target show <target-name>\n"
-	showHelpEx += "  newt target show my_target1"
-
-	showCmd := &cobra.Command{
-		Use:     "show",
-		Short:   "View target configuration variables",
-		Long:    showHelpText,
-		Example: showHelpEx,
-		Run:     targetShowCmd,
-	}
-
-	targetCmd.AddCommand(showCmd)
-
-	buildHelpText := formatHelp(`Build the target specified by <target-name>.  
-		If clean is specified, then all the binaries and object files for this 
-		target will be removed.  If the all option is specified, all binaries 
-		and object files for all targets will be removed.`)
-	buildHelpEx := "  newt target build <target-name> [clean[ all]]\n"
-	buildHelpEx += "  newt target build my_target1\n"
-	buildHelpEx += "  newt target build my_target1 clean\n"
-	buildHelpEx += "  newt target build my_target1 clean all\n"
-
-	buildCmd := &cobra.Command{
-		Use:     "build",
-		Short:   "Build target",
-		Long:    buildHelpText,
-		Example: buildHelpEx,
-		Run:     targetBuildCmd,
-	}
-
-	targetCmd.AddCommand(buildCmd)
-
-	testHelpText := formatHelp(`Test the target specified by <target-name>.  If
-		clean is specified, then all the test binaries and object files for this 
-		target will be removed.  If the all option is specified, all test 
-		binaries and object files for all targets will be removed.`)
-	testHelpEx := "  newt target test <target-name> [clean, [all]]\n"
-	testHelpEx += "  newt target test mytarget1\n"
-	testHelpEx += "  newt target test mytarget1 clean\n"
-	testHelpEx += "  newt target test mytarget1 clean all"
-
-	testCmd := &cobra.Command{
-		Use:     "test",
-		Short:   "Test target",
-		Long:    testHelpText,
-		Example: testHelpEx,
-		Run:     targetTestCmd,
-	}
-
-	targetCmd.AddCommand(testCmd)
-
-	sizeHelpText := formatHelp(`Calculate the size of target components specified by
-		<target-name>.`)
-	sizeHelpEx := "  newt target size <target-name>\n"
-
-	sizeCmd := &cobra.Command{
-		Use:     "size",
-		Short:   "Size of the target",
-		Long:    sizeHelpText,
-		Example: sizeHelpEx,
-		Run:     targetSizeCmd,
-	}
-
-	targetCmd.AddCommand(sizeCmd)
-
-	createImageHelpText := formatHelp(`Create image by adding image header to created
-		binary file for <target-name>. Version number in the header is set to be
-		<version>.`)
-	createImageHelpEx := "  newt target create-image <target-name> <version>\n"
-	createImageHelpEx += "  newt target create-image my_target1 1.2.0\n"
-	createImageHelpEx += "  newt target create-image my_target1 1.2.0.3\n"
-
-	createImageCmd := &cobra.Command{
-		Use:     "create-image",
-		Short:   "Add image header to target binary",
-		Long:    createImageHelpText,
-		Example: createImageHelpEx,
-		Run:     targetCreateImageCmd,
-	}
-	targetCmd.AddCommand(createImageCmd)
-
-	downloadHelpText := formatHelp(`Download project image to target for
-		<target-name>.`)
-	downloadHelpEx := "  newt target download <target-name>\n"
-
-	downloadCmd := &cobra.Command{
-		Use:     "download",
-		Short:   "Download project to target",
-		Long:    downloadHelpText,
-		Example: downloadHelpEx,
-		Run:     targetDownloadCmd,
-	}
-	targetCmd.AddCommand(downloadCmd)
-
-	debugHelpText := formatHelp(`Download project image to target for
-		<target-name>.`)
-	debugHelpEx := "  newt target download <target-name>\n"
-
-	debugCmd := &cobra.Command{
-		Use:     "debug",
-		Short:   "Open debugger session to target",
-		Long:    debugHelpText,
-		Example: debugHelpEx,
-		Run:     targetDebugCmd,
-	}
-	targetCmd.AddCommand(debugCmd)
-
-	exportHelpText := formatHelp(`Export build targets from the current application, and 
-		print them to standard output.  If the -a (or -export-all) option is 
-		specified, then all targets will be exported.  Otherwise, <target-name> 
-		must be specified, and only that target will be exported.`)
-	exportHelpEx := "  newt target export [-a -export-all] [<target-name>]\n"
-	exportHelpEx += "  newt target export -a > my_exports.txt\n"
-	exportHelpEx += "  newt target export my_target > my_target_export.txt"
-
-	exportCmd := &cobra.Command{
-		Use:     "export",
-		Short:   "Export target",
-		Long:    exportHelpText,
-		Example: exportHelpEx,
-		Run:     targetExportCmd,
-	}
-
-	exportCmd.PersistentFlags().BoolVarP(&ExportAll, "export-all", "a", false,
-		"If present, export all targets")
-
-	targetCmd.AddCommand(exportCmd)
-
-	importHelpText := formatHelp(`Import build targets from standard input.  If 
-		the -a (or -import-all) option is specified, then all targets will be 
-		imported.  Otherwise, a <target-name> must be specified, and only that 
-		target will be imported.`)
-	importHelpEx := "  newt target import [-a -import-all] [<target-name>]\n"
-	importHelpEx += "  newt target import -a < exported_targets.txt\n"
-	importHelpEx += "  newt target import ex_tgt_1 < exported_targets.txt"
-
-	importCmd := &cobra.Command{
-		Use:     "import",
-		Short:   "Import target",
-		Long:    importHelpText,
-		Example: importHelpEx,
-		Run:     targetImportCmd,
-	}
-
-	importCmd.PersistentFlags().BoolVarP(&ImportAll, "import-all", "a", false,
-		"If present, import all targets")
-
-	targetCmd.AddCommand(importCmd)
-
-	base.AddCommand(targetCmd)
-}
-
-func dispPkg(pkg *cli.Pkg) error {
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "Package %s, version %s\n",
-		pkg.FullName, pkg.Version)
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "  path: %s\n",
-		filepath.Clean(pkg.BasePath))
-	if pkg.Capabilities != nil {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  capabilities: ")
-		caps, err := pkg.GetCapabilities()
-		if err != nil {
-			return err
-		}
-		for _, capability := range caps {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-	if pkg.ReqCapabilities != nil {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  required capabilities: ")
-		caps, err := pkg.GetReqCapabilities()
-		if err != nil {
-			return err
-		}
-		for _, capability := range caps {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-	if len(pkg.Deps) > 0 {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  deps: ")
-		for _, dep := range pkg.Deps {
-			if dep == nil {
-				continue
-			}
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", dep)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-
-	if pkg.LinkerScript != "" {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  linkerscript: %s\n",
-			pkg.LinkerScript)
-	}
-	return nil
-}
-
-func dispPkgDesc(pkgDesc *cli.PkgDesc) error {
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "Package %s from pkg-list %s, version %s\n",
-		pkgDesc.FullName, pkgDesc.PkgList.Name, pkgDesc.Version)
+var NewtVerbosity bool
 
-	if pkgDesc.Caps != nil {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  capabilities: ")
-		caps, err := pkgDesc.GetCapabilities()
-		if err != nil {
-			return err
-		}
-		for _, capability := range caps {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-	if pkgDesc.ReqCaps != nil {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  required capabilities: ")
-		caps, err := pkgDesc.GetReqCapabilities()
-		if err != nil {
-			return err
-		}
-		for _, capability := range caps {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", capability)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-	if len(pkgDesc.Deps) > 0 {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "  deps: ")
-		for _, dep := range pkgDesc.Deps {
-			if dep == nil {
-				continue
-			}
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "%s ", dep)
-		}
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-
-	return nil
-}
-
-func pkgListCmd(cmd *cobra.Command, args []string) {
-	pkgMgr, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	if err := pkgMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-	for _, pkg := range pkgMgr.Pkgs {
-		if err := dispPkg(pkg); err != nil {
-			NewtUsage(cmd, err)
-		}
-	}
-}
-
-func pkgCheckDepsCmd(cmd *cobra.Command, args []string) {
-	pkgMgr, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := pkgMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := pkgMgr.CheckDeps(); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Dependencies successfully resolved!\n")
-}
-
-func pkgSearchCmd(cmd *cobra.Command, args []string) {
-	var err error
-
-	if len(args) != 1 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify string to search for"))
-	}
-
-	/*
-	 * First check local.
-	 */
-	pkgMgr, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	if err := pkgMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	found := false
-	for _, pkg := range pkgMgr.Pkgs {
-		contains := strings.Contains(pkg.FullName, args[0])
-		if contains == true {
-			cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installed package %s@%s\n",
-				pkg.FullName, pkg.Version)
-			found = true
-		}
-	}
-
-	/*
-	 * Then check remote pkgLists.
-	 */
-	pkgLists, err := NewtRepo.GetPkgLists()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	for _, pkgList := range pkgLists {
-		for _, pkgDesc := range pkgList.PkgDescs {
-			contains := strings.Contains(pkgDesc.FullName, args[0])
-			if contains == true {
-				cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-					"Package list %s has package %s@%s\n",
-					pkgList.Name, pkgDesc.FullName,
-					pkgDesc.Version)
-				found = true
-			}
-		}
-	}
-
-	if found == false {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "No package found!\n")
-	}
-}
-
-func pkgShowCmd(cmd *cobra.Command, args []string) {
-	var pkgName string
-	var pkgListName string = ""
-
-	if len(args) < 1 || len(args) > 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify full name of the package"))
-	}
-
-	if len(args) == 1 {
-		pkgName = args[0]
-	} else {
-		pkgListName = args[0]
-		pkgName = args[1]
-	}
-
-	pkgMgr, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	if err := pkgMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	pkg, err := pkgMgr.ResolvePkgName(pkgName)
-	if err == nil {
-		pkg.LoadConfig(nil, false)
-		dispPkg(pkg)
-	}
-
-	pkgLists, err := NewtRepo.GetPkgLists()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	for _, pkgList := range pkgLists {
-		if pkgListName == "" || pkgList.Name == pkgListName {
-			pkgDesc, err := pkgList.ResolvePkgDescName(pkgName)
-			if err == nil {
-				dispPkgDesc(pkgDesc)
-			}
-		}
-	}
-}
-
-func pkgDescInstall(pkgDesc *cli.PkgDesc) error {
-	pkgMgr, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		return err
-	}
-
-	if err := pkgMgr.LoadConfigs(nil, false); err != nil {
-		return err
-	}
-
-	_, err = pkgMgr.ResolvePkgName(pkgDesc.FullName)
-	if err == nil {
-		return cli.NewNewtError(fmt.Sprintf("Package %s already installed!",
-			pkgDesc.FullName))
-	}
-	err = pkgDesc.Install(pkgMgr, NewtBranchPkg)
-	if err != nil {
-		return err
-	}
-	return nil
-}
-
-func pkgInstallCmd(cmd *cobra.Command, args []string) {
-	var pkgName string
-	var pkgListName string = ""
-	var pkgList *cli.PkgList
-	var pkgDesc *cli.PkgDesc
-
-	if len(args) < 1 || len(args) > 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify full name of the package"))
-	}
-
-	if len(args) == 1 {
-		pkgName = args[0]
-	} else {
-		pkgListName = args[0]
-		pkgName = args[1]
-	}
-
-	/*
-	 * Find the pkgDesc to install.
-	 */
-	pkgLists, err := NewtRepo.GetPkgLists()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if pkgListName != "" {
-		pkgList = pkgLists[pkgListName]
-	}
-	if pkgList != nil {
-		pkgDesc, err := pkgList.ResolvePkgDescName(pkgName)
-		if err != nil {
-			NewtUsage(cmd, err)
-		}
-		err = pkgDescInstall(pkgDesc)
-		if err != nil {
-			NewtUsage(cmd, err)
-		}
-		cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installation was a success!\n")
-		return
-	}
-	pkgDesc = nil
-	for _, tmpPkgList := range pkgLists {
-		if pkgListName == "" || tmpPkgList.Name == pkgListName {
-			tmpPkgDesc, err := tmpPkgList.ResolvePkgDescName(pkgName)
-			if err == nil {
-				if pkgDesc != nil {
-					NewtUsage(cmd,
-						cli.NewNewtError(fmt.Sprintf("Ambiguous "+
-							"source pkg %s in package-list %s and "+
-							"%s %s",
-							pkgName, pkgList.Name, tmpPkgList.Name,
-							tmpPkgDesc.FullName)))
-				} else {
-					pkgDesc = tmpPkgDesc
-					pkgList = tmpPkgList
-				}
-			}
-		}
-	}
-
-	if pkgDesc == nil {
-		NewtUsage(cmd,
-			cli.NewNewtError(fmt.Sprintf("Can't find package with name %s",
-				pkgName)))
-	}
-
-	err = pkgDescInstall(pkgDesc)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Installation was a success!\n")
-}
-
-func pkgRemoveCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 || len(args) > 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify full name of the package"))
-	}
-
-	pkgName := args[0]
-
-	pkgMgr, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	if err := pkgMgr.LoadConfigs(nil, false); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	pkg, err := pkgMgr.ResolvePkgName(pkgName)
-	if err != nil {
-		NewtUsage(cmd,
-			cli.NewNewtError(fmt.Sprintf("Package %s has not been installed",
-				pkgName)))
-	}
-	err = pkg.Remove()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "Removed successfully!\n")
-}
-
-func pkgAddCmds(baseCmd *cobra.Command) {
-	pkgHelpText := formatHelp(`Commands to search, display and install packages
-		in the current application.`)
-	pkgHelpEx := "  newt pkg list\n"
-	pkgHelpEx += "  newt pkg checkdeps\n"
-	pkgHelpEx += "  newt pkg search <pkg-name>\n"
-	pkgHelpEx += "  newt pkg show [<pkg-list> ] <pkg-name>\n"
-	pkgHelpEx += "  newt pkg install [<pkg-list> ] <pkg-name>\n"
-	pkgHelpEx += "  newt pkg remove [<pkg-list> ] <pkg-name>"
-
-	pkgCmd := &cobra.Command{
-		Use:     "pkg",
-		Short:   "Commands to list and inspect packages on a application",
-		Long:    pkgHelpText,
-		Example: pkgHelpEx,
-		PersistentPreRun: func(cmd *cobra.Command, args []string) {
-			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
-
-			var err error
-			NewtRepo, err = cli.NewRepo()
-			if err != nil {
-				NewtUsage(nil, err)
-			}
-		},
-		Run: func(cmd *cobra.Command, args []string) {
-			NewtUsage(cmd, nil)
-		},
-	}
-
-	listHelpText := formatHelp(`List all of the packages in the current application.`)
-	listHelpEx := "  newt pkg list"
-
-	listCmd := &cobra.Command{
-		Use:     "list",
-		Short:   "List packages in the current application",
-		Long:    listHelpText,
-		Example: listHelpEx,
-		Run:     pkgListCmd,
-	}
-
-	pkgCmd.AddCommand(listCmd)
-
-	checkDepsHelpText := formatHelp(`Resolve all dependencies in the local 
-		application.  This command goes through all packages currently 
-		installed, checks their dependencies, and prints any unresolved 
-		dependencies between packages.`)
-	checkDepsHelpEx := "  newt pkg checkdeps"
-
-	checkDepsCmd := &cobra.Command{
-		Use:     "checkdeps",
-		Short:   "Check package dependencies",
-		Long:    checkDepsHelpText,
-		Example: checkDepsHelpEx,
-		Run:     pkgCheckDepsCmd,
-	}
-
-	pkgCmd.AddCommand(checkDepsCmd)
-
-	searchHelpText := formatHelp(`Search for an package, specified by <pkg-name>.  
-		The local application, along with all remote applications are 
-		searched.  All matched packages are shown.`)
-	searchHelpEx := "  newt pkg search <pkg-name>"
-
-	searchCmd := &cobra.Command{
-		Use:     "search",
-		Short:   "Search for package",
-		Long:    searchHelpText,
-		Example: searchHelpEx,
-		Run:     pkgSearchCmd,
-	}
-
-	pkgCmd.AddCommand(searchCmd)
-
-	showHelpText := formatHelp(`Show the contents of the package, specified by 
-		<pkg-name>.  <pkg-name> is resolved using all the pkg-lists installed
-		in the current application or, if <pkg-list-name> is specified, only 
-		<pkg-list-name> will be searched.`)
-	showHelpEx := "  newt pkg show [<pkg-list-name> ] <pkg-name>"
-
-	showCmd := &cobra.Command{
-		Use:     "show",
-		Short:   "Show the contents of a package.",
-		Long:    showHelpText,
-		Example: showHelpEx,
-		Run:     pkgShowCmd,
-	}
-
-	pkgCmd.AddCommand(showCmd)
-
-	installHelpText := formatHelp(`Install the package specified by <pkg-name> to 
-		the local application. <pkg-name> is searched for throughout the pkg-lists in 
-		the local application.  If <pkg-list-name> is specified, then only <pkg-list-name>
-		is searched for <pkg-name>.`)
-	installHelpEx := "  newt pkg install [<pkgList-name> ] <pkg-name>"
-
-	installCmd := &cobra.Command{
-		Use:     "install",
-		Short:   "Install a package",
-		Long:    installHelpText,
-		Example: installHelpEx,
-		Run:     pkgInstallCmd,
-	}
-
-	installCmd.Flags().StringVarP(&NewtBranchPkg, "branch", "b", "",
-		"Branch (or tag) of the pkg-list to install from.")
-
-	pkgCmd.AddCommand(installCmd)
-
-	removeHelpText := formatHelp(`Remove the package, specified by <pkg-name> from 
-		the local application.  If present the package is resolved from the package
-		list specified by <pkg-list-name>.`)
-	removeHelpEx := "  newt pkg remove [<pkg-list-name> ] <pkg-name>"
-
-	removeCmd := &cobra.Command{
-		Use:     "remove",
-		Short:   "Remove a package",
-		Long:    removeHelpText,
-		Example: removeHelpEx,
-		Run:     pkgRemoveCmd,
-	}
-
-	pkgCmd.AddCommand(removeCmd)
-
-	baseCmd.AddCommand(pkgCmd)
-}
-
-func repoGeneratePkgListCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify name and URL to generate a pkg-list file"))
-	}
-
-	pkgListName := args[0]
-	pkgListUrl := args[1]
-
-	pkgList, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-	pkgList.Name = pkgListName
-	pkgList.RemoteUrl = pkgListUrl
-
-	local, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := pkgList.LoadFromPkgList(local); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	pkgListStr, err := pkgList.Serialize()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT, "%s", pkgListStr)
-}
-
-func repoAddPkgListCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 2 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify both name and URL to "+
-				"app add-pkg-list command"))
-	}
-
-	name := args[0]
-	url := args[1]
-
-	pkgList, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := pkgList.Install(name, url, NewtBranchPkgList); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Package list "+name+" successfully installed to application.\n")
-}
-
-func repoListPkgListsCmd(cmd *cobra.Command, args []string) {
-	pkgLists, err := NewtRepo.GetPkgLists()
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	for name, pkgList := range pkgLists {
-		cli.StatusMessage(cli.VERBOSITY_QUIET,
-			"Remote package list %s (num_pkgs: %d)\n", name, len(pkgList.PkgDescs))
-	}
-}
-
-func repoCreateCmd(cmd *cobra.Command, args []string) {
-	if len(args) < 1 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify an application name to create"))
-	}
-
-	wd, err := os.Getwd()
-	if err != nil {
-		NewtUsage(cmd, cli.NewNewtError(err.Error()))
-	}
-
-	repoDir := wd + "/" + args[0]
-	if len(args) > 1 {
-		repoDir = args[1]
-	}
-
-	tadpoleUrl := ""
-	if len(args) > 2 {
-		tadpoleUrl = args[2]
-	}
-
-	if err := cli.CreateRepo(args[0], repoDir, tadpoleUrl); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	cli.StatusMessage(cli.VERBOSITY_DEFAULT,
-		"Application %s successfully created in %s\n", args[0], repoDir)
-}
-
-func repoShowPkgListCmd(cmd *cobra.Command, args []string) {
-	if len(args) != 1 {
-		NewtUsage(cmd,
-			cli.NewNewtError("Must specify a pkg-list name to show-pkg-list command"))
-	}
-
-	pkgList, err := cli.NewPkgList(NewtRepo)
-	if err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	if err := pkgList.Load(args[0]); err != nil {
-		NewtUsage(cmd, err)
-	}
-
-	// PkgList loaded, now print out pkgList information
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "Package List Name: %s\n", pkgList.Name)
-	cli.StatusMessage(cli.VERBOSITY_QUIET, "Package List URL: %s\n",
-		pkgList.RemoteUrl)
-
-	i := 0
-	for _, pkgDesc := range pkgList.PkgDescs {
-		i++
-		cli.StatusMessage(cli.VERBOSITY_QUIET, " %s@%s", pkgDesc.FullName,
-			pkgDesc.Version)
-		if i%4 == 0 {
-			cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-		}
-	}
-	if i%4 != 0 {
-		cli.StatusMessage(cli.VERBOSITY_QUIET, "\n")
-	}
-}
-
-func repoAddCmds(baseCmd *cobra.Command) {
-	var repoCmd *cobra.Command
-	var createCmd *cobra.Command
-
-	repoHelpText := formatHelp(`The project commands help manage the local project.
-		A project represents the workspace for one or more applications, each application being a
-                collection of packages.  In addition to containing packages, a project contains the 
-		target (build) definitions, and a list of pkg-lists (snapshots of remote projects, 
-		which contain packages that can be installed into the current project.)`)
-	repoHelpEx := "  newt project list-pkg-lists\n"
-	repoHelpEx += "  newt project show-pkg-list <pkg-list-name>\n"
-	repoHelpEx += "  newt project add-pkg-list <pkg-list-name> <pkg-list-url>\n"
-	repoHelpEx += "  newt project generate-pkg-list <pkg-list-name> <pkg-list-url>"
-
-	repoCmd = &cobra.Command{
-		Use:     "project",
-		Short:   "Commands to manage project",
-		Long:    repoHelpText,
-		Example: repoHelpEx,
-		PersistentPreRun: func(cmd *cobra.Command, args []string) {
-			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
-
-			var err error
-
-			if cmd != repoCmd {
-				NewtRepo, err = cli.NewRepo()
-				if err != nil {
-					NewtUsage(cmd, err)
-				}
-			}
-		},
-		Run: func(cmd *cobra.Command, args []string) {
-			NewtUsage(cmd, nil)
-		},
-	}
-
-	createHelpText := formatHelp(`Create a new project, specified by <project-name>. 
-		If the optional <project-url> parameter is specified, then download the 
-		skeleton of the project from that URL, instead of using the default.`)
-
-	createHelpEx := "  newt new <project-name> [, <project-url>]\n"
-	createHelpEx += "  newt new myproject"
-
-	createCmd = &cobra.Command{
-		Use:     "new",
-		Short:   "Create a new project",
-		Long:    createHelpText,
-		Example: createHelpEx,
-		PersistentPreRun: func(cmd *cobra.Command, args []string) {
-			cli.Init(NewtLogLevel, newtSilent, newtQuiet, newtVerbose)
-		},
-		Run: repoCreateCmd,
-	}
-
-	baseCmd.AddCommand(createCmd)
-
-	generateHelpText := formatHelp(`Generate a pkg-list file from a snapshot 
-	    of the packeges in the current directory.  generate-pkg-list takes two 
-		arguments, the name of the current application and the URL at which 
-		the project is located.`)
-
-	generateHelpEx := "  newt project generate-pkg-list <name> <url>\n"
-	generateHelpEx += "  newt project generate-pkg-list larva " +
-		"https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva"
-
-	generateCmd := &cobra.Command{
-		Use:     "generate-pkg-list",
-		Short:   "Generate a pkg-list file from the packages in the current directory",
-		Long:    generateHelpText,
-		Example: generateHelpEx,
-		Run:     repoGeneratePkgListCmd,
-	}
-
-	repoCmd.AddCommand(generateCmd)
-
-	addPkgListHelpText := formatHelp(`Add a remote pkg-list to the current project.
-	    When search for pkgs to install, the pkg-list specified by pkg-list-name
-		and pkg-list-url will be searched for packages that match the search.  This
-		includes both direct searches with newt package search, as well as resolving
-		dependencies in pkg.yml files.`)
-
-	addPkgListHelpEx := "  newt project add-pkg-list <pkg-list-name> <pkg-list-url>\n"
-	addPkgListHelpEx += "  newt project add-pkg-list larva " +
-		"https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva"
-
-	addPkgListCmd := &cobra.Command{
-		Use:     "add-pkg-list",
-		Short:   "Add a remote pkg-list, and put it in the current project",
-		Long:    addPkgListHelpText,
-		Example: addPkgListHelpEx,
-		Run:     repoAddPkgListCmd,
-	}
-
-	addPkgListCmd.Flags().StringVarP(&NewtBranchPkgList, "branch", "b", "master",
-		"Branch (or tag) of the pkg-list to install from.")
-
-	repoCmd.AddCommand(addPkgListCmd)
-
-	listPkgListsHelpText := formatHelp(`List the pkg-lists installed in the current
-		project.  A pkg-list represents a collection of packages in an application.  List pkg-lists
-		includes the current project, along with any remote pkg-lists that have been 
-		added using the add-pkg-list command.`)
-
-	listPkgListsHelpEx := "  newt project list-pkg-lists"
-
-	listPkgListsCmd := &cobra.Command{
-		Use:     "list-pkg-lists",
-		Short:   "List the pkg-lists installed in the current project",
-		Long:    listPkgListsHelpText,
-		Example: listPkgListsHelpEx,
-		Run:     repoListPkgListsCmd,
-	}
-
-	repoCmd.AddCommand(listPkgListsCmd)
-
-	showPkgListHelpText := formatHelp(`Show information about a pkg-list, given by the 
-		<pkg-list-name> parameter.  Displays the pkg-list name, URL and packages 
-		associated with a given pkg-list.`)
-
-	showPkgListHelpEx := "  newt project show-pkg-list <pkg-list-name>\n"
-	showPkgListHelpEx += "  newt project show-pkg-list larva"
-
-	showPkgListCmd := &cobra.Command{
-		Use:     "show-pkg-list",
-		Short:   "Show an individual pkg-list in the current application",
-		Long:    showPkgListHelpText,
-		Example: showPkgListHelpEx,
-		Run:     repoShowPkgListCmd,
-	}
-
-	repoCmd.AddCommand(showPkgListCmd)
-
-	baseCmd.AddCommand(repoCmd)
-}
-
-func parseCmds() *cobra.Command {
-	newtHelpText := formatHelp(`Newt allows you to create your own embedded 
+func newtCmd() *cobra.Command {
+	newtHelpText := cli.FormatHelp(`Newt allows you to create your own embedded 
 		application based on the Mynewt operating system.  Newt provides both 
 		build and package management in a single tool, which allows you to 
 		compose an embedded application, and set of projects, and then build
 		the necessary artifacts from those projects.  For more information 
 		on the Mynewt operating system, please visit 
 		https://mynewt.apache.org/.`)
-	newtHelpText += "\n\n" + formatHelp(`Please use the newt help command, 
+	newtHelpText += "\n\n" + cli.FormatHelp(`Please use the newt help command, 
 		and specify the name of the command you want help for, for help on 
 		how to use a specific command`)
 	newtHelpEx := "  newt\n"
@@ -1466,18 +60,12 @@ func parseCmds() *cobra.Command {
 		},
 	}
 
-	newtCmd.PersistentFlags().BoolVarP(&newtVerbose, "verbose", "v", false,
-		"Enable verbose output when executing commands.")
-	newtCmd.PersistentFlags().BoolVarP(&newtQuiet, "quiet", "q", false,
-		"Be quiet; only display error output.")
-	newtCmd.PersistentFlags().BoolVarP(&newtSilent, "silent", "s", false,
-		"Be silent; don't output anything.")
 	newtCmd.PersistentFlags().StringVarP(&NewtLogLevel, "loglevel", "l",
 		"WARN", "Log level, defaults to WARN.")
-	newtCmd.PersistentFlags().BoolVarP(&newtForce, "force", "f", false,
-		"Perform operations without prompting for confirmation.")
 
-	versHelpText := formatHelp(`Display the Newt version number.`)
+	NewtLogLevel = strings.ToUpper(NewtLogLevel)
+
+	versHelpText := cli.FormatHelp(`Display the Newt version number.`)
 	versHelpEx := "  newt version"
 	versCmd := &cobra.Command{
 		Use:     "version",
@@ -1491,14 +79,13 @@ func parseCmds() *cobra.Command {
 
 	newtCmd.AddCommand(versCmd)
 
-	targetAddCmds(newtCmd)
-	pkgAddCmds(newtCmd)
-	repoAddCmds(newtCmd)
-
 	return newtCmd
 }
 
 func main() {
-	cmd := parseCmds()
+	cmd := newtCmd()
+	project.AddCommands(cmd)
+	pkg.AddCommands(cmd)
+
 	cmd.Execute()
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/pkg/cmds.go
----------------------------------------------------------------------
diff --git a/newt/pkg/cmds.go b/newt/pkg/cmds.go
new file mode 100644
index 0000000..9eaf27e
--- /dev/null
+++ b/newt/pkg/cmds.go
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package pkg
+
+import "github.com/spf13/cobra"
+
+func pkgRunCmd(cmd *cobra.Command, args []string) {
+}
+
+func AddCommands(cmd *cobra.Command) {
+	pkgHelpText := ""
+	pkgHelpEx := ""
+	pkgCmd := &cobra.Command{
+		Use:     "package",
+		Short:   "Commands for manipulating packages",
+		Long:    pkgHelpText,
+		Example: pkgHelpEx,
+		Run:     pkgRunCmd,
+	}
+
+	cmd.AddCommand(pkgCmd)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/pkg/dependency.go
----------------------------------------------------------------------
diff --git a/newt/pkg/dependency.go b/newt/pkg/dependency.go
new file mode 100644
index 0000000..c3839db
--- /dev/null
+++ b/newt/pkg/dependency.go
@@ -0,0 +1,134 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package pkg
+
+import (
+	"fmt"
+	"strings"
+
+	"mynewt.apache.org/newt/newt/repo"
+	"mynewt.apache.org/newt/util"
+)
+
+type Dependency struct {
+	Name      string
+	Repo      string
+	Stability string
+	VersReqs  []*VersionMatch
+}
+
+func (dep *Dependency) SetVersionReqs(versStr string) error {
+	var err error
+
+	dep.VersReqs, err = LoadVersionMatches(versStr)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (dep *Dependency) GetVersionReqsString() string {
+	if dep.VersReqs == nil {
+		return "none"
+	}
+
+	str := ""
+	for _, vreq := range dep.VersReqs {
+		str += fmt.Sprintf("%s%s", vreq.CompareType, vreq.Vers)
+	}
+
+	return str
+}
+
+func (dep *Dependency) String() string {
+	str := fmt.Sprintf("$%s/%s@%s#%s", dep.Repo, dep.Name,
+		dep.GetVersionReqsString(), dep.Stability)
+	return str
+}
+
+func (dep *Dependency) setRepoAndName(str string) error {
+	// First part is always repo/dependency name combination.
+	// If repo is present, string will always begin with a $ sign
+	// representing the repo name, followed by 'n' slashes.
+	if strings.HasPrefix(str, "$") {
+		nameParts := strings.SplitN(str[1:], "/", 2)
+		if len(nameParts) == 1 {
+			return util.NewNewtError(fmt.Sprintf(
+				"Must specify both repo and package name, no package detected: %s",
+				str))
+		}
+		dep.Repo = nameParts[0]
+		dep.Name = nameParts[1]
+	} else {
+		dep.Repo = repo.REPO_NAME_LOCAL
+	}
+
+	return nil
+}
+
+func (dep *Dependency) Init(depStr string) error {
+	// Split string into multiple parts
+	// @ separates repo/name from version requirements
+	// # separates repo/name or version requirements from stability level
+	parts := strings.Split(depStr, "@")
+	if len(parts) == 1 {
+		// There is no @ sign, which means version requirements don't
+		// exist.  Now check for stability level
+		parts = strings.Split(depStr, "#")
+
+		if err := dep.setRepoAndName(parts[0]); err != nil {
+			return err
+		}
+
+		if len(parts) > 1 {
+			dep.Stability = parts[1]
+		} else {
+			dep.Stability = PACKAGE_STABILITY_STABLE
+		}
+	} else if len(parts) == 2 {
+		if err := dep.setRepoAndName(parts[0]); err != nil {
+			return err
+		}
+		verParts := strings.Split(parts[1], "#")
+
+		if err := dep.SetVersionReqs(verParts[0]); err != nil {
+			return err
+		}
+		if len(verParts) == 2 {
+			dep.Stability = verParts[1]
+		} else {
+			dep.Stability = PACKAGE_STABILITY_STABLE
+		}
+	}
+
+	return nil
+}
+
+func NewDependency(depStr string) (*Dependency, error) {
+	// Allocate depedency
+	dep := &Dependency{}
+
+	if err := dep.Init(depStr); err != nil {
+		return nil, err
+	}
+
+	return dep, nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/pkg/identity.go
----------------------------------------------------------------------
diff --git a/newt/pkg/identity.go b/newt/pkg/identity.go
new file mode 100644
index 0000000..ffe3d20
--- /dev/null
+++ b/newt/pkg/identity.go
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package pkg
+
+type IdentityList struct {
+	identities map[string]bool
+}
+
+func (il *IdentityList) Put(name string) {
+	il.identities[name] = true
+}
+
+func (il *IdentityList) Exists(name string) bool {
+	_, ok := il.identities[name]
+	return ok
+}
+
+func (il *IdentityList) GetSlice() []string {
+	identitySlice := make([]string, len(il.identities))
+
+	i := 0
+	for identity := range il.identities {
+		identitySlice[i] = identity
+	}
+
+	return identitySlice
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/pkg/localpackage.go
----------------------------------------------------------------------
diff --git a/newt/pkg/localpackage.go b/newt/pkg/localpackage.go
new file mode 100644
index 0000000..009481a
--- /dev/null
+++ b/newt/pkg/localpackage.go
@@ -0,0 +1,268 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package pkg
+
+import (
+	"crypto/sha1"
+	"fmt"
+	"io/ioutil"
+	"log"
+	"os"
+	"path/filepath"
+	"strings"
+
+	"mynewt.apache.org/newt/viper"
+
+	"mynewt.apache.org/newt/newt/cli"
+	"mynewt.apache.org/newt/newt/repo"
+	"mynewt.apache.org/newt/util"
+)
+
+var PackageHashIgnoreDirs = map[string]bool{
+	"obj": true,
+	"bin": true,
+	".":   true,
+}
+
+var LocalPackageSpecialNames = map[string]bool{
+	"src":     true,
+	"include": true,
+	"bin":     true,
+}
+
+type LocalPackage struct {
+	repo     *repo.Repo
+	name     string
+	basePath string
+	isBsp    bool
+
+	// General information about the package
+	desc *PackageDesc
+	// Version information about this package
+	vers *Version
+	// Dependencies for this package
+	deps []*Dependency
+	// APIs that this package exports
+	apis []*Dependency
+	// APIs that this package requires
+	reqApis []*Dependency
+
+	// Pointer to pkg.yml configuration structure
+	v *viper.Viper
+}
+
+func (pkg *LocalPackage) IsBsp() bool {
+	return pkg.isBsp
+}
+
+func (pkg *LocalPackage) Name() string {
+	return pkg.name
+}
+
+func (pkg *LocalPackage) Repo() *repo.Repo {
+	return pkg.repo
+}
+
+func (pkg *LocalPackage) Hash() (string, error) {
+	hash := sha1.New()
+
+	err := filepath.Walk(pkg.basePath,
+		func(path string, info os.FileInfo, err error) error {
+			name := info.Name()
+			if PackageHashIgnoreDirs[name] {
+				return filepath.SkipDir
+			}
+
+			if info.IsDir() {
+				// SHA the directory name into the hash
+				hash.Write([]byte(name))
+			} else {
+				// SHA the file name & contents into the hash
+				contents, err := ioutil.ReadFile(path)
+				if err != nil {
+					return err
+				}
+				hash.Write(contents)
+			}
+			return nil
+		})
+	if err != nil && err != filepath.SkipDir {
+		return "", util.NewNewtError(err.Error())
+	}
+
+	hashStr := fmt.Sprintf("%x", hash.Sum(nil))
+
+	return hashStr, nil
+}
+
+func (pkg *LocalPackage) Desc() *PackageDesc {
+	return pkg.desc
+}
+
+func (pkg *LocalPackage) Vers() *Version {
+	return pkg.vers
+}
+
+func (pkg *LocalPackage) Deps() []*Dependency {
+	return pkg.deps
+}
+
+func (pkg *LocalPackage) Apis() []*Dependency {
+	return pkg.apis
+}
+
+func (pkg *LocalPackage) ReqApis() []*Dependency {
+	return pkg.reqApis
+}
+
+func (pkg *LocalPackage) readDesc(v *viper.Viper) (*PackageDesc, error) {
+	pdesc := &PackageDesc{}
+
+	pdesc.Author = v.GetString("pkg.author")
+	pdesc.Homepage = v.GetString("pkg.homepage")
+	pdesc.Description = v.GetString("pkg.description")
+	pdesc.Keywords = v.GetStringSlice("pkg.keywords")
+
+	return pdesc, nil
+}
+
+// Init reads everything that isn't identity specific into the
+// package
+func (pkg *LocalPackage) Init(pkgDir string) error {
+	var err error
+
+	pkg.basePath = filepath.Clean(pkgDir) + "/"
+
+	// Load configuration
+	log.Printf("[DEBUG] Loading configuration for package %s", pkg.basePath)
+
+	v, err := util.ReadConfig(pkg.basePath,
+		strings.TrimSuffix(PACKAGE_FILE_NAME, ".yml"))
+	if err != nil {
+		return err
+	}
+	pkg.v = v
+
+	// Set package name from the package
+	pkg.name = v.GetString("pkg.name")
+
+	// Get the package version
+	pkg.vers, err = LoadVersion(v.GetString("pkg.vers"))
+	if err != nil {
+		return err
+	}
+
+	// Read the package description from the file
+	pkg.desc, err = pkg.readDesc(v)
+	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func LoadLocalPackage(pkgDir string) (*LocalPackage, error) {
+	pkg := &LocalPackage{}
+
+	if err := pkg.Init(pkgDir); err != nil {
+		return nil, err
+	}
+
+	return pkg, nil
+}
+
+func LocalPackageSpecialName(dirName string) bool {
+	_, ok := LocalPackageSpecialNames[dirName]
+	return ok
+}
+
+func ReadLocalPackageRecursive(pkgList *map[string]*LocalPackage,
+	basePath string, pkgName string) error {
+
+	dirList, err := ioutil.ReadDir(basePath + "/" + pkgName)
+	if err != nil {
+		return util.NewNewtError(err.Error())
+	}
+
+	for _, dirEnt := range dirList {
+		if !dirEnt.IsDir() {
+			continue
+		}
+
+		name := dirEnt.Name()
+		if LocalPackageSpecialName(name) || strings.HasPrefix(name, ".") {
+			continue
+		}
+
+		if err := ReadLocalPackageRecursive(pkgList, basePath,
+			pkgName+"/"+name); err != nil {
+			return err
+		}
+	}
+
+	if cli.NodeNotExist(basePath + "/" + pkgName + "/" + PACKAGE_FILE_NAME) {
+		return nil
+	}
+
+	pkg, err := LoadLocalPackage(basePath + "/" + pkgName)
+	if err != nil {
+		return err
+	}
+	(*pkgList)[pkg.Name()] = pkg
+
+	return nil
+}
+
+func ReadLocalPackages(basePath string,
+	searchPaths []string) (*map[string]*LocalPackage, error) {
+
+	pkgList := &map[string]*LocalPackage{}
+
+	for _, path := range searchPaths {
+		pkgDir := basePath + "/" + path
+
+		if cli.NodeNotExist(pkgDir) {
+			continue
+		}
+
+		dirList, err := ioutil.ReadDir(pkgDir)
+		if err != nil {
+			return nil, util.NewNewtError(err.Error())
+		}
+
+		for _, subDir := range dirList {
+			name := subDir.Name()
+			if filepath.HasPrefix(name, ".") || filepath.HasPrefix(name, "..") {
+				continue
+			}
+
+			if !subDir.IsDir() {
+				continue
+			}
+
+			if err := ReadLocalPackageRecursive(pkgList, pkgDir,
+				name); err != nil {
+				return nil, util.NewNewtError(err.Error())
+			}
+		}
+	}
+
+	return pkgList, nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/pkg/package.go
----------------------------------------------------------------------
diff --git a/newt/pkg/package.go b/newt/pkg/package.go
new file mode 100644
index 0000000..d58ec16
--- /dev/null
+++ b/newt/pkg/package.go
@@ -0,0 +1,78 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package pkg
+
+import "mynewt.apache.org/newt/newt/repo"
+
+const PACKAGE_FILE_NAME = "pkg.yml"
+
+const (
+	PACKAGE_STABILITY_STABLE = "stable"
+	PACKAGE_STABILITY_LATEST = "latest"
+	PACKAGE_STABILITY_DEV    = "dev"
+)
+
+// An interface, representing information about a Package
+// This interface is implemented by both packages in the
+// local directory, but also packages that are stored in
+// remote repositories.  It is abstracted so that routines
+// that do package search & installation can work across
+// both local & remote packages without needing to special
+// case.
+type Package interface {
+	// Initialize the package, in the directory specified
+	// by pkgDir
+	Init(pkgDir string) error
+	// The repository this package belongs to
+	Repo() *repo.Repo
+	// The name of this package
+	Name() string
+	// Is this package a BSP?
+	IsBsp() bool
+	// Hash of the contents of the package
+	Hash() (string, error)
+	// Description of this package
+	Desc() *PackageDesc
+	// Version of this package
+	Vers() *Version
+	// Dependency list for this package
+	Deps() []*Dependency
+	// APIs exported by this package
+	Apis() []*Dependency
+	// APIs required by this package
+	ReqApis() []*Dependency
+}
+
+// Description of a package
+type PackageDesc struct {
+	// Author of the package
+	Author string
+	// Homepage of the package for more information
+	Homepage    string
+	Description string
+	Keywords    []string
+}
+
+type BspPackage struct {
+	Package
+	LinkerScript   string
+	DownloadScript string
+	DebugScript    string
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/pkg/version.go
----------------------------------------------------------------------
diff --git a/newt/pkg/version.go b/newt/pkg/version.go
new file mode 100644
index 0000000..bf5afaf
--- /dev/null
+++ b/newt/pkg/version.go
@@ -0,0 +1,178 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package pkg
+
+import (
+	"fmt"
+	"regexp"
+	"strconv"
+	"strings"
+
+	"mynewt.apache.org/newt/util"
+)
+
+const VERSION_FORMAT = "%d.%d.%d"
+
+type VersionMatch struct {
+	CompareType string
+	Vers        *Version
+}
+
+type Version struct {
+	Major    int64
+	Minor    int64
+	Revision int64
+}
+
+func (v *Version) compareVersions(vers1 *Version, vers2 *Version) int64 {
+	if r := vers1.Major - vers2.Major; r != 0 {
+		return r
+	}
+
+	if r := vers1.Minor - vers2.Minor; r != 0 {
+		return r
+	}
+
+	if r := vers1.Revision - vers2.Revision; r != 0 {
+		return r
+	}
+
+	return 0
+}
+
+func (v *Version) SatisfiesVersion(versMatches []*VersionMatch) bool {
+	if versMatches == nil {
+		return true
+	}
+
+	for _, match := range versMatches {
+		r := v.compareVersions(match.Vers, v)
+		switch match.CompareType {
+		case "<":
+			if r <= 0 {
+				return false
+			}
+		case "<=":
+			if r < 0 {
+				return false
+			}
+		case ">":
+			if r >= 0 {
+				return false
+			}
+		case ">=":
+			if r > 0 {
+				return false
+			}
+		case "==":
+			if r != 0 {
+				return false
+			}
+		}
+	}
+
+	return true
+}
+
+func (vers *Version) String() string {
+	return fmt.Sprintf(VERSION_FORMAT, vers.Major, vers.Minor, vers.Revision)
+}
+
+func LoadVersion(versStr string) (*Version, error) {
+	var err error
+
+	parts := strings.Split(versStr, ".")
+	if len(parts) > 3 {
+		return nil, util.NewNewtError(fmt.Sprintf("Invalid version string: %s", versStr))
+	}
+
+	if strings.Trim(parts[0], " ") == "" || strings.Trim(parts[0], " ") == "none" {
+		return nil, nil
+	}
+
+	vers := &Version{}
+
+	// convert first string to an int
+	if vers.Major, err = strconv.ParseInt(parts[0], 0, 64); err != nil {
+		return nil, util.NewNewtError(err.Error())
+	}
+	if len(parts) >= 2 {
+		if vers.Minor, err = strconv.ParseInt(parts[1], 0, 64); err != nil {
+			return nil, util.NewNewtError(err.Error())
+		}
+	}
+	if len(parts) == 3 {
+		if vers.Revision, err = strconv.ParseInt(parts[2], 0, 64); err != nil {
+			return nil, util.NewNewtError(err.Error())
+		}
+	}
+
+	return vers, nil
+}
+
+// Parse a set of version string constraints on a dependency.
+// This function
+// The version string contains a list of version constraints in the following format:
+//    - <comparison><version>
+// Where <comparison> can be any one of the following comparison
+//   operators: <=, <, >, >=, ==
+// And <version> is specified in the form: X.Y.Z where X, Y and Z are all
+// int64 types in decimal form
+func LoadVersionMatches(versStr string) ([]*VersionMatch, error) {
+	var err error
+
+	versMatches := []*VersionMatch{}
+
+	re, err := regexp.Compile(`(<=|>=|==|>|<)([\d\.]+)`)
+	if err != nil {
+		return nil, err
+	}
+
+	matches := re.FindAllStringSubmatch(versStr, -1)
+	if matches != nil {
+		for _, match := range matches {
+			vm := &VersionMatch{}
+			vm.CompareType = match[1]
+			if vm.Vers, err = LoadVersion(match[2]); err != nil {
+				return nil, err
+			}
+
+			if vm.Vers != nil {
+				versMatches = append(versMatches, vm)
+			}
+		}
+	} else {
+		vm := &VersionMatch{}
+		vm.CompareType = "=="
+		if vm.Vers, err = LoadVersion(versStr); err != nil {
+			return nil, err
+		}
+
+		if vm.Vers != nil {
+			versMatches = append(versMatches, vm)
+		}
+	}
+
+	if len(versMatches) == 0 {
+		versMatches = nil
+	}
+
+	return versMatches, nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/project/cmds.go
----------------------------------------------------------------------
diff --git a/newt/project/cmds.go b/newt/project/cmds.go
new file mode 100644
index 0000000..226208b
--- /dev/null
+++ b/newt/project/cmds.go
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package project
+
+import (
+	"fmt"
+	"os"
+
+	"github.com/spf13/cobra"
+	"mynewt.apache.org/newt/newt/cli"
+)
+
+func projectRunCmd(cmd *cobra.Command, args []string) {
+	wd, err := os.Getwd()
+	if err != nil {
+		cli.NewtUsage(cmd, cli.NewNewtError(err.Error()))
+	}
+
+	proj, err := LoadProject(wd)
+	if err != nil {
+		cli.NewtUsage(cmd, err)
+	}
+	proj.LoadPackageList()
+	for rName, list := range proj.PackageList() {
+		fmt.Printf("repository name: %s\n", rName)
+		for pkgName, _ := range *list {
+			fmt.Printf("  %s\n", pkgName)
+		}
+	}
+
+	fmt.Printf("Project %s\n", proj.Name)
+	fmt.Printf("  BasePath: %s\n", proj.BasePath)
+}
+
+func AddCommands(cmd *cobra.Command) {
+	projectHelpText := ""
+	projectHelpEx := ""
+	projectCmd := &cobra.Command{
+		Use:     "project",
+		Short:   "Command for manipulating projects",
+		Long:    projectHelpText,
+		Example: projectHelpEx,
+		Run:     projectRunCmd,
+	}
+
+	cmd.AddCommand(projectCmd)
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/project/project.go
----------------------------------------------------------------------
diff --git a/newt/project/project.go b/newt/project/project.go
new file mode 100644
index 0000000..ca3174f
--- /dev/null
+++ b/newt/project/project.go
@@ -0,0 +1,185 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package project
+
+import (
+	"log"
+	"path"
+	"strings"
+
+	"mynewt.apache.org/newt/newt/cli"
+	"mynewt.apache.org/newt/newt/pkg"
+	"mynewt.apache.org/newt/newt/repo"
+	"mynewt.apache.org/newt/util"
+	"mynewt.apache.org/newt/viper"
+)
+
+const PROJECT_FILE_NAME = "project.yml"
+
+var PackageSearchDirs []string = []string{
+	"apps/",
+	"compiler/",
+	"fs/",
+	"libs/",
+	"net/",
+	"hw/bsp/",
+	"hw/mcu/",
+	"hw/mcu/stm",
+	"hw/drivers/",
+	"hw/",
+	"project/",
+	"sys/",
+}
+
+type Project struct {
+	// Name of this project
+	Name string
+
+	// Base path of the project
+	BasePath string
+
+	packages map[string]*map[string]*pkg.LocalPackage
+
+	// Repositories configured on this project
+	repos map[string]*repo.Repo
+
+	// Package search directories for this project
+	packageSearchDirs []string
+
+	v *viper.Viper
+}
+
+func NewProject(dir string) (*Project, error) {
+	proj := &Project{}
+
+	if err := proj.Init(dir); err != nil {
+		return nil, err
+	}
+
+	return proj, nil
+}
+
+func (proj *Project) Repos() map[string]*repo.Repo {
+	return proj.repos
+}
+
+func (proj *Project) PackageSearchDirs() []string {
+	return proj.packageSearchDirs
+}
+
+func (proj *Project) loadConfig() error {
+	v, err := util.ReadConfig(proj.BasePath,
+		strings.TrimSuffix(PROJECT_FILE_NAME, ".yml"))
+	if err != nil {
+		return util.NewNewtError(err.Error())
+	}
+	// Store configuration object for access to future values,
+	// this avoids keeping every string around as a project variable when
+	// we need to process it later.
+	proj.v = v
+
+	proj.Name = v.GetString("project.name")
+
+	rstrs := v.GetStringSlice("project.repositories")
+	// Local repository always included in initialization
+	rstrs = append(rstrs, repo.REPO_NAME_LOCAL)
+	for _, repoName := range rstrs {
+		repo, err := repo.NewRepo(proj.BasePath, repoName, v)
+		if err != nil {
+			return err
+		}
+
+		proj.repos[repo.Name] = repo
+	}
+
+	pkgDirs := v.GetStringSlice("project.pkg_dirs")
+	if len(pkgDirs) > 0 {
+		proj.packageSearchDirs = append(proj.packageSearchDirs, pkgDirs...)
+	}
+
+	return nil
+}
+
+func (proj *Project) Init(dir string) error {
+	proj.BasePath = dir
+
+	proj.repos = map[string]*repo.Repo{}
+	proj.packageSearchDirs = PackageSearchDirs
+
+	// Load Project configuration
+	if err := proj.loadConfig(); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func findProjectDir(dir string) (string, error) {
+	for {
+		projFile := path.Clean(dir) + "/" + PROJECT_FILE_NAME
+
+		log.Printf("[DEBUG] Searching for project file %s", projFile)
+		if cli.NodeExist(projFile) {
+			log.Printf("[INFO] Project file found at %s", projFile)
+			break
+		}
+
+		// Move back one directory and continue searching
+		dir = path.Clean(dir + "../../")
+		if dir == "/" {
+			return "", util.NewNewtError("No project file found!")
+		}
+	}
+
+	return dir, nil
+}
+
+func (proj *Project) LoadPackageList() error {
+	proj.packages = map[string]*map[string]*pkg.LocalPackage{}
+
+	// Go through a list of repositories, starting with local, and search for
+	// packages / store them in the project package list.
+	repos := proj.Repos()
+	for name, repo := range repos {
+		log.Printf("[VERBOSE] Loading packages in repository %s", repo.LocalPath)
+		list, err := pkg.ReadLocalPackages(repo.LocalPath, proj.PackageSearchDirs())
+		if err != nil {
+			return err
+		}
+
+		proj.packages[name] = list
+	}
+
+	return nil
+}
+
+func (proj *Project) PackageList() map[string]*map[string]*pkg.LocalPackage {
+	return proj.packages
+}
+
+func LoadProject(dir string) (*Project, error) {
+	projDir, err := findProjectDir(dir)
+	if err != nil {
+		return nil, err
+	}
+
+	proj, err := NewProject(projDir)
+	return proj, err
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/repo/repo.go
----------------------------------------------------------------------
diff --git a/newt/repo/repo.go b/newt/repo/repo.go
new file mode 100644
index 0000000..c1ff1e1
--- /dev/null
+++ b/newt/repo/repo.go
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package repo
+
+import (
+	"fmt"
+	"path/filepath"
+
+	"mynewt.apache.org/newt/viper"
+)
+
+const REPO_NAME_LOCAL = "local"
+
+const REPOS_DIR = "/repos/"
+
+type Repo struct {
+	Name      string
+	Url       string
+	LocalPath string
+	BasePath  string
+}
+
+func (r *Repo) Init(basePath string, repoName string, v *viper.Viper) error {
+	r.Name = repoName
+	r.BasePath = basePath
+
+	if r.Name == REPO_NAME_LOCAL {
+		r.LocalPath = filepath.Clean(basePath)
+	} else {
+		r.LocalPath = filepath.Clean(basePath + REPOS_DIR + repoName)
+	}
+
+	r.Url = v.GetString(fmt.Sprintf("%s.url", repoName))
+
+	return nil
+}
+
+func NewRepo(basePath string, repoName string,
+	v *viper.Viper) (*Repo, error) {
+	r := &Repo{}
+
+	if err := r.Init(basePath, repoName, v); err != nil {
+		return nil, err
+	}
+
+	return r, nil
+}

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/653e2697/newt/target/target.go
----------------------------------------------------------------------
diff --git a/newt/target/target.go b/newt/target/target.go
new file mode 100644
index 0000000..bd4e521
--- /dev/null
+++ b/newt/target/target.go
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package builder
+
+type Target struct {
+	Bsp string
+	App string
+}