Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change installation to use bundles #912

Merged
merged 17 commits into from
Apr 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 19 additions & 24 deletions _includes/setup/get-sdk-win.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
## Get the Flutter SDK

To get Flutter, use `git` to clone the repository and then add the `flutter` tool to your path.
Running `flutter doctor` shows any remaining dependencies you may need to install.
1. Download the following installation bundle to get the latest beta release of the
Flutter SDK (for other release channels, and older builds, see the [SDK
archive](/sdk-archive/) page.):
* [(loading...)](#){:.download-latest-link-windows}
1. Extract the zip-file and place the contained `flutter` in the desired
installation location for the Flutter SDK
1. Locate the file `flutter_console.bat` inside the `flutter` directory. Start it by double-clicking.

### Clone the repo
You are now ready to run Flutter commands in the Flutter Console!

If this is the first time you're installing Flutter on this machine, clone the
repository:

{% commandline %}
git clone -b beta https://github.com/flutter/flutter.git
{% endcommandline %}

To update an existing version of Flutter, see [Upgrading Flutter](/upgrading/)
To update an existing version of Flutter, see [Upgrading Flutter](/upgrading/).

### Update your path

To run the `flutter` command in any terminal session, you need to add it to your PATH environment variable:
If you wish to run Flutter commands in the regular Windows command prompt, take
these steps to add Flutter to the PATH environment variable:

* Go to "Control Panel > User Accounts > User Accounts > Change my environment variables"
* Go to "Control Panel > User Accounts > User Accounts > Change my environment
variables"
* Under "User variables" check if there is an entry called "Path":
* If the entry does exist, append the full path to `flutter\bin` using `;` as a separator from existing values.
* If the entry does not exist, create a new user variable named `Path` with the full path to `flutter\bin` as its value.
* If the entry does exist, append the full path to `flutter\bin` using `;`
as a separator from existing values.
* If the entry does not exist, create a new user variable named `Path` with
the full path to `flutter\bin` as its value.

Reboot Windows to fully apply this change.

### Run flutter doctor

Open a new Command Prompt or PowerShell window and run the following command to
see if there are any dependencies you need to install to complete the setup:
In the Flutter Console, run the following command to
see if there are any dependencies you need to install to complete the setup:

{% commandline %}
flutter doctor
{% endcommandline %}

Run this command in either a Command Prompt or PowerShell window. Currently, Flutter does
not support third-party shells like Git Bash.
{: .alert-warning}

This command checks your environment and displays a report to the terminal window.
The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately.
Check the output carefully for other software you may need to install or further
Expand All @@ -52,9 +50,6 @@ For example:
visit https://flutter.io/setup/#android-setup for detailed instructions.
</pre>

The first time you run a flutter command (such as `flutter doctor`), it downloads its own dependencies and compiles
itself. Subsequent runs should be much faster.

The following sections describe how to perform these tasks and finish the setup process.
You'll see in `flutter doctor` output that if you choose to use an IDE, plugins
are available for IntelliJ IDEA, Android Studio, and VS Code. See [Editor Setup](/get-started/editor/)
Expand Down
44 changes: 26 additions & 18 deletions _includes/setup/get-sdk.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
## Get the Flutter SDK

To get Flutter, use `git` to clone the repository and then add the `flutter` tool to your path.
Running `flutter doctor` shows any remaining dependencies you may need to install.

### Clone the repo

If this is the first time you're installing Flutter on this machine, clone the
`beta` branch of the repository and then add the `flutter` tool to your path:

{% commandline %}
git clone -b beta https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
{% endcommandline %}
## Get the Flutter SDK {#get-sdk}

1. Download the following installation bundle to get the latest beta release of the
Flutter SDK (for other release channels, and older builds, see the [SDK
archive](/sdk-archive/) page.):
{% if page.url contains "linux" %}
* [(loading...)](#){:.download-latest-link-linux}
{% else %}
* [(loading...)](#){:.download-latest-link-macos}
{% endif %}<br><br>
1. Extract the file in the desired location, e.g.:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For macOS, you might say something like "Either double click to extract the archive, or extract the file in the desired location from the command line:"

In reality, you could probably double-click on the archive in Linux too, since most distros have a built-in extractor, but I'm not sure how universal that is (probably pretty universal).

{% commandline %}
cd ~/development
{% if page.url contains "linux" %}
tar xf ~/Downloads/<span class="download-latest-link-filename-linux">flutter_linux_xxx.tar.xz</span>
{% else %}
unzip ~/Downloads/<span class="download-latest-link-filename-macos">flutter_macos_xxx.zip</span>
{% endif %}
{% endcommandline %}

1. Add the `flutter` tool to your path:
{% commandline %}
export PATH=`pwd`/flutter/bin:$PATH
{% endcommandline %}

The above command sets your PATH variable temporarily, for the current terminal window. To
permanently add Flutter to your path, see [Update your path](#update-your-path).

To update an existing version of Flutter, see [Upgrading Flutter](/upgrading/).
You are now ready to run Flutter commands!

To update an existing version of Flutter, see [Upgrading Flutter](/upgrading/).

### Run flutter doctor

Expand All @@ -42,9 +53,6 @@ For example:
visit https://flutter.io/setup/#android-setup for detailed instructions.
</pre>

The first time you run a flutter command (such as `flutter doctor`), it downloads its own dependencies and compiles
itself. Subsequent runs should be much faster.

The following sections describe how to perform these tasks and finish the setup process.
You'll see in `flutter doctor` output that if you choose to use an IDE, plugins
are available for IntelliJ IDEA, Android Studio, and VS Code. See [Editor Setup](/get-started/editor/)
Expand Down
2 changes: 1 addition & 1 deletion _includes/setup/path-mac-linux.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Update your path

You can update your PATH variable for the current session only at the command line,
as shown in [Clone the Flutter repo](./#clone-the-repo). You'll probably want to
as shown in [Get the Flutter SDK](./#get-sdk). You'll probably want to
update this variable permanently, so you can run `flutter` commands in any terminal session.

The steps for modifying this variable permanently for all terminal sessions are machine-specific.
Expand Down
35 changes: 33 additions & 2 deletions js/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ var fetchFlutterReleases = function (os, callback, errorCallback) {
callback(data, os);
},
error: function (xhr, textStatus, errorThrown) {
errorCallback(os);
if (errorCallback)
errorCallback(os);
}
})
}

function updateTable(releases, os) {
// Convert the data for easier parsing and sort.
var releaseData = releases.releases;

for (var channel in releases.current_release) {
Expand Down Expand Up @@ -59,12 +59,43 @@ function updateTableFailed(os) {
tab.find(".loading").text("Failed to load releases");
}

function updateDownloadLink(releases, os) {
var channel = "beta";
var releasesForChannel = releases.releases.filter(function (release) {
return release.channel == channel;
});
if (!releasesForChannel.length)
return;

var release = releasesForChannel[0];
var linkSegments = release.archive.split("/");
var archiveFilename = linkSegments[linkSegments.length - 1]; // Just the filename part of url
var downloadLink = $(".download-latest-link-" + os);
downloadLink
.text(archiveFilename)
.attr("href", releases.base_url + "/" + release.archive);

// We have may other placeholders on the page that want to show the download filename, so
// update them.
$(".download-latest-link-filename-" + os).text(archiveFilename);
}

function updateDownloadLinkFailed(os) {
$(".download-latest-link-" + os).text("(failed)");
}

// Send requests to render the tables.
$(function () {
if ($(".sdk-archives").length) {
fetchFlutterReleases("windows", updateTable, updateTableFailed);
fetchFlutterReleases("macos", updateTable, updateTableFailed);
fetchFlutterReleases("linux", updateTable, updateTableFailed);
}
if ($(".download-latest-link-windows").length)
fetchFlutterReleases("windows", updateDownloadLink, updateDownloadLinkFailed);
if ($(".download-latest-link-macos").length)
fetchFlutterReleases("macos", updateDownloadLink, updateDownloadLinkFailed);
if ($(".download-latest-link-linux").length)
fetchFlutterReleases("linux", updateDownloadLink, updateDownloadLinkFailed);
});