chore(gulp/travis): don't build Dart docs (#2931)
* chore(gulp/travis): don't build Dart docs * firebase: ignore docs/dart on deploy
This commit is contained in:
parent
695df67929
commit
e96cc7689f
|
@ -105,7 +105,8 @@
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"firebase.json",
|
"firebase.json",
|
||||||
"**/.*",
|
"**/.*",
|
||||||
"**/node_modules/**"
|
"**/node_modules/**",
|
||||||
|
"docs/dart/**"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -128,7 +128,7 @@ function configLangs(langOption) {
|
||||||
const fullSiteBuildTasks = ['build-compile', 'check-deploy', 'harp-compile'];
|
const fullSiteBuildTasks = ['build-compile', 'check-deploy', 'harp-compile'];
|
||||||
const buildAllDocs = argv['_'] &&
|
const buildAllDocs = argv['_'] &&
|
||||||
fullSiteBuildTasks.some((task) => argv['_'].indexOf(task) >= 0);
|
fullSiteBuildTasks.some((task) => argv['_'].indexOf(task) >= 0);
|
||||||
const langDefault = buildAllDocs ? 'all' : 'ts|js';
|
const langDefault = /*buildAllDocs ? 'all' :*/ 'ts|js';
|
||||||
if (langOption === '') {
|
if (langOption === '') {
|
||||||
lang = '';
|
lang = '';
|
||||||
langs = [];
|
langs = [];
|
||||||
|
@ -914,7 +914,7 @@ function harpCompile() {
|
||||||
|
|
||||||
if(skipLangs && fs.existsSync(WWW) && backupApiHtmlFilesExist(WWW)) {
|
if(skipLangs && fs.existsSync(WWW) && backupApiHtmlFilesExist(WWW)) {
|
||||||
gutil.log(`Harp site recompile: skipping recompilation of API docs for [${skipLangs}]`);
|
gutil.log(`Harp site recompile: skipping recompilation of API docs for [${skipLangs}]`);
|
||||||
gutil.log(`API docs will be copied from existing ${WWW} folder.`)
|
gutil.log(`API docs will be copied from existing ${WWW} folder (if they exist).`)
|
||||||
del.sync(`${WWW}-backup`); // remove existing backup if it exists
|
del.sync(`${WWW}-backup`); // remove existing backup if it exists
|
||||||
renameIfExistsSync(WWW, `${WWW}-backup`);
|
renameIfExistsSync(WWW, `${WWW}-backup`);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1069,7 +1069,7 @@ function restoreApiHtml() {
|
||||||
const relApiDir = path.join('docs', lang, vers, 'api');
|
const relApiDir = path.join('docs', lang, vers, 'api');
|
||||||
const apiSubdir = path.join(WWW, relApiDir);
|
const apiSubdir = path.join(WWW, relApiDir);
|
||||||
const backupApiSubdir = path.join(`${WWW}-backup`, relApiDir);
|
const backupApiSubdir = path.join(`${WWW}-backup`, relApiDir);
|
||||||
if (fs.existsSync(backupApiSubdir) || argv.forceSkipApi !== true) {
|
if (fs.existsSync(backupApiSubdir)) {
|
||||||
gutil.log(`cp ${backupApiSubdir} ${apiSubdir}`)
|
gutil.log(`cp ${backupApiSubdir} ${apiSubdir}`)
|
||||||
fs.copySync(backupApiSubdir, apiSubdir);
|
fs.copySync(backupApiSubdir, apiSubdir);
|
||||||
}
|
}
|
||||||
|
@ -1081,6 +1081,7 @@ function backupApiHtmlFilesExist(folderName) {
|
||||||
const vers = 'latest';
|
const vers = 'latest';
|
||||||
var result = 1;
|
var result = 1;
|
||||||
skipLangs.forEach(lang => {
|
skipLangs.forEach(lang => {
|
||||||
|
if (lang === 'dart') return true;
|
||||||
const relApiDir = path.join('docs', lang, vers, 'api');
|
const relApiDir = path.join('docs', lang, vers, 'api');
|
||||||
const backupApiSubdir = path.join(folderName, relApiDir);
|
const backupApiSubdir = path.join(folderName, relApiDir);
|
||||||
if (!fs.existsSync(backupApiSubdir)) {
|
if (!fs.existsSync(backupApiSubdir)) {
|
||||||
|
|
|
@ -16,13 +16,5 @@ else
|
||||||
travis_fold end install.ng2
|
travis_fold end install.ng2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -e "$NG2DART_REPO" ]]; then
|
|
||||||
echo Angular2 Dart repo is already present at: $NG2DART_REPO
|
|
||||||
elif [[ -n "$TRAVIS" ]]; then
|
|
||||||
./scripts/install-ng2dart.sh
|
|
||||||
# else
|
|
||||||
# echo WARNING: no Angular2 Dart repo found at: $NG2DART_REPO
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo INSTALLED repos:
|
echo INSTALLED repos:
|
||||||
ls -ld ../a*
|
ls -ld ../a*
|
||||||
|
|
|
@ -1,68 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e -o pipefail
|
|
||||||
|
|
||||||
[[ -z "$NGIO_ENV_DEFS" ]] && . ./scripts/env-set.sh
|
|
||||||
|
|
||||||
if [[ -z "$(type -t dart)" ]]; then
|
|
||||||
travis_fold start install.dart
|
|
||||||
echo INSTALLING Dart SDK and Dartium ...
|
|
||||||
|
|
||||||
# URLs for sdk and dartium:
|
|
||||||
# https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip
|
|
||||||
# https://storage.googleapis.com/dart-archive/channels/stable/release/latest/dartium/dartium-macos-x64-release.zip
|
|
||||||
|
|
||||||
DART_ARCHIVE=https://storage.googleapis.com/dart-archive/channels
|
|
||||||
VERS=stable/release/latest
|
|
||||||
# VERS=stable/release/1.18.1 # If necessary, pin a specific version like this
|
|
||||||
|
|
||||||
mkUrl() {
|
|
||||||
local dir=$1
|
|
||||||
local pkg=$2
|
|
||||||
local arch=$3
|
|
||||||
local zip=$pkg-$_OS_NAME-$arch-release.zip
|
|
||||||
echo "$DART_ARCHIVE/$VERS/$dir/$zip";
|
|
||||||
}
|
|
||||||
|
|
||||||
getAndInstall() {
|
|
||||||
local dir=$1
|
|
||||||
local pkg=${2:-$dir};
|
|
||||||
local arch=${3:-x64}
|
|
||||||
local URL=$(mkUrl $dir $pkg $arch)
|
|
||||||
local exitStatus=0;
|
|
||||||
local zip=$(basename $URL)
|
|
||||||
|
|
||||||
echo "Getting $pkg from:"
|
|
||||||
echo " $URL"
|
|
||||||
|
|
||||||
[[ ! -d "$TMP" ]] && mkdir "$TMP"
|
|
||||||
[[ ! -d "$PKG" ]] && mkdir "$PKG"
|
|
||||||
|
|
||||||
curl $URL > "$TMP/$zip" # 2> /dev/null
|
|
||||||
|
|
||||||
if [[ "1000" -lt "$(wc -c $TMP/$zip | awk '{print $1}')" ]]; then
|
|
||||||
unzip "$TMP/$zip" -d "$PKG" > /dev/null
|
|
||||||
rm -f "$TMP/$zip"
|
|
||||||
# PATH is set in ./scripts/env-set.sh
|
|
||||||
else
|
|
||||||
echo FAILED to download Dart $pkg. Check URL.
|
|
||||||
exitStatus=1;
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if getAndInstall sdk dartsdk; then
|
|
||||||
# Install Dartium
|
|
||||||
if [[ "$_OS_NAME" == "macos" ]]; then
|
|
||||||
getAndInstall dartium dartium ia32
|
|
||||||
else
|
|
||||||
getAndInstall dartium
|
|
||||||
fi
|
|
||||||
echo
|
|
||||||
dart --version
|
|
||||||
fi
|
|
||||||
travis_fold end install.dart
|
|
||||||
else
|
|
||||||
echo Dart SDK appears to be installed: `type dart`
|
|
||||||
# PATH is set in ./scripts/env-set.sh
|
|
||||||
dart --version
|
|
||||||
fi
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e -o pipefail
|
|
||||||
|
|
||||||
[[ -z "$NGIO_ENV_DEFS" ]] && . ./scripts/env-set.sh
|
|
||||||
|
|
||||||
./scripts/install-dart-sdk.sh
|
|
||||||
|
|
||||||
travis_fold start install.ng2dart
|
|
||||||
if [[ -z "$(type -t dart)" ]]; then
|
|
||||||
echo "No Dart SDK: aborting install of Angular2/Dart"
|
|
||||||
exit 1;
|
|
||||||
elif [[ -e "$NG2DART_REPO" ]]; then
|
|
||||||
echo Angular2/Dart found at: $NG2DART_REPO
|
|
||||||
else
|
|
||||||
echo GETTING Angular2/Dart from pub package ...
|
|
||||||
set -x
|
|
||||||
# Get ng2dart via pub on ng.io pubspec.yaml
|
|
||||||
pub upgrade > /dev/null
|
|
||||||
|
|
||||||
NG2DART_PUB=`find ~/.pub-cache/ -type d -name "angular2*" | xargs ls -dtr | tail -1`
|
|
||||||
|
|
||||||
cp -r $NG2DART_PUB $NG2DART_REPO
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run pub on ng2dart
|
|
||||||
(cd $NG2DART_REPO && pub get)
|
|
||||||
set +x
|
|
||||||
travis_fold end install.ng2dart
|
|
Loading…
Reference in New Issue