Saturday, July 25, 2020

Building your Flutter App on Travis CI

It is simple to configure Travis CI Building your Flutter Application on Travis CI. All you have to do is add a build manifest file named .travis.yml which includes the build server instructions. 


Travis CI Yaml Configuration
See Travis CI yaml reference for more options. In the .travis.yml build instructions 3 steps are needed to build a flutter application. 
  1. Use a dart Docker container, "language: dart"
  2. Download Flutter, "git clone ..."
  3. Export the Flutter binary path, "export PATH..."
Example .travis.yml configuration
In this example flutter beta branch is used along with the web configuration.

# File: .travis.yml
# Reference: https://docs.travis-ci.com/user/languages/dart/
language: dart
dart:
  - stable

install:
  # https://flutter.dev/docs/get-started/web
  - echo "Configure Flutter"
  - git clone https://github.com/flutter/flutter.git -b beta
  - export PATH="$PATH:`pwd`/flutter/bin"
  - flutter upgrade
  - flutter config --enable-web
  - flutter doctor

script:
  - flutter build web

  
Example Project
Check out an example project config here which uses Travis CI to build the Flutter web app. 

Trying out the Dart Analysis Server

I wanted to see how the Dart Analysis Server was put together and worked. I started looking to see how I could wire it up and try out the co...