Home | History | Annotate | Download | only in android_tools
      1 # Copyright 2014 The Chromium Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 import("//build/config/android/rules.gni")
      6 
      7 config("cpu_features_include") {
      8   include_dirs = [ "ndk/sources/android/cpufeatures" ]
      9 }
     10 
     11 config("cpu_features_warnings") {
     12   if (is_clang) {
     13     # cpu-features.c has few unused functions on x86 b/26403333
     14     cflags = [ "-Wno-unused-function" ]
     15   }
     16 }
     17 
     18 # This is the GN version of
     19 # //build/android/ndk.gyp:cpu_features
     20 source_set("cpu_features") {
     21   sources = [
     22     "ndk/sources/android/cpufeatures/cpu-features.c",
     23   ]
     24   public_configs = [ ":cpu_features_include" ]
     25 
     26   configs -= [ "//build/config/compiler:chromium_code" ]
     27   configs += [
     28     "//build/config/compiler:no_chromium_code",
     29 
     30     # Must be after no_chromium_code for warning flags to be ordered correctly.
     31     ":cpu_features_warnings",
     32   ]
     33 }
     34 
     35 android_java_prebuilt("android_gcm_java") {
     36   jar_path = "$android_sdk_root/extras/google/gcm/gcm-client/dist/gcm.jar"
     37 }
     38 
     39 android_java_prebuilt("emma_device") {
     40   jar_path = "$android_sdk_root/tools/lib/emma_device.jar"
     41 }
     42 
     43 android_java_prebuilt("android_support_annotations_javalib") {
     44   jar_path = "$android_sdk_root/extras/android/support/annotations/android-support-annotations.jar"
     45 }
     46 
     47 java_prebuilt("android_support_multidex_java") {
     48   supports_android = true
     49   jar_path = "$android_sdk_root/extras/android/support/multidex/library/libs/android-support-multidex.jar"
     50 }
     51 
     52 android_java_prebuilt("android_support_v13_java") {
     53   jar_path =
     54       "$android_sdk_root/extras/android/support/v13/android-support-v13.jar"
     55 }
     56 
     57 android_resources("android_support_v7_appcompat_resources") {
     58   v14_skip = true
     59   resource_dirs =
     60       [ "$android_sdk_root/extras/android/support/v7/appcompat/res" ]
     61   custom_package = "android.support.v7.appcompat"
     62 }
     63 
     64 android_java_prebuilt("android_support_v7_appcompat_java") {
     65   deps = [
     66     ":android_support_v7_appcompat_resources",
     67   ]
     68   jar_path = "$android_sdk_root/extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar"
     69 }
     70 
     71 android_resources("android_support_v7_mediarouter_resources") {
     72   v14_skip = true
     73   resource_dirs =
     74       [ "$android_sdk_root/extras/android/support/v7/mediarouter/res" ]
     75   deps = [
     76     ":android_support_v7_appcompat_resources",
     77   ]
     78   custom_package = "android.support.v7.mediarouter"
     79 }
     80 
     81 android_java_prebuilt("android_support_v7_mediarouter_java") {
     82   deps = [
     83     ":android_support_v7_appcompat_java",
     84     ":android_support_v7_mediarouter_resources",
     85   ]
     86   jar_path = "$android_sdk_root/extras/android/support/v7/mediarouter/libs/android-support-v7-mediarouter.jar"
     87 }
     88 
     89 android_resources("android_support_v7_recyclerview_resources") {
     90   v14_skip = true
     91   resource_dirs =
     92       [ "$android_sdk_root/extras/android/support/v7/recyclerview/res" ]
     93   custom_package = "android.support.v7.recyclerview"
     94 }
     95 
     96 android_java_prebuilt("android_support_v7_recyclerview_java") {
     97   deps = [
     98     ":android_support_v7_appcompat_java",
     99     ":android_support_v7_recyclerview_resources",
    100   ]
    101   jar_path = "$android_sdk_root/extras/android/support/v7/recyclerview/libs/android-support-v7-recyclerview.jar"
    102 }
    103 
    104 android_resources("google_play_services_default_resources") {
    105   v14_skip = true
    106   resource_dirs = [ "$android_sdk_root/extras/google/google_play_services/libproject/google-play-services_lib/res" ]
    107   custom_package = "com.google.android.gms"
    108 }
    109 android_java_prebuilt("google_play_services_default_java") {
    110   deps = [
    111     ":android_support_v13_java",
    112     ":android_support_v7_mediarouter_java",
    113     ":google_play_services_default_resources",
    114     ":legacy_http_javalib",
    115   ]
    116   proguard_preprocess = true
    117   proguard_config = "//third_party/android_tools/proguard.flags"
    118   jar_path = "$android_sdk_root/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar"
    119 }
    120 
    121 android_resources("android_support_v17_leanback_resources") {
    122   v14_skip = true
    123   resource_dirs =
    124       [ "$android_sdk_root/extras/android/support/v17/leanback/res" ]
    125   custom_package = "android.support.v17.leanback"
    126 }
    127 
    128 android_java_prebuilt("android_support_v17_leanback_java") {
    129   deps = [
    130     ":android_support_v17_leanback_resources",
    131     ":android_support_v7_recyclerview_java",
    132   ]
    133   jar_path = "$android_sdk_root/extras/android/support/v17/leanback/libs/android-support-v17-leanback.jar"
    134 }
    135 
    136 # TODO(jbudorick): Remove this once net_java_test_support no longer needs it.
    137 android_java_prebuilt("legacy_http_javalib") {
    138   jar_path = "$android_sdk/optional/org.apache.http.legacy.jar"
    139 }
    140