# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/dart/dart_library.gni")
import("//build/dart/dart_tool.gni")

dart_library("flutter_tools") {
  package_name = "flutter_tools"

  # Can be left empty as analysis is disabled.
  sources = []

  disable_analysis = true

  deps = [
    "//third_party/dart-pkg/pub/analyzer",
    "//third_party/dart-pkg/pub/archive",
    "//third_party/dart-pkg/pub/args",
    "//third_party/dart-pkg/pub/build_daemon",
    "//third_party/dart-pkg/pub/collection",
    "//third_party/dart-pkg/pub/completion",
    "//third_party/dart-pkg/pub/coverage",
    "//third_party/dart-pkg/pub/crypto",
    "//third_party/dart-pkg/pub/dwds",
    "//third_party/dart-pkg/pub/file",
    # The HTTP dependency is removed because http doesn't work on Fuchsia
    # because it uses mirrors which Fuchsia's Dart VM doesn't support.
    "//third_party/dart-pkg/pub/json_rpc_2",
    "//third_party/dart-pkg/pub/json_schema",
    "//third_party/dart-pkg/pub/meta",
    "//third_party/dart-pkg/pub/mime",
    "//third_party/dart-pkg/pub/multi_server_socket",
    "//third_party/dart-pkg/pub/multicast_dns",
    "//third_party/dart-pkg/pub/mustache_template",
    "//third_party/dart-pkg/pub/native_stack_traces",
    "//third_party/dart-pkg/pub/node_preamble",
    "//third_party/dart-pkg/pub/package_config",
    "//third_party/dart-pkg/pub/path",
    "//third_party/dart-pkg/pub/platform",
    "//third_party/dart-pkg/pub/process",
    "//third_party/dart-pkg/pub/protobuf",
    "//third_party/dart-pkg/pub/quiver",
    "//third_party/dart-pkg/pub/shelf_packages_handler",
    "//third_party/dart-pkg/pub/shelf_static",
    "//third_party/dart-pkg/pub/shelf_proxy",
    "//third_party/dart-pkg/pub/stack_trace",
    "//third_party/dart-pkg/pub/test",
    "//third_party/dart-pkg/pub/usage",
    "//third_party/dart-pkg/pub/vm_service",
    "//third_party/dart-pkg/pub/web_socket_channel",
    "//third_party/dart-pkg/pub/webkit_inspection_protocol",
    "//third_party/dart-pkg/pub/xml",
    "//third_party/dart-pkg/pub/yaml",
  ]
}

dart_tool("fuchsia_builder") {
  main_dart = "bin/fuchsia_builder.dart"

  disable_analysis = true

  deps = [
    ":flutter_tools",
  ]
}

dart_tool("fuchsia_asset_builder") {
  main_dart = "bin/fuchsia_asset_builder.dart"

  disable_analysis = true

  sources = [
    "src/android/adb.dart",
    "src/android/android.dart",
    "src/android/android_device.dart",
    "src/android/android_emulator.dart",
    "src/android/android_sdk.dart",
    "src/android/android_studio.dart",
    "src/android/android_studio_validator.dart",
    "src/android/android_workflow.dart",
    "src/android/apk.dart",
    "src/android/gradle.dart",
    "src/application_package.dart",
    "src/artifacts.dart",
    "src/asset.dart",
    "src/base/build.dart",
    "src/base/common.dart",
    "src/base/config.dart",
    "src/base/context.dart",
    "src/base/file_system.dart",
    "src/base/fingerprint.dart",
    "src/base/flags.dart",
    "src/base/io.dart",
    "src/base/logger.dart",
    "src/base/net.dart",
    "src/base/os.dart",
    "src/base/process.dart",
    "src/base/terminal.dart",
    "src/base/utils.dart",
    "src/base/version.dart",
    "src/build_info.dart",
    "src/bundle.dart",
    "src/cache.dart",
    "src/compile.dart",
    "src/context_runner.dart",
    "src/dart/dependencies.dart",
    "src/dart/package_map.dart",
    "src/dart/pub.dart",
    "src/dart/sdk.dart",
    "src/dependency_checker.dart",
    "src/devfs.dart",
    "src/device.dart",
    "src/disabled_usage.dart",
    "src/doctor.dart",
    "src/emulator.dart",
    "src/flutter_manifest.dart",
    "src/globals.dart",
    "src/intellij/intellij.dart",
    "src/ios/cocoapods.dart",
    "src/ios/code_signing.dart",
    "src/ios/devices.dart",
    "src/ios/ios_emulators.dart",
    "src/ios/ios_workflow.dart",
    "src/ios/mac.dart",
    "src/ios/plist_utils.dart",
    "src/ios/simulators.dart",
    "src/ios/xcodeproj.dart",
    "src/plugins.dart",
    "src/project.dart",
    "src/protocol_discovery.dart",
    "src/resident_runner.dart",
    "src/run_cold.dart",
    "src/run_hot.dart",
    "src/runner/flutter_command.dart",
    "src/runner/flutter_command_runner.dart",
    "src/services.dart",
    "src/template.dart",
    "src/tester/flutter_tester.dart",
    "src/tracing.dart",
    "src/usage.dart",
    "src/version.dart",
    "src/vmservice.dart",
    "src/vmservice_record_replay.dart",
    "src/vscode/vscode.dart",
    "src/vscode/vscode_validator.dart",
  ]

  deps = [
    ":flutter_tools",
  ]
}

dart_tool("fuchsia_tester") {
  main_dart = "bin/fuchsia_tester.dart"

  disable_analysis = true

  sources = [
    "src/android/adb.dart",
    "src/android/android.dart",
    "src/android/android_device.dart",
    "src/android/android_emulator.dart",
    "src/android/android_sdk.dart",
    "src/android/android_studio.dart",
    "src/android/android_studio_validator.dart",
    "src/android/android_workflow.dart",
    "src/android/apk.dart",
    "src/android/gradle.dart",
    "src/application_package.dart",
    "src/artifacts.dart",
    "src/asset.dart",
    "src/base/build.dart",
    "src/base/common.dart",
    "src/base/config.dart",
    "src/base/context.dart",
    "src/base/file_system.dart",
    "src/base/fingerprint.dart",
    "src/base/flags.dart",
    "src/base/io.dart",
    "src/base/logger.dart",
    "src/base/net.dart",
    "src/base/os.dart",
    "src/base/process.dart",
    "src/base/terminal.dart",
    "src/base/utils.dart",
    "src/base/version.dart",
    "src/build_info.dart",
    "src/bundle.dart",
    "src/cache.dart",
    "src/compile.dart",
    "src/context_runner.dart",
    "src/dart/dependencies.dart",
    "src/dart/package_map.dart",
    "src/dart/pub.dart",
    "src/dart/sdk.dart",
    "src/dependency_checker.dart",
    "src/devfs.dart",
    "src/device.dart",
    "src/disabled_usage.dart",
    "src/doctor.dart",
    "src/emulator.dart",
    "src/flutter_manifest.dart",
    "src/globals.dart",
    "src/intellij/intellij.dart",
    "src/ios/cocoapods.dart",
    "src/ios/code_signing.dart",
    "src/ios/devices.dart",
    "src/ios/ios_emulators.dart",
    "src/ios/ios_workflow.dart",
    "src/ios/mac.dart",
    "src/ios/plist_utils.dart",
    "src/ios/simulators.dart",
    "src/ios/xcodeproj.dart",
    "src/plugins.dart",
    "src/project.dart",
    "src/protocol_discovery.dart",
    "src/resident_runner.dart",
    "src/run_cold.dart",
    "src/run_hot.dart",
    "src/runner/flutter_command.dart",
    "src/runner/flutter_command_runner.dart",
    "src/services.dart",
    "src/template.dart",
    "src/test/coverage_collector.dart",
    "src/test/flutter_platform.dart",
    "src/test/runner.dart",
    "src/test/watcher.dart",
    "src/tester/flutter_tester.dart",
    "src/tracing.dart",
    "src/usage.dart",
    "src/version.dart",
    "src/vmservice.dart",
    "src/vmservice_record_replay.dart",
    "src/vscode/vscode.dart",
    "src/vscode/vscode_validator.dart",
  ]

  deps = [
    ":flutter_tools",
  ]

  non_dart_deps = [
    "$flutter_root/shell",
  ]
}

dart_tool("fuchsia_attach") {
  package_name = "fuchsia_attach"
  main_dart = "bin/fuchsia_attach.dart"

  # Can be left empty as analysis is disabled.
  sources = []

  disable_analysis = true

  deps = [
    ":flutter_tools",
  ]

  non_dart_deps = [
    "//third_party/flutter/frontend_server:frontend_server_tool_snapshot($host_toolchain)",
  ]
}
