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 { 6 'conditions': [ 7 ['OS=="android"', { 8 'targets': [ 9 { 10 'target_name': 'remoting_jni_headers', 11 'type': 'none', 12 'sources': [ 13 'android/java/src/org/chromium/chromoting/jni/JniInterface.java', 14 ], 15 'variables': { 16 'jni_gen_package': 'remoting', 17 }, 18 'includes': [ '../build/jni_generator.gypi' ], 19 }, # end of target 'remoting_jni_headers' 20 { 21 'target_name': 'remoting_client_jni', 22 'type': 'shared_library', 23 'dependencies': [ 24 'remoting_base', 25 'remoting_client', 26 'remoting_jni_headers', 27 'remoting_protocol', 28 '../google_apis/google_apis.gyp:google_apis', 29 '../ui/gfx/gfx.gyp:gfx', 30 ], 31 'sources': [ 32 'client/jni/android_keymap.cc', 33 'client/jni/android_keymap.h', 34 'client/jni/chromoting_jni_instance.cc', 35 'client/jni/chromoting_jni_instance.h', 36 'client/jni/chromoting_jni_onload.cc', 37 'client/jni/chromoting_jni_runtime.cc', 38 'client/jni/chromoting_jni_runtime.h', 39 'client/jni/jni_frame_consumer.cc', 40 'client/jni/jni_frame_consumer.h', 41 ], 42 }, # end of target 'remoting_client_jni' 43 { 44 'target_name': 'remoting_android_resources', 45 'type': 'none', 46 'copies': [ 47 { 48 'destination': '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res/drawable', 49 'files': [ 50 'resources/chromoting128.png', 51 'resources/icon_host.png', 52 ], 53 }, 54 ], 55 }, # end of target 'remoting_android_resources' 56 { 57 'target_name': 'remoting_apk_manifest', 58 'type': 'none', 59 'conditions': [ 60 ['enable_cast==1', { 61 'sources': [ 62 'android/cast/AndroidManifest.xml.jinja2' 63 ], 64 }, { # 'enable_cast != 1' 65 'sources': [ 66 'android/java/AndroidManifest.xml.jinja2', 67 ], 68 }], 69 ], 70 'rules': [{ 71 'rule_name': 'generate_manifest', 72 'extension': 'jinja2', 73 'inputs': [ 74 '<(remoting_localize_path)', 75 '<(branding_path)', 76 ], 77 'outputs': [ 78 '<(SHARED_INTERMEDIATE_DIR)/remoting/android/<(RULE_INPUT_ROOT)', 79 ], 80 'action': [ 81 'python', '<(remoting_localize_path)', 82 '--variables', '<(branding_path)', 83 '--template', '<(RULE_INPUT_PATH)', 84 '--locale_output', '<@(_outputs)', 85 'en', 86 ], 87 }], 88 }, # end of target 'remoting_apk_manifest' 89 { 90 'target_name': 'remoting_android_client_java', 91 'type': 'none', 92 'variables': { 93 'java_in_dir': 'android/java', 94 'has_java_resources': 1, 95 'R_package': 'org.chromium.chromoting', 96 'R_package_relpath': 'org/chromium/chromoting', 97 'res_extra_dirs': [ '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res' ], 98 'res_extra_files': [ 99 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(SHARED_INTERMEDIATE_DIR)" resources/remoting_strings.grd)', 100 '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res/drawable/chromoting128.png', 101 '<(SHARED_INTERMEDIATE_DIR)/remoting/android/res/drawable/icon_host.png', 102 ], 103 }, 104 'dependencies': [ 105 '../base/base.gyp:base_java', 106 '../ui/android/ui_android.gyp:ui_java', 107 'remoting_android_resources', 108 '../third_party/android_tools/android_tools.gyp:android_support_v7_appcompat_javalib', 109 '../third_party/android_tools/android_tools.gyp:android_support_v7_mediarouter_javalib', 110 '../third_party/android_tools/android_tools.gyp:android_support_v13_javalib', 111 ], 112 'includes': [ '../build/java.gypi' ], 113 'conditions' : [ 114 ['enable_cast==1', { 115 'variables': { 116 'additional_src_dirs': [ 117 'android/cast', 118 ], 119 }, 120 'dependencies': [ 121 'google_play_services_javalib', 122 ], 123 }], 124 ], 125 }, 126 { 127 'target_name': 'remoting_apk', 128 'type': 'none', 129 'dependencies': [ 130 'remoting_apk_manifest', 131 'remoting_client_jni', 132 'remoting_android_client_java', 133 ], 134 'variables': { 135 'apk_name': '<!(python <(version_py_path) -f <(branding_path) -t "@APK_FILE_NAME@")', 136 'android_app_version_name': '<(version_full)', 137 'android_app_version_code': '<!(python tools/android_version.py <(android_app_version_name))', 138 'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/remoting/android/AndroidManifest.xml', 139 'java_in_dir': 'android/apk', 140 'native_lib_target': 'libremoting_client_jni', 141 }, 142 'includes': [ '../build/java_apk.gypi' ], 143 }, # end of target 'remoting_apk' 144 { 145 'target_name': 'remoting_test_apk', 146 'type': 'none', 147 'dependencies': [ 148 '../base/base.gyp:base_java_test_support', 149 'remoting_android_client_java', 150 ], 151 'variables': { 152 'apk_name': 'ChromotingTest', 153 'java_in_dir': 'android/javatests', 154 'is_test_apk': 1, 155 }, 156 'includes': [ '../build/java_apk.gypi' ], 157 }, # end of target 'remoting_test_apk' 158 ], # end of 'targets' 159 'conditions': [ 160 ['enable_cast==1', { 161 'targets': [ 162 { 163 # This jar contains the Google Play services library without the 164 # resources needed for the library to work. See crbug.com/274697 or 165 # ../third_party/android_tools/android_tools.gyp for more info. 166 # This target will fail to build unless you have a local version 167 # of the Google Play services jar. 168 'target_name': 'google_play_services_javalib_no_res', 169 'type': 'none', 170 'variables': { 171 'jar_path': 'android/google-play-services_lib/libs/google-play-services.jar', 172 }, 173 'includes': ['../build/java_prebuilt.gypi'], 174 175 }, # end of target 'google_play_services_javalib_no_res' 176 { 177 # This target contains the Google Play services library with the 178 # resources needed. It will fail to build unless you have a local 179 # version of the Google Play services libary project. 180 # TODO(aiguha): Solve issue of needing to use local version. Also, 181 # watch crbug.com/274697. 182 'target_name': 'google_play_services_javalib', 183 'type': 'none', 184 'variables': { 185 'java_in_dir': 'android/google-play-services_lib/', 186 'R_package': ['com.google.android.gms'], 187 'R_package_relpath': ['com/google/android/gms'], 188 'has_java_resources': 1, 189 'res_v14_verify_only': 1, 190 }, 191 'dependencies': [ 192 'google_play_services_javalib_no_res', 193 ], 194 'includes': ['../build/java.gypi'], 195 }, # end of target 'google_play_services_javalib' 196 ], # end of targets 197 }], 198 ], 199 }], # 'OS=="android"' 200 201 ['OS=="android"', { 202 'targets': [ 203 { 204 'target_name': 'remoting_unittests_apk', 205 'type': 'none', 206 'dependencies': [ 207 'remoting_unittests', 208 ], 209 'variables': { 210 'test_suite_name': 'remoting_unittests', 211 }, 212 'includes': [ '../build/apk_test.gypi' ], 213 }, 214 ], 215 }], # 'OS=="android" 216 ], # end of 'conditions' 217 } 218