# Copyright 2014 The Chromium 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/config/android/rules.gni")

config("cpu_features_include") {
  include_dirs = [ "ndk/sources/android/cpufeatures" ]
}

# This is the GN version of
# //build/android/ndk.gyp:cpu_features
source_set("cpu_features") {
  sources = [
    "ndk/sources/android/cpufeatures/cpu-features.c",
  ]
  public_configs = [ ":cpu_features_include" ]

  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [ "//build/config/compiler:no_chromium_code" ]
}

android_java_prebuilt("android_gcm_java") {
  jar_path = "$android_sdk_root/extras/google/gcm/gcm-client/dist/gcm.jar"
}

android_java_prebuilt("uiautomator_java") {
  jar_path = "$android_sdk/uiautomator.jar"
}

android_java_prebuilt("android_support_annotations_javalib") {
  jar_path = "$android_sdk_root/extras/android/support/annotations/android-support-annotations.jar"
}

java_prebuilt("android_support_multidex_java") {
  jar_path = "$android_sdk_root/extras/android/support/multidex/library/libs/android-support-multidex.jar"
}

android_java_prebuilt("android_support_v13_java") {
  jar_path =
      "$android_sdk_root/extras/android/support/v13/android-support-v13.jar"
}

android_resources("android_support_v7_appcompat_resources") {
  v14_skip = true
  resource_dirs =
      [ "$android_sdk_root/extras/android/support/v7/appcompat/res" ]
  custom_package = "android.support.v7.appcompat"
}

android_java_prebuilt("android_support_v7_appcompat_java") {
  deps = [
    ":android_support_v7_appcompat_resources",
  ]
  jar_path = "$android_sdk_root/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar"
}

android_resources("android_support_v7_mediarouter_resources") {
  v14_skip = true
  resource_dirs =
      [ "$android_sdk_root/extras/android/support/v7/mediarouter/res" ]
  deps = [
    ":android_support_v7_appcompat_resources",
  ]
  custom_package = "android.support.v7.mediarouter"
}

android_java_prebuilt("android_support_v7_mediarouter_java") {
  deps = [
    ":android_support_v7_mediarouter_resources",
    ":android_support_v7_appcompat_java",
  ]
  jar_path = "$android_sdk_root/extras/android/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar"
}

android_resources("android_support_v7_recyclerview_resources") {
  v14_skip = true
  resource_dirs =
      [ "$android_sdk_root/extras/android/support/v7/recyclerview/res" ]
  custom_package = "android.support.v7.recyclerview"
}

android_java_prebuilt("android_support_v7_recyclerview_java") {
  deps = [
    ":android_support_v7_appcompat_java",
    ":android_support_v7_recyclerview_resources",
  ]
  jar_path = "$android_sdk_root/extras/android/support/v7/recyclerview/libs/android-support-v7-recyclerview.jar"
}

android_resources("google_play_services_default_resources") {
  v14_skip = true
  resource_dirs = [ "$android_sdk_root/extras/google/google_play_services/libproject/google-play-services_lib/res" ]
  custom_package = "com.google.android.gms"
}
android_java_prebuilt("google_play_services_default_java") {
  deps = [
    ":android_support_v13_java",
    ":android_support_v7_mediarouter_java",
    ":google_play_services_default_resources",
  ]
  proguard_preprocess = false
  jar_path = "$android_sdk_root/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar"
}
