Version 1.12.0-dev.5.6

Cherry-pick 55a94d14ea79839f099a38914345e7746a98e839 to dev
Cherry-pick 3865dd87482bd54b8d33ba36b89d93943f82b3ba to dev
Cherry-pick e11ce8ba87952ee2efeb7ed8211801f6cb6d9c9d to dev
Cherry-pick 44f890b3c8a5963f348f771c1bd4ff656e7a466e to dev
Cherry-pick 43e6b8b8dba3138aa2dbe0eaa45bda7fd1e5927d to dev
Cherry-pick 98e67aa065809ded6e27cb27d3a46b06b77e90c2 to dev
Cherry-pick 4b80cfd69eaf98906f91e4d70894218a0121e05d to dev
Cherry-pick 5fa70c4220fb70fb20f2010fcb1c7466aa1fc71c to dev
Cherry-pick 6c7093dd1900e56dc325aada12a22cd5af9e3ca9 to dev
Cherry-pick f8f06d784ad1c9e67cbdb5e25eb08d0c62ca8d8c to dev
Cherry-pick 2d38e15b82243259573a8ff15f5d1736563e4f71 to dev
Cherry-pick e3963b88d1a58c2823d57d5cae13bf6d6eec9e3c to dev
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ddd2509..47feb31c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,10 @@
   * Change stdout/stderr to binary mode on Windows.
     [4205b29](https://github.com/dart-lang/sdk/commit/4205b2997e01f2cea8e2f44c6f46ed6259ab7277)
 
+* `dart:isolate`
+  * Added `onError`, `onExit` and `errorsAreFatal` parameters to
+    `Isolate.spawnUri`.
+
 ### Tool changes
 
 * Pub
diff --git a/DEPS b/DEPS
index c1077da9..80d6294 100644
--- a/DEPS
+++ b/DEPS
@@ -49,7 +49,7 @@
   "collection_rev": "@1da9a07f32efa2ba0c391b289e2037391e31da0e",
   "crypto_rev" : "@2df57a1e26dd88e8d0614207d4b062c73209917d",
   "csslib_tag" : "@0.12.0",
-  "dartdoc_tag" : "@v0.5.0",
+  "dartdoc_tag" : "@v0.5.0+3",
   "dart_services_rev" : "@7aea2574e6f3924bf409a80afb8ad52aa2be4f97",
   "dart_style_tag": "@0.2.0",
   "dev_compiler_rev": "@0.1.3",
@@ -78,13 +78,13 @@
   "oauth2_rev": "@1bff41f4d54505c36f2d1a001b83b8b745c452f5",
   "observe_rev": "@eee2b8ec34236fa46982575fbccff84f61202ac6",
   "observatory_pub_packages_rev": "@cdc4b3d4c15b9c0c8e7702dff127b440afbb7485",
-  "package_config_tag": "@0.1.1",
+  "package_config_rev": "@0.1.3",
   "path_tag": "@1.3.6",
   "petitparser_rev" : "@37878",
   "ply_rev": "@604b32590ffad5cbb82e4afef1d305512d06ae93",
   "plugin_tag": "@0.1.0",
   "pool_rev": "@e454b4b54d2987e8d2f0fbd3ac519641ada9bd0f",
-  "pub_rev": "@4cc9aa3e6fd29c70b0929f3a827030b8a2ce0c7f",
+  "pub_rev": "@d90268693d1a9dbe5ea11cd9c80b842e3bf1581c",
   "pub_cache_tag": "@v0.1.0",
   "pub_semver_tag": "@1.2.1",
   "quiver_tag": "@0.21.4",
diff --git a/create_sdk.gyp b/create_sdk.gyp
index 232009c..769f502 100644
--- a/create_sdk.gyp
+++ b/create_sdk.gyp
@@ -12,6 +12,7 @@
         'utils/compiler/compiler.gyp:dart2js',
         'utils/pub/pub.gyp:pub',
         'utils/dartfmt/dartfmt.gyp:dartfmt',
+        'utils/dartdoc/dartdoc.gyp:dartdoc',
         'utils/analysis_server/analysis_server.gyp:analysis_server',
         'utils/dartanalyzer/dartanalyzer.gyp:dartanalyzer',
       ],
@@ -38,6 +39,7 @@
             '<(SHARED_INTERMEDIATE_DIR)/dartanalyzer.dart.snapshot',
             '<(SHARED_INTERMEDIATE_DIR)/dartfmt.dart.snapshot',
             '<(SHARED_INTERMEDIATE_DIR)/analysis_server.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot',
             'tools/VERSION'
           ],
           'outputs': [
diff --git a/pkg/analyzer/lib/src/generated/utilities_dart.dart b/pkg/analyzer/lib/src/generated/utilities_dart.dart
index cd9753c..888cc11 100644
--- a/pkg/analyzer/lib/src/generated/utilities_dart.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_dart.dart
@@ -10,6 +10,34 @@
 import 'java_core.dart';
 
 /**
+ * Check whether [uri1] starts with (or 'is prefixed by') [uri2] by checking
+ * path segments.
+ */
+bool startsWith(Uri uri1, Uri uri2) {
+  List<String> uri1Segments = uri1.pathSegments;
+  List<String> uri2Segments = uri2.pathSegments.toList();
+  // Punt if empty (https://github.com/dart-lang/sdk/issues/24126)
+  if (uri2Segments.isEmpty) {
+    return false;
+  }
+  // Trim trailing empty segments ('/foo/' => ['foo', ''])
+  if (uri2Segments.last == '') {
+    uri2Segments.removeLast();
+  }
+
+  if (uri2Segments.length > uri1Segments.length) {
+    return false;
+  }
+
+  for (int i = 0; i < uri2Segments.length; ++i) {
+    if (uri2Segments[i] != uri1Segments[i]) {
+      return false;
+    }
+  }
+  return true;
+}
+
+/**
  * The enumeration `ParameterKind` defines the different kinds of parameters. There are two
  * basic kinds of parameters: required and optional. Optional parameters are further divided into
  * two kinds: positional optional and named optional.
@@ -38,27 +66,3 @@
   const ParameterKind(String name, int ordinal, this.isOptional)
       : super(name, ordinal);
 }
-
-/**
- * Check whether [uri1] starts with (or 'is prefixed by') [uri2] by checking
- * path segments.
- */
-bool startsWith(Uri uri1, Uri uri2) {
-  List<String> uri1Segments = uri1.pathSegments;
-  List<String> uri2Segments = uri2.pathSegments.toList();
-  // Trim trailing empty segments ('/foo/' => ['foo', ''])
-  if (uri2Segments.last == '') {
-    uri2Segments.removeLast();
-  }
-
-  if (uri2Segments.length > uri1Segments.length) {
-    return false;
-  }
-
-  for (int i = 0; i < uri2Segments.length; ++i) {
-    if (uri2Segments[i] != uri1Segments[i]) {
-      return false;
-    }
-  }
-  return true;
-}
diff --git a/pkg/analyzer/test/generated/source_factory_test.dart b/pkg/analyzer/test/generated/source_factory_test.dart
index 36ec73e..b3788b4 100644
--- a/pkg/analyzer/test/generated/source_factory_test.dart
+++ b/pkg/analyzer/test/generated/source_factory_test.dart
@@ -171,6 +171,9 @@
             isTrue);
         expect(utils.startsWith(Uri.parse('/foo/bar'), Uri.parse('/foo/b')),
             isFalse);
+        // Handle odd URIs (https://github.com/dart-lang/sdk/issues/24126)
+        expect(utils.startsWith(Uri.parse('/foo/bar'), Uri.parse('')), isFalse);
+        expect(utils.startsWith(Uri.parse(''), Uri.parse('/foo/bar')), isFalse);
       });
     });
   });
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 123938d..6c2f9c0 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -379,8 +379,19 @@
         if (packageConfigContents is String) {
           packageConfigContents = UTF8.encode(packageConfigContents);
         }
+        // The input provider may put a trailing 0 byte when it reads a source
+        // file, which confuses the package config parser.
+        if (packageConfigContents.length > 0 &&
+            packageConfigContents.last == 0) {
+          packageConfigContents = packageConfigContents.sublist(
+              0, packageConfigContents.length - 1);
+        }
         packages =
             new MapPackages(pkgs.parse(packageConfigContents, packageConfig));
+      }).catchError((error) {
+        reportError(NO_LOCATION_SPANNABLE, MessageKind.INVALID_PACKAGE_CONFIG,
+            {'uri': packageConfig, 'exception': error});
+        packages = Packages.noPackages;
       });
     } else {
       if (packagesDiscoveryProvider == null) {
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index 72c40ab..a2f98b7 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -66,9 +66,9 @@
   return m[2];
 }
 
-String extractPath(String argument) {
+String extractPath(String argument, {bool isDirectory: true}) {
   String path = nativeToUriPath(extractParameter(argument));
-  return path.endsWith("/") ? path : "$path/";
+  return !path.endsWith("/") && isDirectory ? "$path/" : path;
 }
 
 void parseCommandLine(List<OptionHandler> handlers, List<String> argv) {
@@ -143,7 +143,8 @@
   }
 
   setPackageConfig(String argument) {
-    packageConfig = currentDirectory.resolve(extractPath(argument));
+    packageConfig =
+        currentDirectory.resolve(extractPath(argument, isDirectory: false));
   }
 
   setOutput(Iterator<String> arguments) {
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index 5e5d603..6108da1 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -252,6 +252,7 @@
   INVALID_OVERRIDE_METHOD,
   INVALID_OVERRIDE_SETTER,
   INVALID_OVERRIDE_SETTER_WITH_FIELD,
+  INVALID_PACKAGE_CONFIG,
   INVALID_PACKAGE_URI,
   INVALID_PARAMETER,
   INVALID_RECEIVER_IN_INITIALIZER,
@@ -2224,6 +2225,13 @@
 main() {}
 """]),
 
+      MessageKind.INVALID_PACKAGE_CONFIG:
+          const MessageTemplate(MessageKind.INVALID_PACKAGE_CONFIG,
+            """Package config file '#{uri}' is invalid.
+#{exception}""",
+            howToFix: DONT_KNOW_HOW_TO_FIX
+      ),
+
       MessageKind.INVALID_PACKAGE_URI:
         const MessageTemplate(MessageKind.INVALID_PACKAGE_URI,
           "'#{uri}' is not a valid package URI (#{exception}).",
diff --git a/sdk/bin/dartdoc b/sdk/bin/dartdoc
new file mode 100755
index 0000000..319df02
--- /dev/null
+++ b/sdk/bin/dartdoc
@@ -0,0 +1,29 @@
+#!/bin/bash
+# Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+# 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.
+
+# Run dart_style/bin/format.dart on the Dart VM. This script assumes the Dart
+# SDK's directory structure.
+
+function follow_links() {
+  file="$1"
+  while [ -h "$file" ]; do
+    # On Mac OS, readlink -f doesn't work.
+    file="$(readlink "$file")"
+  done
+  echo "$file"
+}
+
+# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
+PROG_NAME="$(follow_links "$BASH_SOURCE")"
+
+# Handle the case where dart-sdk/bin has been symlinked to.
+BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
+SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
+
+SNAPSHOT="$BIN_DIR/snapshots/dartdoc.dart.snapshot"
+
+# We are running the snapshot in the built SDK.
+DART="$BIN_DIR/dart"
+exec "$DART" --packages="$BIN_DIR/snapshots/resources/dartdoc/.packages" "$SNAPSHOT" "$@"
diff --git a/sdk/bin/dartdoc.bat b/sdk/bin/dartdoc.bat
new file mode 100644
index 0000000..58c2017
--- /dev/null
+++ b/sdk/bin/dartdoc.bat
@@ -0,0 +1,44 @@
+@echo off
+REM Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+REM for details. All rights reserved. Use of this source code is governed by a
+REM BSD-style license that can be found in the LICENSE file.
+
+setlocal
+rem Handle the case where dart-sdk/bin has been symlinked to.
+set DIR_NAME_WITH_SLASH=%~dp0
+set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
+call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
+rem Get rid of surrounding quotes.
+for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
+
+set DART=%BIN_DIR%\dart
+set SNAPSHOT=%BIN_DIR%\snapshots\dartdoc.dart.snapshot
+
+"%DART%" --packages="$BIN_DIR/snapshots/resources/dartdoc/.packages" "%SNAPSHOT%" %*
+
+endlocal
+
+exit /b %errorlevel%
+
+rem Follow the symbolic links (junctions points) using `dir to determine the
+rem canonical path. Output with a link looks something like this
+rem
+rem 01/03/2013  10:11 PM    <JUNCTION>     abc def
+rem [c:\dart_bleeding\dart-repo.9\dart\build\ReleaseIA32\dart-sdk]
+rem
+rem So in the output of 'dir /a:l "targetdir"' we are looking for a filename
+rem surrounded by right angle bracket and left square bracket. Once we get
+rem the filename, which is name of the link, we recursively follow that.
+:follow_links
+setlocal
+for %%i in (%1) do set result=%%~fi
+set current=
+for /f "usebackq tokens=2 delims=[]" %%i in (`dir /a:l "%~dp1" 2^>nul ^
+                                             ^| find ">     %~n1 ["`) do (
+  set current=%%i
+)
+if not "%current%"=="" call :follow_links "%current%", result
+endlocal & set %~2=%result%
+goto :eof
+
+:end
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
index b8a44b4..397c8d8 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
@@ -1072,6 +1072,7 @@
       } else {
         topLevel();
       }
+      context._updateGlobalState();
     }
 
     if (startPaused) {
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
index 82ef73f..eb68107 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
@@ -25,11 +25,35 @@
   static Future<Isolate> spawn(void entryPoint(message), var message,
                                {bool paused: false, bool errorsAreFatal,
                                 SendPort onExit, SendPort onError}) {
+    bool forcePause = (errorsAreFatal != null) ||
+                      (onExit != null) ||
+                      (onError != null);
     try {
-      return IsolateNatives.spawnFunction(entryPoint, message, paused)
-          .then((msg) => new Isolate(msg[1],
-                                     pauseCapability: msg[2],
-                                     terminateCapability: msg[3]));
+      // TODO: Consider passing the errorsAreFatal/onExit/onError values
+      //       as arguments to the internal spawnUri instead of setting
+      //       them after the isolate has been created.
+      return IsolateNatives.spawnFunction(entryPoint, message,
+                                          paused || forcePause)
+          .then((msg) {
+            var isolate = new Isolate(msg[1],
+                                      pauseCapability: msg[2],
+                                      terminateCapability: msg[3]);
+            if (forcePause) {
+              if (errorsAreFatal != null) {
+                isolate.setErrorsFatal(errorsAreFatal);
+              }
+              if (onExit != null) {
+                isolate.addOnExitListener(onExit);
+              }
+              if (onError != null) {
+                isolate.addErrorListener(onError);
+              }
+              if (!paused) {
+                isolate.resume(isolate.pauseCapability);
+              }
+            }
+            return isolate;
+          });
     } catch (e, st) {
       return new Future<Isolate>.error(e, st);
     }
@@ -41,6 +65,9 @@
       {bool paused: false, bool checked, Uri packageRoot, bool errorsAreFatal,
        SendPort onExit, SendPort onError}) {
     if (packageRoot != null) throw new UnimplementedError("packageRoot");
+    bool forcePause = (errorsAreFatal != null) ||
+                      (onExit != null) ||
+                      (onError != null);
     try {
       if (args is List<String>) {
         for (int i = 0; i < args.length; i++) {
@@ -51,10 +78,30 @@
       } else if (args != null) {
         throw new ArgumentError("Args must be a list of Strings $args");
       }
-      return IsolateNatives.spawnUri(uri, args, message, paused)
-          .then((msg) => new Isolate(msg[1],
-                                     pauseCapability: msg[2],
-                                     terminateCapability: msg[3]));
+      // TODO: Consider passing the errorsAreFatal/onExit/onError values
+      //       as arguments to the internal spawnUri instead of setting
+      //       them after the isolate has been created.
+      return IsolateNatives.spawnUri(uri, args, message, paused || forcePause)
+          .then((msg) {
+            var isolate = new Isolate(msg[1],
+                                      pauseCapability: msg[2],
+                                      terminateCapability: msg[3]);
+            if (forcePause) {
+              if (errorsAreFatal != null) {
+                isolate.setErrorsFatal(errorsAreFatal);
+              }
+              if (onExit != null) {
+                isolate.addOnExitListener(onExit);
+              }
+              if (onError != null) {
+                isolate.addErrorListener(onError);
+              }
+              if (!paused) {
+                isolate.resume(isolate.pauseCapability);
+              }
+            }
+            return isolate;
+          });
     } catch (e, st) {
       return new Future<Isolate>.error(e, st);
     }
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index 9a8b313..8c2b86e 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.dart
@@ -157,9 +157,6 @@
    * isolate was started as [paused], it may already have terminated
    * before those methods can complete.
    *
-   * WARNING: The [errorsAreFatal], [onExit] and [onError] parameters are not
-   * implemented yet.
-   *
    * Returns a future that will complete with an [Isolate] instance if the
    * spawning succeeded. It will complete with an error otherwise.
    */
@@ -202,9 +199,6 @@
    * isolate was started as [paused], it may already have terminated
    * before those methods can complete.
    *
-   * WARNING: The [errorsAreFatal], [onExit] and [onError] parameters are not
-   * implemented yet.
-   *
    * If the [checked] parameter is set to `true` or `false`,
    * the new isolate will run code in checked mode,
    * respectively in production mode, if possible.
diff --git a/tests/isolate/exit_at_spawn_test.dart b/tests/isolate/exit_at_spawn_test.dart
index a03b565..355c449 100644
--- a/tests/isolate/exit_at_spawn_test.dart
+++ b/tests/isolate/exit_at_spawn_test.dart
@@ -9,19 +9,40 @@
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
 
+// Isolate exiting immediately.
 isomain(args) {}
 
+// Isolate exiting after running microtasks.
+isomain2(args) {
+  scheduleMicrotask((){});
+}
+
+// Isolate exiting after running timers.
+isomain3(args) {
+  new Timer(Duration.ZERO, (){});
+}
+
 main(){
   asyncStart();
 
+  test(isomain);
+  test(isomain2);
+  test(isomain3);
+
+  asyncEnd();
+}
+
+void test(mainFunction) {
+  asyncStart();
+
   RawReceivePort exitPort = new RawReceivePort();
   exitPort.handler = (message) {
     Expect.equals(null, message);
     exitPort.close();
     asyncEnd();
   };
-  
-  Isolate.spawn(isomain,
+
+  Isolate.spawn(mainFunction,
                 null,
                 // Setup handler as part of spawn.
                 errorsAreFatal: false,
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index 035100e..4073b51 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -55,9 +55,6 @@
 message3_test/constInstance: RuntimeError # Issue 21817
 browser/issue_12474_test: CompileTimeError # Issue 22529
 enum_const_test/02: RuntimeError # Issue 21817
-error_exit_at_spawn_test: Fail  # Issue 23876
-error_at_spawn_test: Fail  # Issue 23876
-exit_at_spawn_test: Fail  # Issue 23876
 
 [ $compiler == dart2js && $runtime != d8 ]
 error_exit_at_spawn_test: Skip # Issue 23876
diff --git a/tools/VERSION b/tools/VERSION
index 3cfbb85..c5c163e 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -28,4 +28,4 @@
 MINOR 12
 PATCH 0
 PRERELEASE 5
-PRERELEASE_PATCH 5
+PRERELEASE_PATCH 6
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index 4b84070..b4e2135 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -15,6 +15,7 @@
 # ....bin/
 # ......dart or dart.exe (executable)
 # ......dart.lib (import library for VM native extensions on Windows)
+# ......dartdoc
 # ......dartfmt
 # ......dart2js
 # ......dartanalyzer
@@ -23,9 +24,15 @@
 # ........analysis_server.dart.snapshot
 # ........dart2js.dart.snapshot
 # ........dartanalyzer.dart.snapshot
+# ........dartdoc.dart.snapshot
 # ........dartfmt.dart.snapshot
 # ........pub.dart.snapshot
 # ........utils_wrapper.dart.snapshot
+#.........resources/
+#...........dartdoc/
+#..............packages
+#.............resources/
+#.............templates/
 # ....include/
 # ......dart_api.h
 # ......dart_mirrors_api.h
@@ -114,18 +121,32 @@
 
 def CopyDartScripts(home, sdk_root):
   for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt_sdk', 'docgen',
-                     'dartdocgen', 'pub_sdk']:
+                     'dartdocgen', 'pub_sdk', 'dartdoc']:
     CopyShellScript(os.path.join(home, 'sdk', 'bin', executable),
                     os.path.join(sdk_root, 'bin'))
 
 
 def CopySnapshots(snapshots, sdk_root):
   for snapshot in ['analysis_server', 'dart2js', 'dartanalyzer', 'dartfmt',
-                   'utils_wrapper', 'pub']:
+                   'utils_wrapper', 'pub', 'dartdoc']:
     snapshot += '.dart.snapshot'
     copyfile(join(snapshots, snapshot),
              join(sdk_root, 'bin', 'snapshots', snapshot))
 
+def CopyDartdocResources(home,sdk_root):
+  RESOURCE_DIR = join(sdk_root, 'bin', 'snapshots', 'resources')
+  DARTDOC = join(RESOURCE_DIR, 'dartdoc')
+
+  copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'templates'),
+           join(DARTDOC, 'templates'))
+  copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'resources'),
+           join(DARTDOC, 'resources'))
+  # write the .packages file
+  PACKAGES_FILE = join(DARTDOC, '.packages')
+  packages_file = open(PACKAGES_FILE, 'w')
+  packages_file.write('dartdoc:.')
+  packages_file.close() 
+
 
 def Main():
   # Pull in all of the gypi files which will be munged into the sdk.
@@ -251,6 +272,7 @@
   # Copy dart2js/pub.
   CopyDartScripts(HOME, SDK_tmp)
   CopySnapshots(SNAPSHOT, SDK_tmp)
+  CopyDartdocResources(HOME, SDK_tmp)
 
   # Write the 'version' file
   version = utils.GetVersion()
diff --git a/tools/deps/dartium.deps/DEPS b/tools/deps/dartium.deps/DEPS
index 1977d7a..11e4803 100644
--- a/tools/deps/dartium.deps/DEPS
+++ b/tools/deps/dartium.deps/DEPS
@@ -34,7 +34,7 @@
   "metatest_rev": "@e5aa8e4e19fc4188ac2f6d38368a47d8f07c3df1",
   "oauth2_rev": "@1bff41f4d54505c36f2d1a001b83b8b745c452f5",
   "observatory_pub_packages_rev": "@cdc4b3d4c15b9c0c8e7702dff127b440afbb7485",
-  "package_config_tag": "@0.1.1",
+  "package_config_rev": "@0.1.3",
   "path_rev": "@b657c0854d1cf41c014986fa9d2321f1173df805",
   "plugin_tag": "@0.1.0",
   "pool_rev": "@22e12aeb16ad0b626900dbe79e4a25391ddfb28c",
diff --git a/utils/dartdoc/dartdoc.gyp b/utils/dartdoc/dartdoc.gyp
new file mode 100644
index 0000000..73c4fa4
--- /dev/null
+++ b/utils/dartdoc/dartdoc.gyp
@@ -0,0 +1,36 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# 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.
+
+{
+  'targets': [
+    {
+      'target_name': 'dartdoc',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+        '../../pkg/pkg.gyp:pkg_packages',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_dartdoc_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+            '<(SHARED_INTERMEDIATE_DIR)/packages.stamp',
+            '<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../third_party/pkg/dartdoc"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot',
+            '--package-root=<(PRODUCT_DIR)/packages/',
+            '../../third_party/pkg/dartdoc/bin/dartdoc.dart',
+          ],
+        },
+      ],
+    },
+  ],
+}
\ No newline at end of file