blob: 84ac3ba346280d17ad49dbe36ffe9f63cb497c02 [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'],
10
11 'conditions': [
12 ['OS=="android"', {
13 'targets': [
14 {
15 'target_name': 'libwebrtcdemo-jni',
16 'type': 'loadable_module',
17 'dependencies': [
18 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
19 '<(webrtc_root)/modules/modules.gyp:*',
20 '<(webrtc_root)/test/test.gyp:channel_transport',
21 '<(webrtc_root)/video_engine/video_engine.gyp:video_engine_core',
22 '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
23 ],
24 'sources': [
25 'examples/android/media_demo/jni/jni_helpers.cc',
26 'examples/android/media_demo/jni/on_load.cc',
27 'examples/android/media_demo/jni/video_engine_jni.cc',
28 'examples/android/media_demo/jni/voice_engine_jni.cc',
29 'examples/android/media_demo/jni/media_codec_video_decoder.cc',
30 ],
31 'link_settings': {
32 'libraries': [
33 '-llog',
34 '-lGLESv2',
35 '-lOpenSLES',
36 ],
37 }
38 },
39 {
40 'target_name': 'WebRTCDemo',
41 'type': 'none',
42 'dependencies': [
43 'libwebrtcdemo-jni',
44 '<(modules_java_gyp_path):*',
45 ],
46 'actions': [
47 {
48 # TODO(yujie.mao): Convert building of the demo to a proper GYP
49 # target so this action is not needed once chromium's
50 # apk-building machinery can be used. (crbug.com/225101)
51 'action_name': 'build_webrtcdemo_apk',
52 'variables': {
53 'android_webrtc_demo_root': '<(webrtc_root)/examples/android/media_demo',
54 },
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'],
67 'action': ['bash', '-ec',
68 'rm -fr <(_outputs) <(android_webrtc_demo_root)/{bin,libs} && '
69 'mkdir -p <(android_webrtc_demo_root)/libs/<(android_app_abi) && '
70 'cp <(PRODUCT_DIR)/lib.java/audio_device_module_java.jar <(android_webrtc_demo_root)/libs/ &&'
71 'cp <(PRODUCT_DIR)/lib.java/video_capture_module_java.jar <(android_webrtc_demo_root)/libs/ &&'
72 'cp <(PRODUCT_DIR)/lib.java/video_render_module_java.jar <(android_webrtc_demo_root)/libs/ &&'
73 '<(android_strip) -o <(android_webrtc_demo_root)/libs/<(android_app_abi)/libwebrtcdemo-jni.so <(PRODUCT_DIR)/libwebrtcdemo-jni.so && '
74 'cd <(android_webrtc_demo_root) && '
75 'ant debug && '
76 'cd - && '
77 'cp <(android_webrtc_demo_root)/bin/WebRTCDemo-debug.apk <(_outputs)'
78 ],
79 },
80 ],
81 },
82 ],
83 }],
84 ],
85}