| |
| |
| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| |
| |
| |
| |
| <title>Contributing to Newt or Newtmgr Tools — Apache Mynewt latest documentation</title> |
| |
| |
| |
| |
| <link rel="shortcut icon" href="../_static/mynewt-logo-only-newt32x32.png"/> |
| |
| |
| |
| |
| <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> |
| |
| |
| <link rel="stylesheet" href="../_static/css/sphinx_theme.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../_static/css/bootstrap-3.0.3.min.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../_static/css/v2.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../_static/css/custom.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../_static/css/restructuredtext.css" type="text/css" /> |
| |
| |
| |
| |
| <link rel="stylesheet" href="../_static/css/overrides.css" type="text/css" /> |
| <link rel="index" title="Index" |
| href="../genindex.html"/> |
| <link rel="search" title="Search" href="../search.html"/> |
| <link rel="top" title="Apache Mynewt latest documentation" href="../index.html"/> |
| <link rel="up" title="Appendix" href="index.html"/> |
| <link rel="next" title="Developing Mynewt Applications with Visual Studio Code" href="ide.html"/> |
| <link rel="prev" title="Appendix" href="index.html"/> |
| |
| |
| <script src="../_static/js/modernizr.min.js"></script> |
| |
| |
| <script> |
| (function(i, s, o, g, r, a, m) { |
| i["GoogleAnalyticsObject"] = r; |
| (i[r] = |
| i[r] || |
| function() { |
| (i[r].q = i[r].q || []).push(arguments); |
| }), |
| (i[r].l = 1 * new Date()); |
| (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]); |
| a.async = 1; |
| a.src = g; |
| m.parentNode.insertBefore(a, m); |
| })(window, document, "script", "//www.google-analytics.com/analytics.js", "ga"); |
| |
| ga("create", "UA-72162311-1", "auto"); |
| ga("send", "pageview"); |
| </script> |
| |
| |
| </head> |
| |
| <body class="not-front page-documentation" role="document" > |
| <div id="wrapper"> |
| <div class="container"> |
| <div id="banner" class="row v2-main-banner"> |
| <a class="logo-cell" href="/"> |
| <img class="logo" src="../_static/img/logo.png"> |
| </a> |
| <div class="tagline-cell"> |
| <h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4> |
| </div> |
| <div class="news-cell"> |
| <div class="well"> |
| <h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.12.0, Apache NimBLE 1.7.0 </a> released April 4, 2024) |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| <header> |
| <nav id="navbar" class="navbar navbar-inverse" role="navigation"> |
| <div class="container"> |
| <!-- Collapsed navigation --> |
| <div class="navbar-header"> |
| <!-- Expander button --> |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| |
| </div> |
| |
| <!-- Expanded navigation --> |
| <div class="navbar-collapse collapse"> |
| <!-- Main navigation --> |
| <ul class="nav navbar-nav navbar-right"> |
| <li> |
| <a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a> |
| </li> |
| <li class="important"> |
| <a href="/quick-start/">Quick Start</a> |
| </li> |
| <li> |
| <a href="/about/">About</a> |
| </li> |
| <li> |
| <a href="/talks/">Talks</a> |
| </li> |
| <li class="active"> |
| <a href="/documentation/">Documentation</a> |
| </li> |
| <li> |
| <a href="/download/">Download</a> |
| </li> |
| <li> |
| <a href="/community/">Community</a> |
| </li> |
| <li> |
| <a href="/events/">Events</a> |
| </li> |
| </ul> |
| |
| <!-- Search, Navigation and Repo links --> |
| <ul class="nav navbar-nav navbar-right"> |
| |
| </ul> |
| </div> |
| </div> |
| </nav> |
| </header> |
| <!-- STARTS MAIN CONTENT --> |
| <div id="main-content"> |
| |
| |
| |
| |
| |
| |
| <div id="breadcrumb"> |
| <div class="container"> |
| <a href="/documentation/">Docs</a> / |
| |
| <a href="index.html">Appendix</a> / |
| |
| Contributing to Newt or Newtmgr Tools |
| |
| <div class="sourcelink"> |
| <a href="https://github.com/apache/mynewt-documentation/edit/master/docs/misc/go_env.rst" class="icon icon-github" |
| rel="nofollow"> Edit on GitHub</a> |
| </div> |
| </div> |
| </div> |
| <!-- STARTS CONTAINER --> |
| <div class="container"> |
| <!-- STARTS .content --> |
| <div id="content" class="row"> |
| |
| <!-- STARTS .container-sidebar --> |
| <div class="container-sidebar col-xs-12 col-sm-3"> |
| <div id="docSidebar" class="sticky-container"> |
| <div role="search" class="sphinx-search"> |
| <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> |
| <input type="text" name="q" placeholder="Search documentation" class="search-documentation" /> |
| <input type="hidden" name="check_keywords" value="yes" /> |
| <input type="hidden" name="area" value="default" /> |
| </form> |
| </div> |
| <!-- Note: only works when deployed --> |
| <select class="form-control" onchange="if (this.value) window.location.href=this.value"> |
| <option value="/latest" selected> |
| Version: latest |
| </option> |
| <option value="/v1_12_0" > |
| Version: 1.12.0 |
| </option> |
| <option value="/v1_11_0" > |
| Version: 1.11.0 |
| </option> |
| <option value="/v1_10_0" > |
| Version: 1.10.0 |
| </option> |
| <option value="/v1_9_0" > |
| Version: 1.9.0 |
| </option> |
| <option value="/v1_8_0" > |
| Version: 1.8.0 |
| </option> |
| <option value="/v1_7_0" > |
| Version: 1.7.0 |
| </option> |
| <option value="/v1_6_0" > |
| Version: 1.6.0 |
| </option> |
| <option value="/v1_5_0" selected="selected" > |
| Version: 1.5.0 |
| </option> |
| <option value="/v1_4_0" > |
| Version: 1.4.0 |
| </option> |
| <option value="/v1_3_0/os/introduction" > |
| Version: 1.3.0 |
| </option> |
| <option value="/v1_2_0/os/introduction" > |
| Version: 1.2.0 |
| </option> |
| <option value="/v1_1_0/os/introduction" > |
| Version: 1.1.0 |
| </option> |
| <option value="/v1_0_0/os/introduction" > |
| Version: 1.0.0 |
| </option> |
| <option value="/v0_9_0/os/introduction" > |
| Version: 0.9.0 |
| </option> |
| </select> |
| <div class="region region-sidebar"> |
| <div class="docs-menu"> |
| |
| |
| |
| <ul class="current"> |
| <li class="toctree-l1"><a class="reference internal" href="../index.html">Introduction</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../get_started/index.html">Setup & Get Started</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../concepts.html">Concepts</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../tutorials/tutorials.html">Tutorials</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../external_links.html">Third-party Resources</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../os/os_user_guide.html">OS User Guide</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../network/index.html">BLE User Guide</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../newt/index.html">Newt Tool Guide</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../newtmgr/index.html">Newt Manager Guide</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../mynewt_faq/index.html">Mynewt FAQ</a></li> |
| <li class="toctree-l1 current"><a class="reference internal" href="index.html">Appendix</a><ul class="current"> |
| <li class="toctree-l2 current"><a class="current reference internal" href="#">Contributing to Newt or Newtmgr Tools</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="ide.html">Developing Mynewt Applications with Visual Studio Code</a></li> |
| </ul> |
| </li> |
| </ul> |
| |
| |
| |
| </div> |
| </div> |
| </div> |
| <!-- ENDS STICKY CONTAINER --> |
| </div> |
| <!-- ENDS .container-sidebar --> |
| |
| <div class="col-xs-12 col-sm-9"> |
| |
| <div class="alert alert-warning"> |
| <p> |
| Version 1.5.0 is not the most recent version of the |
| Apache Mynewt documentation. Click <a href="/latest">here</a> to |
| read the latest version. |
| </p> |
| </div> |
| |
| |
| |
| <div class=""> |
| <div class="rst-content"> |
| <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
| <div itemprop="articleBody"> |
| |
| <div class="section" id="contributing-to-newt-or-newtmgr-tools"> |
| <h1>Contributing to Newt or Newtmgr Tools<a class="headerlink" href="#contributing-to-newt-or-newtmgr-tools" title="Permalink to this headline">¶</a></h1> |
| <p>Newt and Newtmgr are written in Go (golang). This guide shows you how to |
| install Go and setup your environment to update and build the tools if |
| you want to:</p> |
| <ul class="simple"> |
| <li><p>Build the tools with latest updates from the master branch on Linux |
| or Windows platforms. |
| <strong>Note:</strong> For Mac OS, you can use the |
| <code class="docutils literal notranslate"><span class="pre">brew</span> <span class="pre">install</span> <span class="pre">mynewt-newt</span> <span class="pre">-HEAD</span></code> and the |
| <code class="docutils literal notranslate"><span class="pre">brew</span> <span class="pre">install</span> <span class="pre">mynewt-newtmgr</span> <span class="pre">--HEAD</span></code> commands.</p></li> |
| <li><p>Contribute to newt or newtmgr features or fix bugs.</p></li> |
| </ul> |
| <p>This guide shows you how to perform the following:</p> |
| <ol class="arabic simple"> |
| <li><p>Install Mac OS X, Linux, Windows. (Tasks that are specific to each |
| platform are called out.)</p></li> |
| <li><p>Setup the Go environment.</p></li> |
| <li><p>Download the source, build, and install the newt or newtmgr tools.</p></li> |
| <li><p>Update and rebuild the tools.</p></li> |
| </ol> |
| <div class="contents local topic" id="contents"> |
| <ul class="simple"> |
| <li><p><a class="reference internal" href="#step-1-installing-go" id="id1">Step 1: Installing Go</a></p> |
| <ul> |
| <li><p><a class="reference internal" href="#installing-go-on-mac-os-x" id="id2">Installing Go on Mac OS X</a></p></li> |
| <li><p><a class="reference internal" href="#installing-go-and-git-on-linux" id="id3">Installing Go and git on Linux</a></p></li> |
| <li><p><a class="reference internal" href="#installing-go-on-and-git-windows" id="id4">Installing Go on and git Windows</a></p></li> |
| </ul> |
| </li> |
| <li><p><a class="reference internal" href="#step-2-setting-up-your-go-environment" id="id5">Step 2: Setting Up Your Go Environment</a></p></li> |
| <li><p><a class="reference internal" href="#step-3-downloading-the-source-and-installing-the-tools" id="id6">Step 3: Downloading the Source and Installing the Tools</a></p> |
| <ul> |
| <li><p><a class="reference internal" href="#downloading-and-installing-the-newt-tool" id="id7">Downloading and Installing the Newt Tool</a></p></li> |
| <li><p><a class="reference internal" href="#downloading-and-installing-the-newtmgr-tool" id="id8">Downloading and Installing the Newtmgr Tool</a></p></li> |
| </ul> |
| </li> |
| <li><p><a class="reference internal" href="#step-4-updating-and-rebuilding-the-tools" id="id9">Step 4: Updating and Rebuilding the Tools:</a></p></li> |
| </ul> |
| </div> |
| <p><strong>Note:</strong> You will also need to read and follow the instructions from |
| the <span class="xref std std-doc">faq</span> to set up your git repos to submit changes.</p> |
| <div class="section" id="step-1-installing-go"> |
| <h2><a class="toc-backref" href="#id1">Step 1: Installing Go</a><a class="headerlink" href="#step-1-installing-go" title="Permalink to this headline">¶</a></h2> |
| <p>The latest master branch of newt and newtmgr requires GO version 1.7.6 |
| or higher. You can skip this step and proceed to Step 2 if you already |
| have Go version 1.7.6 or higher installed.</p> |
| <div class="section" id="installing-go-on-mac-os-x"> |
| <h3><a class="toc-backref" href="#id2">Installing Go on Mac OS X</a><a class="headerlink" href="#installing-go-on-mac-os-x" title="Permalink to this headline">¶</a></h3> |
| <p>If you do not have Homebrew installed, run the following command. You |
| will be prompted for your sudo password.</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>ruby<span class="w"> </span>-e<span class="w"> </span><span class="s2">"</span><span class="k">$(</span>curl<span class="w"> </span>-fsSL<span class="w"> </span>https://raw.githubusercontent.com/Homebrew/install/master/install<span class="k">)</span><span class="s2">"</span> |
| </pre></div> |
| </div> |
| <p>You can also extract (or <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">clone</span></code>) Homebrew and install it to |
| /usr/local.</p> |
| <p>Use brew to install Go:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>go |
| <span class="go">==></span> |
| <span class="go">...</span> |
| <span class="go">...</span> |
| <span class="go">==> Summary</span> |
| <span class="go">🍺 /usr/local/Cellar/go/1.8.3: 7,035 files, 282.0MB</span> |
| </pre></div> |
| </div> |
| <p>You can also download the Go package directly from |
| (<a class="reference external" href="https://golang.org/dl/">https://golang.org/dl/</a>) and install it in /usr/local/bin instead of |
| brewing it.</p> |
| </div> |
| <div class="section" id="installing-go-and-git-on-linux"> |
| <h3><a class="toc-backref" href="#id3">Installing Go and git on Linux</a><a class="headerlink" href="#installing-go-and-git-on-linux" title="Permalink to this headline">¶</a></h3> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">sudo apt-get install golang git</span> |
| </pre></div> |
| </div> |
| </div> |
| <div class="section" id="installing-go-on-and-git-windows"> |
| <h3><a class="toc-backref" href="#id4">Installing Go on and git Windows</a><a class="headerlink" href="#installing-go-on-and-git-windows" title="Permalink to this headline">¶</a></h3> |
| <p>In msys2 terminal type</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">pacman -S mingw-w64-x64_64-go git</span> |
| </pre></div> |
| </div> |
| <p>Make sure to restart msys2 terminal after installation.</p> |
| </div> |
| </div> |
| <div class="section" id="step-2-setting-up-your-go-environment"> |
| <h2><a class="toc-backref" href="#id5">Step 2: Setting Up Your Go Environment</a><a class="headerlink" href="#step-2-setting-up-your-go-environment" title="Permalink to this headline">¶</a></h2> |
| <p>This section describes the Go environment and how to setup a Go |
| workspace. If you already have a Go workspace for your other Go |
| projects, you can skip this step and proceed to Step 3.</p> |
| <p>Go provides an environment to compile Go code, construct Go packages, |
| and import Go code. You will use Go commands to import the newt or |
| newtmgr package repository into your local Go environment. The Go |
| language environment dictates a specific directory structure, or |
| workspace in Go parlance. It must contain three sibling directories with |
| the names <strong>src</strong>, <strong>pkg</strong> and <strong>bin</strong>:</p> |
| <ul class="simple"> |
| <li><p>src contains Go source files organized into packages (one package per |
| directory)</p></li> |
| <li><p>pkg contains package objects</p></li> |
| <li><p>bin contains the Go application executables that Go builds and |
| installs.</p></li> |
| </ul> |
| <p>The <strong>GOPATH</strong> environment variable specifies the location of your |
| workspace. To setup this workspace environment, create a <strong>dev</strong> |
| directory and then a <strong>go</strong> directory under it. Set the GOPATH |
| environment variable to this directory where you will clone the newt and |
| newtmgr repositories.</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span> |
| <span class="gp">$ </span>mkdir<span class="w"> </span>-p<span class="w"> </span>dev/go |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>dev/go |
| <span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">GOPATH</span><span class="o">=</span><span class="sb">`</span><span class="nb">pwd</span><span class="sb">`</span> |
| </pre></div> |
| </div> |
| <p>Add the following export statements to your ~/.bash_profile file and |
| source the file:</p> |
| <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">GOPATH</span><span class="o">=</span><span class="nv">$HOME</span>/dev/go |
| <span class="nb">export</span><span class="w"> </span><span class="nv">PATH</span><span class="o">=</span><span class="nv">$GOPATH</span>/bin:<span class="nv">$PATH</span> |
| </pre></div> |
| </div> |
| </div> |
| <div class="section" id="step-3-downloading-the-source-and-installing-the-tools"> |
| <h2><a class="toc-backref" href="#id6">Step 3: Downloading the Source and Installing the Tools</a><a class="headerlink" href="#step-3-downloading-the-source-and-installing-the-tools" title="Permalink to this headline">¶</a></h2> |
| <p>Newt and newtmgr are individual Go packages and have their own git |
| repositories. You can download the source and install one or both tools.</p> |
| <p>We use the <code class="docutils literal notranslate"><span class="pre">go</span> <span class="pre">get</span></code> command to download the source, build, and install |
| the binary in the <strong>$GOPATH/bin</strong> directory.</p> |
| <div class="section" id="downloading-and-installing-the-newt-tool"> |
| <h3><a class="toc-backref" href="#id7">Downloading and Installing the Newt Tool</a><a class="headerlink" href="#downloading-and-installing-the-newt-tool" title="Permalink to this headline">¶</a></h3> |
| <p>The newt Go package is <strong>mynewt.apache.org/newt/newt</strong> and is stored in |
| the <a class="reference external" href="https://github.com/apache/mynewt-newt">Apache Mynewt newt tool repository mirrored on |
| github</a>.</p> |
| <p>Download the newt package source and install the tool:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$GOPATH</span> |
| <span class="gp">$ </span>go<span class="w"> </span>get<span class="w"> </span>mynewt.apache.org/newt/newt |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$GOPATH</span>/src/mynewt.apache.org/newt |
| <span class="gp">$ </span>ls |
| <span class="go">DISCLAIMER RELEASE_NOTES.md util</span> |
| <span class="go">INSTALLING.md build.sh viper</span> |
| <span class="go">LICENSE newt yaml</span> |
| <span class="go">NOTICE newtmgr</span> |
| <span class="go">README.md newtvm</span> |
| <span class="gp">$ </span>git<span class="w"> </span>status |
| <span class="go">On branch master</span> |
| <span class="go">Your branch is up-to-date with 'origin/master'.</span> |
| <span class="go">nothing to commit, working directory clean</span> |
| </pre></div> |
| </div> |
| <p><strong>Note:</strong> The source code under the <strong>newtmgr</strong> directory is no longer |
| used or updated. The current <strong>newtmgr</strong> source has its own Git |
| repository.</p> |
| <p>Check that the newt binary is installed and you are using the one from |
| <strong>$GOPATH/bin</strong>:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>ls<span class="w"> </span><span class="nv">$GOPATH</span>/bin/newt |
| <span class="go">~/dev/go/bin/newt</span> |
| <span class="gp">$ </span>which<span class="w"> </span>newt |
| <span class="go">~/dev/go/bin/newt</span> |
| <span class="gp">$ </span>newt<span class="w"> </span>version |
| <span class="go">Apache Newt version: 1.1.0-dev</span> |
| </pre></div> |
| </div> |
| </div> |
| <div class="section" id="downloading-and-installing-the-newtmgr-tool"> |
| <h3><a class="toc-backref" href="#id8">Downloading and Installing the Newtmgr Tool</a><a class="headerlink" href="#downloading-and-installing-the-newtmgr-tool" title="Permalink to this headline">¶</a></h3> |
| <p>The newtmgr Go package is <strong>mynewt.apache.org/newtmgr/newtmgr</strong>. It is |
| stored in the <a class="reference external" href="https://github.com/apache/mynewt-newtmgr">Apache Mynewt newtmgr tool repository mirrored on |
| github</a>.</p> |
| <p>Download the newtmgr package and install the tool:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$GOPATH</span> |
| <span class="gp">$ </span>go<span class="w"> </span>get<span class="w"> </span>mynewt.apache.org/newtmgr/newtmgr |
| <span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$GOPATH</span>/src/mynewt.apache.org/newtmgr |
| <span class="gp">$ </span>ls |
| <span class="go">LICENSE NOTICE README.md newtmgr nmxact</span> |
| <span class="gp">$ </span>git<span class="w"> </span>status |
| <span class="go">On branch master</span> |
| <span class="go">Your branch is up-to-date with 'origin/master'.</span> |
| <span class="go">nothing to commit, working directory clean</span> |
| </pre></div> |
| </div> |
| <p>Check that the newtmgr binary is installed and you are using the one |
| from <strong>$GOPATH/bin</strong>:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>ls<span class="w"> </span><span class="nv">$GOPATH</span>/bin/newtmgr |
| <span class="go">~/dev/go/bin/newtmgr</span> |
| <span class="gp">$ </span>which<span class="w"> </span>newtmgr |
| <span class="go">~/dev/go/bin/newtmgr</span> |
| </pre></div> |
| </div> |
| </div> |
| </div> |
| <div class="section" id="step-4-updating-and-rebuilding-the-tools"> |
| <h2><a class="toc-backref" href="#id9">Step 4: Updating and Rebuilding the Tools:</a><a class="headerlink" href="#step-4-updating-and-rebuilding-the-tools" title="Permalink to this headline">¶</a></h2> |
| <p>This section shows you |
| how to rebuild the newt and newtmgr tools with the latest updates from |
| the master branch or after you have made changes in your branch.</p> |
| <p>Here is the general procedure to rebuild either the newt or newtmgr |
| tool. The only difference is the directory where you will be executing |
| the commands from. You will need to repeat the procedure to rebuild both |
| tools.</p> |
| <ol class="arabic simple"> |
| <li><p>Change to the directory where the local Git repository for the tool |
| is installed.</p></li> |
| <li><p>Pull the latest changes from the master branch. If you made changes |
| you will need to rebase with <strong>origin master</strong> (See |
| <span class="xref std std-doc">faq</span>).</p></li> |
| <li><p>Build and install the tool.</p></li> |
| </ol> |
| <p>Change to the directory where the source for the tool is installed.</p> |
| <p>For the <strong>newt</strong> tool:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$GOPATH</span>/src/mynewt.apache.org/newt/newt |
| </pre></div> |
| </div> |
| <p>For the <strong>newtmgr</strong> tool:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$GOPATH</span>/src/mynewt.apache.org/newtmgr/newtmgr |
| </pre></div> |
| </div> |
| <p>After you change to the specific tool directory, get the latest updates |
| from the master branch. If you made changes and need to rebase with the |
| origin, add the <code class="docutils literal notranslate"><span class="pre">--rebase</span> <span class="pre">origin</span> <span class="pre">master</span></code> arguments to the <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">pull</span></code> |
| command:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>git<span class="w"> </span>pull |
| </pre></div> |
| </div> |
| <p>Build and install the tool. The updated binary will be installed in the |
| <strong>$GOPATH/bin</strong> directory:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>go<span class="w"> </span>install |
| </pre></div> |
| </div> |
| <p>You can run the <code class="docutils literal notranslate"><span class="pre">ls</span> <span class="pre">-l</span></code> command to check the modification time for the |
| binary to ensure the new version is installed.</p> |
| </div> |
| </div> |
| |
| |
| </div> |
| </div> |
| |
| <div class="rst-footer-buttons row" role="navigation" aria-label="footer navigation"> |
| |
| <a href="ide.html" class="btn btn-neutral float-right" title="Developing Mynewt Applications with Visual Studio Code" accesskey="n">Next: Developing Mynewt Applications with Visual Studio Code <span class="fa fa-arrow-circle-right"></span></a> |
| |
| |
| <a href="index.html" class="btn btn-neutral" title="Appendix" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous: Appendix</a> |
| |
| </div> |
| |
| </div> |
| </div> |
| </div> |
| <!-- ENDS CONTENT SECTION --> |
| </div> |
| <!-- ENDS .content --> |
| </div> |
| </div> |
| <footer> |
| <div class="container"> |
| <div class="row"> |
| <div class="col-xs-12"> |
| |
| <p class="copyright">Apache Mynewt is available under Apache License, version 2.0.</p> |
| |
| </div> |
| <div class="col-xs-12"> |
| <div class="logos"> |
| <img src="../_static/img/asf_logo_wide_small.png" alt="Apache" title="Apache"> |
| <small class="footnote"> |
| Apache Mynewt, Mynewt, Apache, the Apache feather logo, and the Apache Mynewt project logo are either |
| registered trademarks or trademarks of the Apache Software Foundation in the United States and other countries. |
| </small> |
| <a href=""> |
| <img src="../_static/img/add_to_slack.png" alt="Slack Icon" title="Join our Slack Community" /> |
| </a> |
| </div> |
| </div> |
| </div> |
| </div> |
| </footer> |
| </div> |
| <!-- ENDS #wrapper --> |
| |
| |
| |
| <script type="text/javascript"> |
| var DOCUMENTATION_OPTIONS = { |
| URL_ROOT:'../', |
| VERSION:'latest', |
| COLLAPSE_INDEX:false, |
| FILE_SUFFIX:'.html', |
| HAS_SOURCE: true, |
| SOURCELINK_SUFFIX: '.txt', |
| LINK_SUFFIX: '.html' |
| }; |
| </script> |
| <script type="text/javascript" src="../_static/jquery.js"></script> |
| <script type="text/javascript" src="../_static/underscore.js"></script> |
| <script type="text/javascript" src="../_static/doctools.js"></script> |
| <script type="text/javascript" src="../_static/js/bootstrap-3.0.3.min.js"></script> |
| <script type="text/javascript" src="../_static/js/affix.js"></script> |
| <script type="text/javascript" src="../_static/js/main.js"></script> |
| |
| |
| |
| </body> |
| </html> |