2016-05-02 21:33:39 +00:00
|
|
|
#!/bin/bash
|
2016-07-12 19:53:47 +00:00
|
|
|
set -e
|
2016-05-02 21:33:39 +00:00
|
|
|
|
2017-05-06 22:08:14 +00:00
|
|
|
# If you want to run this script locally, make sure you run it from
|
|
|
|
# the root of the flutter repository.
|
|
|
|
|
2017-09-13 22:26:41 +00:00
|
|
|
# This is called from travis_upload.sh on Travis.
|
|
|
|
|
2017-05-11 16:42:08 +00:00
|
|
|
# Make sure dart is installed
|
|
|
|
bin/flutter --version
|
|
|
|
|
2016-05-02 21:33:39 +00:00
|
|
|
# Install dartdoc.
|
2017-10-05 18:26:49 +00:00
|
|
|
bin/cache/dart-sdk/bin/pub global activate dartdoc 0.14.1
|
2016-05-16 15:28:58 +00:00
|
|
|
|
|
|
|
# This script generates a unified doc set, and creates
|
2017-05-06 22:08:14 +00:00
|
|
|
# a custom index.html, placing everything into dev/docs/doc.
|
2017-05-11 16:42:08 +00:00
|
|
|
(cd dev/tools; ../../bin/cache/dart-sdk/bin/pub get)
|
2017-12-05 20:51:18 +00:00
|
|
|
FLUTTER_ROOT=$PWD bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart
|
|
|
|
FLUTTER_ROOT=$PWD bin/cache/dart-sdk/bin/dart dev/tools/java_and_objc_doc.dart
|
2016-05-02 21:33:39 +00:00
|
|
|
|
2016-05-16 15:28:58 +00:00
|
|
|
# Ensure google webmaster tools can verify our site.
|
|
|
|
cp dev/docs/google2ed1af765c529f57.html dev/docs/doc
|
2016-05-13 19:27:06 +00:00
|
|
|
|
2017-06-14 23:29:18 +00:00
|
|
|
# Upload new API docs when on Travis
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
|
|
|
if [ "$TRAVIS_BRANCH" == "master" -o "$TRAVIS_BRANCH" == "alpha" ]; then
|
|
|
|
cd dev/docs
|
|
|
|
|
|
|
|
if [ "$TRAVIS_BRANCH" == "master" ]; then
|
|
|
|
echo -e "User-agent: *\nDisallow: /" > doc/robots.txt
|
2017-09-13 22:26:41 +00:00
|
|
|
while : ; do
|
|
|
|
firebase deploy --project master-docs-flutter-io && break
|
|
|
|
echo Error: Unable to deploy documentation to firebase. Retrying in five seconds...
|
|
|
|
sleep 5
|
|
|
|
done
|
2017-06-14 23:29:18 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$TRAVIS_BRANCH" == "alpha" ]; then
|
2017-09-13 22:26:41 +00:00
|
|
|
while : ; do
|
|
|
|
firebase deploy --project docs-flutter-io && break
|
|
|
|
echo Error: Unable to deploy documentation to firebase. Retrying in five seconds...
|
|
|
|
sleep 5
|
|
|
|
done
|
2017-06-14 23:29:18 +00:00
|
|
|
fi
|
2017-04-24 16:14:44 +00:00
|
|
|
fi
|
2016-09-23 03:39:35 +00:00
|
|
|
fi
|