diff --git a/.travis.yml b/.travis.yml index 69cb8522a83d..9600935b1610 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,10 +44,11 @@ matrix: script: - ./script/plugin_tools.sh format --travis --clang-format=clang-format-5.0 - ./script/plugin_tools.sh test - # Job 3) Build example APKs and run Java tests + # Job 3.1) Build example APKs and run Java tests, shard 1/2 - os: linux env: - - SHARD=Build-example-APKs+Java-Tests + - SHARD="Build example apks 1/2" + - PLUGIN_SHARDING="--shardIndex 0 --shardCount 2" jdk: oraclejdk8 sudo: false addons: @@ -60,51 +61,57 @@ 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 - # 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 script: - ./script/plugin_tools.sh build-examples --apk - ./script/plugin_tools.sh java-test # must come after apk build - # Job 4) Build example IPAs + # 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/plugin_tools.sh build-examples --apk + - ./script/plugin_tools.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: xcode9.3 before_script: - - 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 + - ./script/before_build_ipas.sh + - export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH + script: + - ./script/plugin_tools.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 diff --git a/script/before_build_apks.sh b/script/before_build_apks.sh new file mode 100755 index 000000000000..145e05653876 --- /dev/null +++ b/script/before_build_apks.sh @@ -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 diff --git a/script/before_build_ipas.sh b/script/before_build_ipas.sh new file mode 100755 index 000000000000..93ffb37d7612 --- /dev/null +++ b/script/before_build_ipas.sh @@ -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 diff --git a/script/plugin_tools.sh b/script/plugin_tools.sh index c2a3a0a49db7..3edbb89d2f85 100755 --- a/script/plugin_tools.sh +++ b/script/plugin_tools.sh @@ -2,14 +2,14 @@ set -ev if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then - echo "Running for all packages" - pub global run flutter_plugin_tools "$@" + echo "Running for all packages ($PLUGIN_SHARDING)" + pub global run flutter_plugin_tools "$@" $PLUGIN_SHARDING else FLUTTER_CHANGED_GLOBAL=`git diff --name-only $TRAVIS_COMMIT_RANGE | grep -v packages | wc -l` FLUTTER_CHANGED_PACKAGES=`git diff --name-only $TRAVIS_COMMIT_RANGE | grep -o "packages/[^/]*" | sed -e "s/packages\///g" | sort | uniq | paste -s -d, -` if [ "${FLUTTER_CHANGED_PACKAGES}" = "" ] || [ $FLUTTER_CHANGED_GLOBAL -gt 0 ]; then - echo "Running for all packages" - pub global run flutter_plugin_tools "$@" + echo "Running for all packages ($PLUGIN_SHARDING)" + 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