blob: 51a8265babac495aceeaa0c48a53a0532d13f8a3 [file] [log] [blame]
henrike@webrtc.org451745e2013-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'],
kjellander@webrtc.org39020542014-09-27 18:10:30 +000010 'targets': [],
henrike@webrtc.org451745e2013-12-12 16:55:37 +000011 'conditions': [
12 ['OS=="android"', {
13 'targets': [
14 {
15 'target_name': 'libwebrtcdemo-jni',
16 'type': 'loadable_module',
17 'dependencies': [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +000018 '<(webrtc_root)/common.gyp:webrtc_common',
kjellander@webrtc.org853049f2015-01-20 11:40:45 +000019 '<(webrtc_root)/modules/modules.gyp:video_render_module_internal_impl',
andresp@webrtc.org86e1e482015-01-14 09:30:52 +000020 '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
henrike@webrtc.org451745e2013-12-12 16:55:37 +000021 '<(webrtc_root)/test/test.gyp:channel_transport',
henrike@webrtc.org451745e2013-12-12 16:55:37 +000022 '<(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',
henrike@webrtc.org451745e2013-12-12 16:55:37 +000027 'examples/android/media_demo/jni/voice_engine_jni.cc',
henrike@webrtc.org451745e2013-12-12 16:55:37 +000028 ],
Henrik Kjellandere6cefb62015-04-27 14:39:04 +020029 'conditions': [
30 ['build_icu==1', {
31 'dependencies': [
32 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
33 ],
34 }],
35 ],
phoglund@webrtc.org5e3fea12015-02-24 14:50:53 +000036 'variables': {
37 # This library uses native JNI exports; tell GYP so that the
38 # required symbols will be kept.
39 'use_native_jni_exports': 1,
40 },
henrike@webrtc.org451745e2013-12-12 16:55:37 +000041 'link_settings': {
42 'libraries': [
43 '-llog',
44 '-lGLESv2',
45 '-lOpenSLES',
46 ],
47 }
48 },
49 {
50 'target_name': 'WebRTCDemo',
51 'type': 'none',
52 'dependencies': [
53 'libwebrtcdemo-jni',
54 '<(modules_java_gyp_path):*',
55 ],
56 'actions': [
57 {
58 # TODO(yujie.mao): Convert building of the demo to a proper GYP
59 # target so this action is not needed once chromium's
60 # apk-building machinery can be used. (crbug.com/225101)
61 'action_name': 'build_webrtcdemo_apk',
62 'variables': {
63 'android_webrtc_demo_root': '<(webrtc_root)/examples/android/media_demo',
fischman@webrtc.org000dde92013-12-20 22:49:35 +000064 'ant_log': '../../../<(INTERMEDIATE_DIR)/ant.log', # ../../.. to compensate for the cd below.
henrike@webrtc.org451745e2013-12-12 16:55:37 +000065 },
66 'inputs' : [
67 '<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar',
henrike@webrtc.org451745e2013-12-12 16:55:37 +000068 '<(PRODUCT_DIR)/libwebrtcdemo-jni.so',
69 '<!@(find <(android_webrtc_demo_root)/src -name "*.java")',
70 '<!@(find <(android_webrtc_demo_root)/res -type f)',
71 '<(android_webrtc_demo_root)/AndroidManifest.xml',
72 '<(android_webrtc_demo_root)/build.xml',
73 '<(android_webrtc_demo_root)/project.properties',
74 ],
75 'outputs': ['<(PRODUCT_DIR)/WebRTCDemo-debug.apk'],
fischman@webrtc.org000dde92013-12-20 22:49:35 +000076 'action': [
77 'bash', '-ec',
kjellander@webrtc.orgd68fa652015-02-28 11:17:33 +000078 'rm -fr <(_outputs) <(android_webrtc_demo_root)/{bin,libs,gen,obj} && '
fischman@webrtc.org000dde92013-12-20 22:49:35 +000079 'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below
80 'mkdir -p <(android_webrtc_demo_root)/libs/<(android_app_abi) && '
81 'cp <(PRODUCT_DIR)/lib.java/audio_device_module_java.jar <(android_webrtc_demo_root)/libs/ &&'
fischman@webrtc.org000dde92013-12-20 22:49:35 +000082 '<(android_strip) -o <(android_webrtc_demo_root)/libs/<(android_app_abi)/libwebrtcdemo-jni.so <(PRODUCT_DIR)/libwebrtcdemo-jni.so && '
83 'cd <(android_webrtc_demo_root) && '
kjellander@webrtc.org6e105ed2014-04-15 08:35:00 +000084 '{ ANDROID_SDK_ROOT=<(android_sdk_root) '
85 'ant debug > <(ant_log) 2>&1 || '
fischman@webrtc.org000dde92013-12-20 22:49:35 +000086 ' { cat <(ant_log) ; exit 1; } } && '
87 'cd - > /dev/null && '
88 'cp <(android_webrtc_demo_root)/bin/WebRTCDemo-debug.apk <(_outputs)'
89 ],
henrike@webrtc.org451745e2013-12-12 16:55:37 +000090 },
91 ],
92 },
henrike@webrtc.org451745e2013-12-12 16:55:37 +000093 ],
94 }],
95 ],
96}