Chromium Code Reviews| Index: sdk/lib/_internal/dartdoc/bin/dartdoc.dart |
| diff --git a/sdk/lib/_internal/dartdoc/bin/dartdoc.dart b/sdk/lib/_internal/dartdoc/bin/dartdoc.dart |
| index d9fe3d9024527c7ba62191e6e650ab45227a0896..dd81d07688d2e0f30392ada3654b759a37dce98b 100644 |
| --- a/sdk/lib/_internal/dartdoc/bin/dartdoc.dart |
| +++ b/sdk/lib/_internal/dartdoc/bin/dartdoc.dart |
| @@ -29,10 +29,18 @@ import 'package:pathos/path.dart' as path; |
| * Run this from the `lib/_internal/dartdoc` directory. |
| */ |
| main() { |
| + mainWithOptions(new Options()); |
| +} |
| + |
| +/** |
| + * We use this to include dartdoc in a single snapshot with dart2js. |
| + * (They share 90% of the code) |
| + */ |
| +mainWithOptions(Options options) { |
|
nweiz
2013/06/04 22:54:00
Why not just have the snapshot call main()? "new O
Andrei Mouravski
2013/06/05 00:18:49
Because the snapshot actually calls this with diff
|
| // Need this because ArgParser.getUsage doesn't show command invocation. |
| final USAGE = 'Usage dartdoc [options] <entrypoint(s)>\n[options] include:'; |
| - final args = new Options().arguments; |
| + final args = options.arguments; |
| final dartdoc = new Dartdoc(); |
| @@ -240,8 +248,8 @@ main() { |
| // TODO(amouravski): move compileScript out and pre-generate the client |
| // scripts. This takes a long time and the js hardly ever changes. |
| .then((_) => compileScript(dartdoc.mode, dartdoc.outputDir, libPath)) |
| - .then((_) => copyDirectory(scriptDir.append('../static'), |
| - dartdoc.outputDir)) |
| + .then((_) => copyDirectory(libPath.append('lib/_internal/dartdoc/static'), |
|
nweiz
2013/06/04 22:54:00
libPath and scriptPath seem very brittle. It's not
Andrei Mouravski
2013/06/05 00:18:49
I agree, and this will be fixed in a new CL.
|
| + dartdoc.outputDir)) |
| .then((_) { |
| print(dartdoc.status); |
| if (dartdoc.totals == 0) { |