blob: a7565ae9ce3589ebac83c68256a9262d8d856239 [file] [log] [blame]
henrike@webrtc.orga48c91d2013-12-12 16:55:37 +00001# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8{
9 'includes': ['build/common.gypi'],
henrike@webrtc.orga48c91d2013-12-12 16:55:37 +000010 'conditions': [
11 ['OS=="android"', {
12 'targets': [
13 {
14 'target_name': 'libwebrtcdemo-jni',
15 'type': 'loadable_module',
16 'dependencies': [
17 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
18 '<(webrtc_root)/modules/modules.gyp:*',
19 '<(webrtc_root)/test/test.gyp:channel_transport',
20 '<(webrtc_root)/video_engine/video_engine.gyp:video_engine_core',
21 '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
22 ],
23 'sources': [
24 'examples/android/media_demo/jni/jni_helpers.cc',
25 'examples/android/media_demo/jni/on_load.cc',
26 'examples/android/media_demo/jni/video_engine_jni.cc',
27 'examples/android/media_demo/jni/voice_engine_jni.cc',
28 'examples/android/media_demo/jni/media_codec_video_decoder.cc',
29 ],
30 'link_settings': {
31 'libraries': [
32 '-llog',
33 '-lGLESv2',
34 '-lOpenSLES',
35 ],
36 }
37 },
38 {
39 'target_name': 'WebRTCDemo',
40 'type': 'none',
41 'dependencies': [
42 'libwebrtcdemo-jni',
43 '<(modules_java_gyp_path):*',
44 ],
45 'actions': [
46 {
47 # TODO(yujie.mao): Convert building of the demo to a proper GYP
48 # target so this action is not needed once chromium's
49 # apk-building machinery can be used. (crbug.com/225101)
50 'action_name': 'build_webrtcdemo_apk',
51 'variables': {
52 'android_webrtc_demo_root': '<(webrtc_root)/examples/android/media_demo',
fischman@webrtc.org29975da2013-12-20 22:49:35 +000053 'ant_log': '../../../<(INTERMEDIATE_DIR)/ant.log', # ../../.. to compensate for the cd below.
henrike@webrtc.orga48c91d2013-12-12 16:55:37 +000054 },
55 'inputs' : [
56 '<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar',
57 '<(PRODUCT_DIR)/lib.java/video_capture_module_java.jar',
58 '<(PRODUCT_DIR)/lib.java/video_render_module_java.jar',
59 '<(PRODUCT_DIR)/libwebrtcdemo-jni.so',
60 '<!@(find <(android_webrtc_demo_root)/src -name "*.java")',
61 '<!@(find <(android_webrtc_demo_root)/res -type f)',
62 '<(android_webrtc_demo_root)/AndroidManifest.xml',
63 '<(android_webrtc_demo_root)/build.xml',
64 '<(android_webrtc_demo_root)/project.properties',
65 ],
66 'outputs': ['<(PRODUCT_DIR)/WebRTCDemo-debug.apk'],
fischman@webrtc.org29975da2013-12-20 22:49:35 +000067 'action': [
68 'bash', '-ec',
69 'rm -fr <(_outputs) <(android_webrtc_demo_root)/{bin,libs} && '
70 'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below
71 'mkdir -p <(android_webrtc_demo_root)/libs/<(android_app_abi) && '
72 'cp <(PRODUCT_DIR)/lib.java/audio_device_module_java.jar <(android_webrtc_demo_root)/libs/ &&'
73 'cp <(PRODUCT_DIR)/lib.java/video_capture_module_java.jar <(android_webrtc_demo_root)/libs/ &&'
74 'cp <(PRODUCT_DIR)/lib.java/video_render_module_java.jar <(android_webrtc_demo_root)/libs/ &&'
75 '<(android_strip) -o <(android_webrtc_demo_root)/libs/<(android_app_abi)/libwebrtcdemo-jni.so <(PRODUCT_DIR)/libwebrtcdemo-jni.so && '
76 'cd <(android_webrtc_demo_root) && '
77 '{ ant -q -l <(ant_log) debug || '
78 ' { cat <(ant_log) ; exit 1; } } && '
79 'cd - > /dev/null && '
80 'cp <(android_webrtc_demo_root)/bin/WebRTCDemo-debug.apk <(_outputs)'
81 ],
henrike@webrtc.orga48c91d2013-12-12 16:55:37 +000082 },
83 ],
84 },
henrike@webrtc.org4be4e8a2014-01-17 23:12:51 +000085 {
86 'target_name': 'libopensl-demo-jni',
87 'type': 'loadable_module',
88 'dependencies': [
89 '<(webrtc_root)/modules/modules.gyp:audio_device',
90 ],
91 'sources': [
92 'examples/android/opensl_loopback/jni/opensl_runner.cc',
93 'examples/android/opensl_loopback/fake_audio_device_buffer.cc',
94 ],
95 'link_settings': {
96 'libraries': [
97 '-llog',
98 '-lOpenSLES',
99 ],
100 },
101 },
102 {
103 'target_name': 'OpenSlDemo',
104 'type': 'none',
105 'dependencies': [
106 'libopensl-demo-jni',
107 '<(modules_java_gyp_path):*',
108 ],
109 'actions': [
110 {
111 # TODO(henrik): Convert building of the demo to a proper GYP
112 # target so this action is not needed once chromium's
113 # apk-building machinery can be used. (crbug.com/225101)
114 'action_name': 'build_opensldemo_apk',
115 'variables': {
116 'android_opensl_demo_root': '<(webrtc_root)/examples/android/opensl_loopback',
117 'ant_log': '../../../<(INTERMEDIATE_DIR)/ant.log', # ../../.. to compensate for the cd below.
118 },
119 'inputs' : [
120 '<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar',
121 '<(PRODUCT_DIR)/libopensl-demo-jni.so',
122 '<!@(find <(android_opensl_demo_root)/src -name "*.java")',
123 '<!@(find <(android_opensl_demo_root)/res -name "*.xml")',
124 '<!@(find <(android_opensl_demo_root)/res -name "*.png")',
125 '<(android_opensl_demo_root)/AndroidManifest.xml',
126 '<(android_opensl_demo_root)/build.xml',
127 '<(android_opensl_demo_root)/project.properties',
128 ],
129 'outputs': ['<(PRODUCT_DIR)/OpenSlDemo-debug.apk'],
130 'action': [
131 'bash', '-ec',
132 'rm -f <(_outputs) && '
133 'mkdir -p <(android_opensl_demo_root)/libs/<(android_app_abi) && '
134 'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below
135 '<(android_strip) -o <(android_opensl_demo_root)/libs/<(android_app_abi)/libopensl-demo-jni.so <(PRODUCT_DIR)/libopensl-demo-jni.so && '
136 'cp <(PRODUCT_DIR)/lib.java/audio_device_module_java.jar <(android_opensl_demo_root)/libs/ &&'
137 'cd <(android_opensl_demo_root) && '
138 '{ ant -q -l <(ant_log) debug || '
139 ' { cat <(ant_log) ; exit 1; } } && '
140 'cd - > /dev/null && '
141 'cp <(android_opensl_demo_root)/bin/OpenSlDemo-debug.apk <(_outputs)'
142 ],
143 },
144 ],
145 },
henrike@webrtc.orga48c91d2013-12-12 16:55:37 +0000146 ],
147 }],
148 ],
149}