diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh index 1164d23b9f..98dda74495 100755 --- a/dev/bots/docs.sh +++ b/dev/bots/docs.sh @@ -4,14 +4,17 @@ set -e # If you want to run this script locally, make sure you run it from # the root of the flutter repository. +# Make sure dart is installed +bin/flutter --version + # Install dartdoc. -pub global activate dartdoc 0.11.1 +bin/cache/dart-sdk/bin/pub global activate dartdoc 0.11.1 # This script generates a unified doc set, and creates # a custom index.html, placing everything into dev/docs/doc. -(cd dev/tools; pub get) -FLUTTER_ROOT=$PWD dart dev/tools/dartdoc.dart -FLUTTER_ROOT=$PWD dart dev/tools/javadoc.dart +(cd dev/tools; ../../bin/cache/dart-sdk/bin/pub get) +FLUTTER_ROOT=$PWD bin/cache/dart-sdk/bin/dart dev/tools/dartdoc.dart +FLUTTER_ROOT=$PWD bin/cache/dart-sdk/bin/dart dev/tools/javadoc.dart # Ensure google webmaster tools can verify our site. cp dev/docs/google2ed1af765c529f57.html dev/docs/doc diff --git a/dev/tools/dartdoc.dart b/dev/tools/dartdoc.dart index e0ea582a46..b9710a8505 100644 --- a/dev/tools/dartdoc.dart +++ b/dev/tools/dartdoc.dart @@ -19,6 +19,11 @@ const String kDocRoot = 'dev/docs/doc'; /// at the root of docs.flutter.io. We are keeping the files inside of /// docs.flutter.io/flutter for now, so we need to manipulate paths /// a bit. See https://github.com/flutter/flutter/issues/3900 for more info. +/// +/// This will only work on UNIX systems, not Windows. It requires that 'git' be +/// in your path. It requires that 'flutter' has been run previously. It uses +/// the version of Dart downloaded by the 'flutter' tool in this repository and +/// will crash if that is absent. Future main(List args) async { // If we're run from the `tools` dir, set the cwd to the repo root. if (path.basename(Directory.current.path) == 'tools') @@ -50,11 +55,13 @@ dependencies: new File('dev/docs/lib/temp_doc.dart').writeAsStringSync(contents.toString()); // Run pub. - Process process = await Process.start('pub', ['get'], + Process process = await Process.start( + '../../bin/cache/dart-sdk/bin/pub', + ['get'], workingDirectory: 'dev/docs', environment: { - 'FLUTTER_ROOT': Directory.current.path - } + 'FLUTTER_ROOT': Directory.current.path, + }, ); printStream(process.stdout); printStream(process.stderr); @@ -65,8 +72,11 @@ dependencies: createFooter('dev/docs/lib/footer.html'); // Verify which version of dartdoc we're using. - final ProcessResult result = Process.runSync('pub', - ['global', 'run', 'dartdoc', '--version']); + final ProcessResult result = Process.runSync( + '../../bin/cache/dart-sdk/bin/pub', + ['global', 'run', 'dartdoc', '--version'], + workingDirectory: 'dev/docs', + ); print('\n${result.stdout}'); // Generate the documentation. @@ -87,7 +97,11 @@ dependencies: args.add(libraryRef); } - process = await Process.start('pub', args, workingDirectory: 'dev/docs'); + process = await Process.start( + '../../bin/cache/dart-sdk/bin/pub', + args, + workingDirectory: 'dev/docs', + ); printStream(process.stdout); printStream(process.stderr); final int exitCode = await process.exitCode;