# Copyright (c) 2012, 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.

{
  'variables' : {
    'script_suffix%': '',
  },
  'conditions' : [
    ['OS=="win"', {
      'variables' : {
        'script_suffix': '.bat',
      },
    }],
  ],
  'targets': [
    {
      'target_name': 'api_docs',
      'type': 'none',
      'dependencies': [
        '../../utils/compiler/compiler.gyp:dart2js',
        '../../runtime/dart-runtime.gyp:dart',
        '../../pkg/pkg.gyp:pkg_packages',
      ],
      'includes': [
        '../../sdk/lib/core/corelib_sources.gypi',
      ],
      'actions': [
        {
          'action_name': 'run_apidoc',
          'inputs': [
            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
            '<(PRODUCT_DIR)/dart2js.snapshot',
            '<!@(["python", "../../tools/list_files.py", "\\.(css|ico|js|json|png|sh|txt|yaml|py)$", ".", "../../sdk/lib/_internal/dartdoc"])',
            '<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../sdk/lib", "../../runtime/lib", "../../runtime/bin"])',
            '../../sdk/bin/dart',
            '../../sdk/bin/dart.bat',
            '../../sdk/bin/dart2js',
            '../../sdk/bin/dart2js.bat',
          ],
          'inputs': [
            '<!@(["python", "../../tools/list_files.py", "\\.(css|png|dart)$", "."])',
          ],
          'outputs': [
            '<(PRODUCT_DIR)/api_docs/index.html',
            '<(PRODUCT_DIR)/api_docs/client-static.js',
          ],
          'action': [
            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
            '--package-root=<(PRODUCT_DIR)/packages/',
            'apidoc.dart',
            '--out=<(PRODUCT_DIR)/api_docs',
            '--version=<!@(["python", "../../tools/print_version.py"])',
            '--package-root=<(PRODUCT_DIR)/packages',
            '--mode=static',
            '--exclude-lib=analyzer_experimental',
            '--exclude-lib=browser',
            '--exclude-lib=dartdoc',
            '--exclude-lib=http',
            '--exclude-lib=oauth2',
            '--exclude-lib=pathos',
            '--exclude-lib=scheduled_test',
            '--exclude-lib=stack_trace',
            '--exclude-lib=webdriver',
            '--exclude-lib=yaml',
            '--include-lib=matcher',
            '--include-lib=mock',
          ],
          'message': 'Running apidoc: <(_action)',
        },
      ],
    }
  ],
}

@@ -769,24 +769,1594 @@
 un_apidoc',%0A
+          # The 'inputs' list records the files whose timestamps are%0A          # compared to the files listed in 'outputs'.  If a file%0A          # 'outputs' doesn't exist or if a file in 'inputs' is newer%0A          # than a file in 'outputs', this action is executed.  Notice%0A          # that the dependencies listed above has nothing to do with%0A          # when this action is executed.  You must list a file in%0A          # 'inputs' to make sure that it exists before the action is%0A          # executed, or to make sure this action is re-run.%0A          #%0A          # We want to build the platform documentation whenever%0A          # dartdoc, apidoc, or its dependency changes.  This prevents%0A          # people from accidentally breaking apidoc when making%0A          # changes to the platform libraries and or when modifying%0A          # dart2js or the VM.%0A          #%0A          # In addition, we want to make sure that the platform%0A          # documentation is regenerated when the platform sources%0A          # changes.%0A          #%0A          # So we want this action to be re-run when a dart file%0A          # changes in this directory, or in the SDK library (we may%0A          # no longer need to list the files in ../../runtime/lib and%0A          # ../../runtime/bin, as most of them has moved to%0A          # ../../sdk/lib).%0A          #%0A          # In addition, we want to make sure the documentation is%0A          # regenerated when a resource file (CSS, PNG, etc) is%0A          # updated.  This is because these files are also copied to%0A          # the output directory.%0A
           'i
@@ -2699,16 +2699,21 @@
 .dart$%22,
+ %22.%22,
  %22../../
@@ -2934,130 +2934,8 @@
  %5D,%0A
-          'inputs': %5B%0A            '%3C!@(%5B%22python%22, %22../../tools/list_files.py%22, %22%5C%5C.(css%7Cpng%7Cdart)$%22, %22.%22%5D)',%0A          %5D,%0A
     

Fix dependencies of apidoc.