| Index: app/views/doc/pub-upgrade.html
|
| diff --git a/app/views/doc/pub-upgrade.html b/app/views/doc/pub-upgrade.html
|
| deleted file mode 100644
|
| index 235e3e61254b9ed205e171364b75caf6a5302211..0000000000000000000000000000000000000000
|
| --- a/app/views/doc/pub-upgrade.html
|
| +++ /dev/null
|
| @@ -1,75 +0,0 @@
|
| -<pre><code>$ pub upgrade [PACKAGE]
|
| -</code></pre>
|
| -
|
| -<p>Without any additional arguments, <code>pub upgrade</code> gets the latest versions of
|
| -all the dependencies listed in the <a href="pubspec.html"><code>pubspec.yaml</code></a> file in the
|
| -current working directory, as well as their <a href="glossary.html#transitive-dependencies">transitive
|
| -dependencies</a>, to the <code>packages</code>
|
| -directory located next to the pubspec. For example:</p>
|
| -
|
| -<pre><code>$ pub upgrade
|
| -Dependencies upgraded!
|
| -</code></pre>
|
| -
|
| -<p>When <code>pub upgrade</code> upgrades dependency versions, it writes a
|
| -<a href="glossary.html#lockfile">lockfile</a> to ensure that future <a href="pub-get.html"><code>pub
|
| -get</code>s</a> will use the same versions of those dependencies.
|
| -Application packages should check in the lockfile to source control; this
|
| -ensures the application will use the exact same versions of all dependencies for
|
| -all developers and when deployed to production. Library packages should not
|
| -check in the lockfile, though, since they’re expected to work with a range of
|
| -dependency versions.</p>
|
| -
|
| -<p>If a lockfile already exists, <code>pub upgrade</code> will ignore it and generate a new
|
| -one from scratch using the latest versions of all dependencies. This is the
|
| -primary difference between <code>pub upgrade</code> and <code>pub get</code>, which always tries to
|
| -get the dependency versions specified in the existing lockfile.</p>
|
| -
|
| -<h2 id="upgrading-specific-dependencies">Upgrading specific dependencies</h2>
|
| -
|
| -<p>It’s possible to tell <code>pub upgrade</code> to upgrade specific dependencies to the
|
| -latest version while leaving the rest of the dependencies alone as much as
|
| -possible. For example:</p>
|
| -
|
| -<pre><code>$ pub upgrade unittest args
|
| -Dependencies upgraded!
|
| -</code></pre>
|
| -
|
| -<p>Upgrading a dependency upgrades its transitive dependencies to their latest
|
| -versions as well. Usually, no other dependencies are updated; they stay at the
|
| -versions that are locked in the lockfile. However, if the requested upgrades
|
| -cause incompatibilities with these locked versions, they will be selectively
|
| -unlocked until a compatible set of versions is found.</p>
|
| -
|
| -<h2 id="getting-a-new-dependency">Getting a new dependency</h2>
|
| -
|
| -<p>If a dependency is added to the pubspec before <code>pub upgrade</code> is run, it will
|
| -get the new dependency and any of its transitive dependencies and place them in
|
| -the <code>packages</code> directory. This is the same behavior as <code>pub get</code>.</p>
|
| -
|
| -<h2 id="removing-a-dependency">Removing a dependency</h2>
|
| -
|
| -<p>If a dependency is removed from the pubspec before <code>pub upgrade</code> is run, it
|
| -will remove the dependency from the <code>packages</code> directory, thus making it
|
| -unavailable for importing. Any transitive dependencies of the removed dependency
|
| -will also be removed, as long as no remaining immediate dependencies also depend
|
| -on them. This is the same behavior as <code>pub get</code>.</p>
|
| -
|
| -<h2 id="upgrading-while-offline">Upgrading while offline</h2>
|
| -
|
| -<p>If you don’t have network access, you can still run <code>pub upgrade</code>. Since pub
|
| -downloads packages to a central cache shared by all packages on your system, it
|
| -can often find previously-downloaded packages there without needing to hit the
|
| -network.</p>
|
| -
|
| -<p>However, by default, pub will always try to go online when you upgrade if you
|
| -have any hosted dependencies so that it can see if newer versions of them are
|
| -available. If you don’t want it to do that, pass the <code>--offline</code> flag when
|
| -running pub. In this mode, it will only look in your local package cache and
|
| -try to find a set of versions that work with your package from what’s already
|
| -available.</p>
|
| -
|
| -<p>Keep in mind that pub <em>will</em> generate a lockfile after it does this. If the
|
| -only version of some dependency in your cache happens to be old, this will lock
|
| -your app to that version. The next time you are online, you will likely want to
|
| -run <code>pub upgrade</code> again to upgrade to a later version.</p>
|
|
|