GithubHelp home page GithubHelp logo

kuhnroyal / fvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leoafarias/fvm

0.0 2.0 0.0 3.65 MB

Flutter Version Management: A simple cli to manage Flutter SDK versions per project

License: MIT License

Dart 100.00%

fvm's Introduction

fvm

Pub Version Likes Health Coverage Github All Contributors MIT Licence Awesome Flutter

Flutter Version Management: A simple cli to manage Flutter SDK versions.

FVM helps with the need for a consistent app builds by allowing to reference Flutter SDK version used on a per-project basis. It also allows you to have multiple Flutter versions installed to quickly validate and test upcoming Flutter releases with your apps, without waiting for Flutter installation every time.

Features:

  • Configure and use Flutter SDK version per project
  • Ability to install and cache multiple Flutter SDK Versions
  • Fast switch between Flutter channels & versions
  • Dynamic SDK paths for IDE debugging support.
  • Version FVM config with a project for consistency across teams and CI environments.
  • Set global Flutter version across projects

Version Management

This tool allows you to manage multiple channels and releases, and caches these versions locally, so you don't have to wait for a full setup every time you want to switch versions.

Also, it allows you to grab versions by a specific release, i.e. v1.2.0 or 1.17.0-dev.3.1. In case you have projects in different Flutter SDK versions and do not want to upgrade.

Usage

To Install:

> pub global activate fvm

Read dart.dev docs for more info on how to run global dart scripts.

And then, for information on each command:

> fvm help

Install a SDK Version

FVM gives you the ability to install many Flutter releases or channels.

  • version - use stable to install the Stable channel and v1.8.0 or 1.17.0-dev.3.1 to install the release.
  • --skip-setup - will skip Flutter setup after install
> fvm install <version>

Project Config SDK Version

If you configured your project to use a specific version, run install without any arguments will install the proper version.

> fvm install

Check out use command to see how to configure a version per project.

Use a SDK Version

You can use different Flutter SDK versions per project. To do that you have to go into the root of the project and:

> fvm use <version>

Set Global Version

If you want to use a specific version by default in your machine, you can specify the flag --global to the use command. A symbolic link to the Flutter version will be created in the fvm home folder, which you could then add to your PATH environment variable as follows: FVM_HOME/default/bin. Use fvm use --help, this will give you the exact path you need to configure.

> fvm use <version> --global

Force Flag

Fvm only allows to call the use command on Flutter projects. However if you want to call the use command on a non-flutter directory use the --force flag.

If you are starting a new project and plan on using fvm flutter create you wil have to use the --force flag

> fvm use <version> --force

Remove a SDK Version

Using the remove command will uninstall the SDK version locally, this will impact any projects that depend on that version of the SDK.

> fvm remove <version>

List Installed Versions

List all the versions that are installed on your machine. This command will also output where FVM stores the SDK versions.

> fvm list

List Flutter Releases

Displays all Flutter releases, including the current version for dev, beta and stable channels.

> fvm releases

Change FVM Cache Directory

You are able to configure the fvm cache directory by setting FVM_HOME environment variable. If nothing is set the default fvm path will be used.

Running Flutter SDK

There are a couple of ways you can interact with the SDK setup in your project.

Proxy Commands

Flutter command within fvm proxies all calls to the CLI just changing the SDK to be the local one.

> fvm flutter run

This will run flutter run command using the local project SDK. If no FVM config is found in the project. FMV will recursively try for a version in a parent directory.

Call Local SDK Directly

FVM creates a symbolic link within your project called fvm which links to the installed version of the SDK.

> .fvm/flutter/bin run

This will run flutter run command using the local project SDK.

As an example calling fvm flutter run is the equivalent of calling flutter run using the local project SDK.

Configure Your IDE

In some situations you might have to restart your IDE and the Flutter debugger to make sure it uses the new version.

VSCode

Add the following to your settings.json. This will list list all Flutter SDKs installed when using VSCode when using Flutter: Change SDK.

Use fvm list to show you the path to the versions.

List all versions installd by FVM
{
  "dart.flutterSdkPaths": ["/Users/usr/fvm/versions"]
}
You can also add the version symlink for dynamic switch
{
  "dart.flutterSdkPaths": [".fvm/flutter_sdk"]
}

Android Studio

Copy the absolute path of fvm symbolic link in your root project directory. Example: /absolute/path-to-your-project/.fvm/flutter_sdk

In the Android Studio menu open Languages & Frameworks -> Flutter or search for Flutter and change Flutter SDK path. Apply the changes. You now can Run and Debug with the selected versions of Flutter.

Add your IDE instructions here

Working with this repo

Tests

pub run test

Publishing package

Before pushing package to pub.dev. Run command to create version constant.

pub run build_runner build

Update test coverage

To update test coverage run the following command.

pub run test_coverage

License

This project is licensed under the MIT License - see the LICENSE file for details

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Leo Farias

๐Ÿ“– ๐Ÿค” ๐Ÿ’ป ๐Ÿ’ก ๐Ÿ‘€ ๐Ÿšง ๐Ÿš‡

Ianko Leite

๐Ÿค”

Caijinglong

๐Ÿ’ป ๐Ÿค”

zmtzawqlp

๐Ÿ›

Peter Leibiger

๐Ÿ’ป ๐Ÿšง

Luca Panteghini

๐Ÿ“–

David Martos

๐Ÿ’ป โš ๏ธ ๐Ÿ“–

Sven Jacobs

๐Ÿ’ป

Wolfhard Prell

๐Ÿ’ป

Jaspreet Singh

๐Ÿค”

This project follows the all-contributors specification. Contributions of any kind welcome!

fvm's People

Contributors

allcontributors[bot] avatar caijinglong avatar cir0x avatar davidmartos96 avatar kuhnroyal avatar leoafarias avatar svenjacobs avatar zmtzawqlp avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.