Skip to content

add a bot to test Flutter #1382

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

Merged
merged 2 commits into from
Apr 19, 2017
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
build/
doc/api/
doc/sdk/
doc/
testing/test_package/doc
testing/test_package_small/doc
packages
Expand Down
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ language: dart
sudo: false
dart:
- dev
# Disabled - re-enable once dev goes stable (see #1290).
# - stable
env:
- GEN_SDK_DOCS=true
- GEN_SDK_DOCS=false
- DARTDOC_BOT=main
# TODO(devoncarew): add angulardart support
#- DARTDOC_BOT=angular
- DARTDOC_BOT=flutter
- DARTDOC_BOT=sdk-docs
script: ./tool/travis.sh
branches:
only:
Expand Down
1 change: 1 addition & 0 deletions dartdoc.iml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tool" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/bin/packages" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/doc" />
<excludeFolder url="file://$MODULE_DIR$/example/packages" />
Expand Down
49 changes: 33 additions & 16 deletions tool/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,58 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.

# Fast fail the script on failures.
set -e

pub global activate grinder

pub global activate dart_style
# Fast fail the script on failures, and echo commands as they execute.
set -ex

# add globally activated packages to the path
export PATH="$PATH":"~/.pub-cache/bin"

if [ "$GEN_SDK_DOCS" = "true" ]
then
if [ "$DARTDOC_BOT" = "sdk-docs" ]; then
# Build the SDK docs
# silence stdout but echo stderr
echo ""
echo "Building and validating SDK docs..."
grind validate-sdk-docs

pub run grinder validate-sdk-docs

echo "SDK docs process finished"
elif [ "$DARTDOC_BOT" = "flutter" ]; then
echo "Running flutter dartdoc bot"

# Verify that the libraries are error free.
pub run grinder analyze

# Set up dartdoc so the flutter doc script can locate it.
pub global activate -spath .

# Clone flutter.
rm -rf doc/flutter
git clone --depth 1 https://github.com/flutter/flutter.git doc/flutter

# Build the flutter docs.
cd doc/flutter
./bin/flutter --version
./bin/flutter precache
( cd dev/tools; pub get )
./bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart

# The above script validates the generation; we echo the main file here.
cat dev/docs/doc/index.html
else
echo ""
echo "Skipping SDK docs, because GEN_SDK_DOCS is $GEN_SDK_DOCS"
echo ""
echo "Running main dartdoc bot"

# Verify that the libraries are error free.
grind analyze
pub run grinder analyze

# Run dartdoc on test_package.
(cd testing/test_package; dart -c ../../bin/dartdoc.dart)

# checks the test_package results
grind check-links
# Checks the test_package results.
pub run grinder check-links

# And on test_package_small.
(cd testing/test_package_small; dart -c ../../bin/dartdoc.dart)

# Run the tests.
grind test
pub run grinder test
fi