[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 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', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 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', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 26 | 'remoting_jni_headers', |
| 27 | 'remoting_protocol', |
| 28 | '../google_apis/google_apis.gyp:google_apis', |
[email protected] | 7f222ef | 2014-06-18 00:37:35 | [diff] [blame] | 29 | '../ui/gfx/gfx.gyp:gfx', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 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 | }, |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 54 | ], |
| 55 | }, # end of target 'remoting_android_resources' |
| 56 | { |
[email protected] | d21f4831 | 2014-02-05 13:01:38 | [diff] [blame] | 57 | 'target_name': 'remoting_apk_manifest', |
| 58 | 'type': 'none', |
[email protected] | 5f876583 | 2014-08-15 16:19:37 | [diff] [blame] | 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 | }], |
[email protected] | d21f4831 | 2014-02-05 13:01:38 | [diff] [blame] | 69 | ], |
| 70 | 'rules': [{ |
| 71 | 'rule_name': 'generate_manifest', |
| 72 | 'extension': 'jinja2', |
| 73 | 'inputs': [ |
| 74 | '<(remoting_localize_path)', |
| 75 | '<(branding_path)', |
[email protected] | d21f4831 | 2014-02-05 13:01:38 | [diff] [blame] | 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 | { |
[email protected] | 248c476 | 2014-04-23 22:06:30 | [diff] [blame] | 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', |
[email protected] | 5f876583 | 2014-08-15 16:19:37 | [diff] [blame] | 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', |
qinmin | 22b4115 | 2014-08-27 23:01:21 | [diff] [blame] | 110 | '../third_party/android_tools/android_tools.gyp:android_support_v13_javalib', |
[email protected] | 248c476 | 2014-04-23 22:06:30 | [diff] [blame] | 111 | ], |
| 112 | 'includes': [ '../build/java.gypi' ], |
[email protected] | 5f876583 | 2014-08-15 16:19:37 | [diff] [blame] | 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 | ], |
[email protected] | 248c476 | 2014-04-23 22:06:30 | [diff] [blame] | 125 | }, |
| 126 | { |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 127 | 'target_name': 'remoting_apk', |
| 128 | 'type': 'none', |
| 129 | 'dependencies': [ |
[email protected] | d21f4831 | 2014-02-05 13:01:38 | [diff] [blame] | 130 | 'remoting_apk_manifest', |
| 131 | 'remoting_client_jni', |
[email protected] | 248c476 | 2014-04-23 22:06:30 | [diff] [blame] | 132 | 'remoting_android_client_java', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 133 | ], |
| 134 | 'variables': { |
[email protected] | a3d61a1 | 2014-01-16 23:15:39 | [diff] [blame] | 135 | 'apk_name': '<!(python <(version_py_path) -f <(branding_path) -t "@APK_FILE_NAME@")', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 136 | 'android_app_version_name': '<(version_full)', |
[email protected] | 91029e6 | 2014-01-14 06:16:04 | [diff] [blame] | 137 | 'android_app_version_code': '<!(python tools/android_version.py <(android_app_version_name))', |
[email protected] | d21f4831 | 2014-02-05 13:01:38 | [diff] [blame] | 138 | 'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/remoting/android/AndroidManifest.xml', |
[email protected] | 248c476 | 2014-04-23 22:06:30 | [diff] [blame] | 139 | 'java_in_dir': 'android/apk', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 140 | 'native_lib_target': 'libremoting_client_jni', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 141 | }, |
| 142 | 'includes': [ '../build/java_apk.gypi' ], |
| 143 | }, # end of target 'remoting_apk' |
| 144 | { |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 145 | 'target_name': 'remoting_test_apk', |
| 146 | 'type': 'none', |
| 147 | 'dependencies': [ |
| 148 | '../base/base.gyp:base_java_test_support', |
[email protected] | 248c476 | 2014-04-23 22:06:30 | [diff] [blame] | 149 | 'remoting_android_client_java', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 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' |
[email protected] | 5f876583 | 2014-08-15 16:19:37 | [diff] [blame] | 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 | ], |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 199 | }], # 'OS=="android"' |
| 200 | |
[email protected] | 568c1296 | 2014-05-28 13:43:31 | [diff] [blame] | 201 | ['OS=="android"', { |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 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', |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 211 | }, |
| 212 | 'includes': [ '../build/apk_test.gypi' ], |
| 213 | }, |
| 214 | ], |
[email protected] | 568c1296 | 2014-05-28 13:43:31 | [diff] [blame] | 215 | }], # 'OS=="android" |
[email protected] | 1f51d659 | 2014-01-09 12:34:07 | [diff] [blame] | 216 | ], # end of 'conditions' |
| 217 | } |