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

import("//build/config/android/build_vars.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//build/config/clang/clang.gni")
import("//build/config/coverage/coverage.gni")
import("//build/config/gclient_args.gni")
import("//build/config/python.gni")
import("//build_overrides/build.gni")

if (build_with_chromium) {
  import("//base/allocator/partition_allocator/partition_alloc.gni")
}

if (enable_java_templates) {
  # Create or update the API versions cache if necessary by running a
  # functionally empty lint task. This prevents racy creation of the
  # cache while linting java targets in android_lint.
  android_lint("prepare_android_lint_cache") {
    create_cache = true
  }

  generate_build_config_srcjar("placeholder_build_config_srcjar") {
  }

  generate_build_config_srcjar("build_config_for_robolectric_srcjar") {
    testonly = true
  }

  write_native_libraries_java("native_libraries_gen") {
    use_final_fields = false
  }

  java_library("build_java") {
    supports_android = true

    # Caused odd errors: https://crbug.com/404877460
    jacoco_never_instrument = true

    # Required to prevent circular dependency from //tools/android/errorprone_plugin.
    enable_errorprone = false
    srcjar_deps = [
      ":native_libraries_gen",
      ":placeholder_build_config_srcjar",
    ]
    sources = [
      "java/src/org/chromium/build/NullUtil.java",
      "java/src/org/chromium/build/annotations/AlwaysInline.java",
      "java/src/org/chromium/build/annotations/CheckDiscard.java",
      "java/src/org/chromium/build/annotations/Contract.java",
      "java/src/org/chromium/build/annotations/DoNotClassMerge.java",
      "java/src/org/chromium/build/annotations/DoNotInline.java",
      "java/src/org/chromium/build/annotations/DoNotStripLogs.java",
      "java/src/org/chromium/build/annotations/EnsuresNonNull.java",
      "java/src/org/chromium/build/annotations/EnsuresNonNullIf.java",
      "java/src/org/chromium/build/annotations/IdentifierNameString.java",
      "java/src/org/chromium/build/annotations/Initializer.java",
      "java/src/org/chromium/build/annotations/MockedInTests.java",
      "java/src/org/chromium/build/annotations/MonotonicNonNull.java",
      "java/src/org/chromium/build/annotations/NullMarked.java",
      "java/src/org/chromium/build/annotations/NullUnmarked.java",
      "java/src/org/chromium/build/annotations/Nullable.java",
      "java/src/org/chromium/build/annotations/OptimizeAsNonNull.java",
      "java/src/org/chromium/build/annotations/RequiresNonNull.java",
      "java/src/org/chromium/build/annotations/ServiceImpl.java",
      "java/src/org/chromium/build/annotations/UsedByReflection.java",
      "java/src/org/chromium/build/annotations/UsedReflectively.java",
    ]

    jar_excluded_patterns = [ "*/build/BuildConfig.class" ]

    # New version of NativeLibraries.java (with the actual correct values) will
    # be created when creating an apk.
    jar_excluded_patterns += [ "*/NativeLibraries.class" ]

    proguard_configs = [ "chromium_annotations.flags" ]
  }

  # Not all //build embedders pull in junit_binary deps that live in //third_party.
  if (build_with_chromium) {
    android_assets("junit_test_assets") {
      testonly = true

      # We just need any file here, so use the test itself.
      sources = [ "junit/src/org/chromium/build/AndroidAssetsTest.java" ]
    }
    android_resources("junit_test_resources") {
      testonly = true
      sources = [ "junit/res/values/strings.xml" ]
      mergeable_android_manifests = [ "junit/AndroidManifest_mergetest.xml" ]
    }
    robolectric_binary("build_junit_tests") {
      # Test has no JNI, so skip JNI Generator step.
      resources_package = "org.chromium.build"
      sources = [
        "junit/src/org/chromium/build/AndroidAssetsTest.java",
        "junit/src/org/chromium/build/IncrementalJavacTest.java",
      ]
      deps = [
        ":junit_test_assets",
        ":junit_test_resources",
        "//build/android/test/incremental_javac_gn:no_signature_change_prebuilt_java",
        "//third_party/junit",
      ]
    }
  }
}

if (defined(sanitizer_arch)) {
  action("generate_wrap_sh") {
    script = "generate_wrap_sh.py"
    outputs = [ "$target_gen_dir/$target_name/wrap.sh" ]
    args = [
      "--arch=$sanitizer_arch",
      "--output",
      rebase_path(outputs[0], root_build_dir),
    ]
    if (is_hwasan) {
      args += [ "--is_hwasan" ]
    }
  }
}

# TODO(go/turn-down-test-results): Remove once we turn down
# test-results.appspot.com
python_library("test_result_presentations_py") {
  pydeps_file = "pylib/results/presentation/test_results_presentation.pydeps"
  data = [
    "//build/android/pylib/results/presentation/template",
    "//build/android/pylib/results/presentation/javascript/main_html.js",
    "//third_party/catapult/third_party/gsutil/",
    "//third_party/jinja2/debug.py",
    "//third_party/six",
  ]
}

python_library("devil_chromium_py") {
  pydeps_file = "devil_chromium.pydeps"
  data = [
    "devil_chromium.py",
    "devil_chromium.json",
    "//third_party/catapult/third_party/gsutil/",
    "//third_party/catapult/devil/devil/devil_dependencies.json",

    # Read by gn_helpers.BuildWithChromium()
    "//build/config/gclient_args.gni",
  ]
}

# Contains runtime deps for installing apks.
# E.g. from test_runner.py or from apk_operations.py.
group("apk_installer_data") {
  # Other //build users let devil library fetch these from Google Storage.
  if (build_with_chromium) {
    if (!is_component_build) {
      data_deps = [
        "//build/android/pylib/device/commands",
        "//tools/android/devil_util",
      ]
    }
    data =
        [ "//third_party/android_build_tools/bundletool/cipd/bundletool.jar" ]
  }
}

python_library("apk_operations_py") {
  pydeps_file = "apk_operations.pydeps"
  deps = [ ":apk_installer_data" ]
}

group("test_runner_py") {
  testonly = true
  deps = [
    ":test_runner_core_py",
    ":test_runner_device_support",
  ]
}

python_library("test_runner_core_py") {
  testonly = true
  pydeps_file = "test_runner.pydeps"
  data = [
    "pylib/gtest/filter/",
    "pylib/instrumentation/render_test.html.jinja",
    "pylib/local/machine/local_machine_hostside_tradefed_config.xml",
    "test_wrapper/logdog_wrapper.py",
    "//third_party/requests/",
  ]
  data_deps = [ ":logdog_wrapper_py" ]
  if (use_clang_coverage && checkout_clang_coverage_tools) {
    # Test runner script may use `llvm-profdata` (if exists) to merge
    # clang code coverage data after each instrumentation test to
    # save space. The tool only exists when `checkout_clang_coverage_tools`
    # gclient custom_var is true.
    data += [ "${clang_base_path}/bin/llvm-profdata" ]
  }
}

group("test_runner_device_support") {
  testonly = true

  # We hardcode using these tools from the public sdk in devil_chromium.json and
  # in pylib's constants.
  data = [
    "${public_android_sdk_build_tools}/aapt",
    "${public_android_sdk_build_tools}/aapt2",
    "${public_android_sdk_build_tools}/dexdump",
    "${public_android_sdk_build_tools}/lib64/libc++.so",
    "${public_android_sdk_build_tools}/split-select",
    "${public_android_sdk_root}/platform-tools/adb",
  ]
  data_deps = [
    ":apk_installer_data",
    ":devil_chromium_py",
    ":stack_tools",
  ]

  # Other //build users let devil library fetch these from Google Storage.
  if (build_with_chromium) {
    if (!is_component_build) {
      data_deps += [ "//tools/android/forwarder2" ]
    }
    data += [ "//tools/android/avd/proto/" ]
    if (enable_chrome_android_internal) {
      data += [ "//clank/tools/android/avd/proto/" ]
    }
    if (use_full_mte) {
      data_deps += [ "//tools/android/mte:mte_device_setup" ]
    }
  }

  # Proguard is needed only when using apks (rather than native executables).
  if (enable_java_templates) {
    data_deps += [ "//build/android/stacktrace:java_deobfuscate" ]
  }
}

python_library("logdog_wrapper_py") {
  pydeps_file = "test_wrapper/logdog_wrapper.pydeps"
}

python_library("resource_sizes_py") {
  pydeps_file = "resource_sizes.pydeps"
  data_deps = [
    ":devil_chromium_py",
    "//third_party/catapult/tracing:convert_chart_json",
  ]

  data = [
    build_vars_file,
    "//third_party/llvm-build/Release+Asserts/bin/llvm-readobj",
  ]
}

# Tools necessary for symbolizing tombstones or stack traces that are output to
# logcat.
# Hidden behind build_with_chromium because some third party repos that use
# //build don't pull in //third_party/android_platform.
# TODO(crbug.com/40145789): Move stack script into //build/third_party
#     and enable unconditionally.
group("stack_tools") {
  if (build_with_chromium) {
    data = [
      "tombstones.py",
      "pylib/symbols/",
      "stacktrace/",
    ]

    data_deps =
        [ "//third_party/android_platform/development/scripts:stack_py" ]
  }
}

# GN evaluates each .gn file once per toolchain, so restricting to default
# toolchain will ensure write_file() is called only once.
assert(current_toolchain == default_toolchain)

# NOTE: If other platforms would benefit from exporting variables, we should
# move this to a more top-level place.
# It is currently here (instead of //BUILD.gn) to ensure that the file is
# written even for non-chromium embedders of //build.
_build_vars_json = {
  # Underscore prefix so that it appears at the top.
  _HEADER = "Generated during 'gn gen' by //build/android/BUILD.gn."
  forward_variables_from(android_build_vars_json, "*")
}

write_file(build_vars_file, _build_vars_json, "json")
