Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 52 additions & 42 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ matrix:
- libstdc++6
- fonts-droid
before_script:
- git clone https://github.com/flutter/flutter.git --depth 1
- git clone https://github.com/flutter/flutter.git
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor
- pub global activate flutter_plugin_tools
script:
- ./script/plugin_tools.sh analyze
- ./script/incremental_build.sh analyze
# Job 2) Check format and run tests
- os: linux
env:
Expand All @@ -37,17 +37,18 @@ matrix:
- fonts-droid
- clang-format-5.0
before_script:
- git clone https://github.com/flutter/flutter.git --depth 1
- git clone https://github.com/flutter/flutter.git
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor
- pub global activate flutter_plugin_tools
script:
- ./script/plugin_tools.sh format --travis --clang-format=clang-format-5.0
- ./script/plugin_tools.sh test
# Job 3) Build example APKs
- ./script/incremental_build.sh format --travis --clang-format=clang-format-5.0
- ./script/incremental_build.sh test
# Job 3.1) Build example APKs and run Java tests, shard 1/2
- os: linux
env:
- SHARD=Build-example-APKs
- SHARD="Build example apks 1/2"
- PLUGIN_SHARDING="--shardIndex 0 --shardCount 2"
jdk: oraclejdk8
sudo: false
addons:
Expand All @@ -60,50 +61,59 @@ matrix:
- libstdc++6
- fonts-droid
before_script:
- wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
- mkdir android-sdk
- unzip -qq sdk-tools-linux-3859397.zip -d android-sdk
- ./script/before_build_apks.sh
- export ANDROID_HOME=`pwd`/android-sdk
- export PATH=`pwd`/android-sdk/tools/bin:$PATH
- mkdir -p /home/travis/.android # silence sdkmanager warning
- echo 'count=0' > /home/travis/.android/repositories.cfg # silence sdkmanager warning
- echo y | sdkmanager "tools"
- echo y | sdkmanager "platform-tools"
- echo y | sdkmanager "build-tools;25.0.3"
- echo y | sdkmanager "platforms;android-25"
- echo y | sdkmanager "extras;android;m2repository"
- echo y | sdkmanager "extras;google;m2repository"
- echo y | sdkmanager "patcher;v4"
- sdkmanager --list
- wget http://services.gradle.org/distributions/gradle-3.5-bin.zip
- unzip -qq gradle-3.5-bin.zip
- export GRADLE_HOME=$PWD/gradle-3.5
- export PATH=$GRADLE_HOME/bin:$PATH
- gradle -v
- git clone https://github.com/flutter/flutter.git --depth 1
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor
- pub global activate flutter_plugin_tools
script:
- ./script/plugin_tools.sh build-examples --apk
# Job 4) Build example IPAs
- ./script/incremental_build.sh build-examples --apk
- ./script/incremental_build.sh java-test # must come after apk build
# Job 3.2) Build example APKs and run Java tests, shard 2/2
- os: linux
env:
- SHARD="Build example apks 2/2"
- PLUGIN_SHARDING="--shardIndex 1 --shardCount 2"
jdk: oraclejdk8
sudo: false
addons:
apt:
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
sources:
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
packages:
- lib32stdc++6 # https://github.com/flutter/flutter/issues/6207
- libstdc++6
- fonts-droid
before_script:
- ./script/before_build_apks.sh
- export ANDROID_HOME=`pwd`/android-sdk
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
script:
- ./script/incremental_build.sh build-examples --apk
- ./script/incremental_build.sh java-test # must come after apk build
# Job 4.1) Build example IPAs, shard 1/2
- os: osx
env:
- SHARD=Build-example-IPAs
- SHARD="Build example ipas 1/2"
- PLUGIN_SHARDING="--shardIndex 0 --shardCount 2"
language: generic
osx_image: xcode8.3
osx_image: xcode9.3
before_script:
- pip install six
- brew update
- brew install --HEAD libimobiledevice
- brew install ideviceinstaller
- brew install ios-deploy
- git clone https://github.com/flutter/flutter.git --depth 1
- ./script/before_build_ipas.sh
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
script:
- ./script/incremental_build.sh build-examples --ipa
# Job 4.2) Build example IPAs, shard 2/2
- os: osx
env:
- SHARD="Build example ipas 2/2"
- PLUGIN_SHARDING="--shardIndex 1 --shardCount 2"
language: generic
osx_image: xcode9.3
before_script:
- ./script/before_build_ipas.sh
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor
- pub global activate flutter_plugin_tools
script:
- ./script/plugin_tools.sh build-examples --ipa
- ./script/incremental_build.sh build-examples --ipa

cache:
directories:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Flutter plugins

[![Build Status](https://travis-ci.org/google/flutter.plugins.svg?branch=master)](https://travis-ci.org/google/flutter.plugins)
[![Build Status](https://api.cirrus-ci.com/github/google/flutter.plugins.svg)](https://cirrus-ci.com/github/google/flutter.plugins)

This repository contains the source code for Flutter plugins that are
developed by Google but not by the core Flutter team.
Expand Down
26 changes: 26 additions & 0 deletions script/before_build_apks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
mkdir android-sdk
unzip -qq sdk-tools-linux-3859397.zip -d android-sdk
export ANDROID_HOME=`pwd`/android-sdk
export PATH=`pwd`/android-sdk/tools/bin:$PATH
mkdir -p /home/travis/.android # silence sdkmanager warning
echo 'count=0' > /home/travis/.android/repositories.cfg # silence sdkmanager warning
# suppressing output of sdkmanager to keep log under 4MB (travis limit)
echo y | sdkmanager "tools" >/dev/null
echo y | sdkmanager "platform-tools" >/dev/null
echo y | sdkmanager "build-tools;26.0.3" >/dev/null
echo y | sdkmanager "platforms;android-26" >/dev/null
echo y | sdkmanager "extras;android;m2repository" >/dev/null
echo y | sdkmanager "extras;google;m2repository" >/dev/null
echo y | sdkmanager "patcher;v4" >/dev/null
sdkmanager --list
wget http://services.gradle.org/distributions/gradle-4.1-bin.zip
unzip -qq gradle-4.1-bin.zip
export GRADLE_HOME=$PWD/gradle-4.1
export PATH=$GRADLE_HOME/bin:$PATH
gradle -v
git clone https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
flutter doctor
pub global activate flutter_plugin_tools
11 changes: 11 additions & 0 deletions script/before_build_ipas.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
brew update
brew install libimobiledevice
brew install ideviceinstaller
brew install ios-deploy
pod repo update
gem update cocoapods
git clone https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
flutter doctor
pub global activate flutter_plugin_tools
35 changes: 35 additions & 0 deletions script/incremental_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

set -ev

BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)

if [ "${BRANCH_NAME}" = "master" ]; then
echo "Running for all packages"
pub global run flutter_plugin_tools "$@" $PLUGIN_SHARDING
else
# Make sure there is up-to-date master.
git fetch origin master

FLUTTER_CHANGED_GLOBAL=0
FLUTTER_CHANGED_PACKAGES=""

# Try get a merge base for the branch and calculate affected packages.
# We need this check because some CIs can do a single branch clones with a limited history of commits.
if BRANCH_BASE_SHA=$(git merge-base --fork-point FETCH_HEAD HEAD); then
echo "Checking changes from $BRANCH_BASE_SHA..."
FLUTTER_CHANGED_GLOBAL=`git diff --name-only $BRANCH_BASE_SHA HEAD | grep -v packages | wc -l`
FLUTTER_CHANGED_PACKAGES=`git diff --name-only $BRANCH_BASE_SHA HEAD | grep -o "packages/[^/]*" | sed -e "s/packages\///g" | sort | uniq | paste -s -d, -`
else
echo "Cannot find a merge base for the current branch to run an incremental build..."
echo "Please rebase your branch onto the latest master!"
fi

if [ "${FLUTTER_CHANGED_PACKAGES}" = "" ] || [ $FLUTTER_CHANGED_GLOBAL -gt 0 ]; then
echo "Running for all packages"
pub global run flutter_plugin_tools "$@" $PLUGIN_SHARDING
else
echo "Running only for $FLUTTER_CHANGED_PACKAGES"
pub global run flutter_plugin_tools "$@" --plugins=$FLUTTER_CHANGED_PACKAGES
fi
fi