henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 1 | # 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.org | 3902054 | 2014-09-27 18:10:30 +0000 | [diff] [blame] | 10 | 'targets': [], |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 11 | 'conditions': [ |
| 12 | ['OS=="android"', { |
| 13 | 'targets': [ |
| 14 | { |
| 15 | 'target_name': 'libwebrtcdemo-jni', |
| 16 | 'type': 'loadable_module', |
| 17 | 'dependencies': [ |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 +0000 | [diff] [blame] | 18 | '<(webrtc_root)/common.gyp:webrtc_common', |
kjellander@webrtc.org | 853049f | 2015-01-20 11:40:45 +0000 | [diff] [blame] | 19 | '<(webrtc_root)/modules/modules.gyp:video_render_module_internal_impl', |
andresp@webrtc.org | 86e1e48 | 2015-01-14 09:30:52 +0000 | [diff] [blame] | 20 | '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default', |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 21 | '<(webrtc_root)/test/test.gyp:channel_transport', |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 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', |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 27 | 'examples/android/media_demo/jni/voice_engine_jni.cc', |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 28 | ], |
Henrik Kjellander | e6cefb6 | 2015-04-27 14:39:04 +0200 | [diff] [blame] | 29 | 'conditions': [ |
| 30 | ['build_icu==1', { |
| 31 | 'dependencies': [ |
| 32 | '<(DEPTH)/third_party/icu/icu.gyp:icuuc', |
| 33 | ], |
| 34 | }], |
| 35 | ], |
phoglund@webrtc.org | 5e3fea1 | 2015-02-24 14:50:53 +0000 | [diff] [blame] | 36 | '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.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 41 | '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.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 64 | 'ant_log': '../../../<(INTERMEDIATE_DIR)/ant.log', # ../../.. to compensate for the cd below. |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 65 | }, |
| 66 | 'inputs' : [ |
| 67 | '<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar', |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 68 | '<(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.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 76 | 'action': [ |
| 77 | 'bash', '-ec', |
kjellander@webrtc.org | d68fa65 | 2015-02-28 11:17:33 +0000 | [diff] [blame] | 78 | 'rm -fr <(_outputs) <(android_webrtc_demo_root)/{bin,libs,gen,obj} && ' |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 79 | '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.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 82 | '<(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.org | 6e105ed | 2014-04-15 08:35:00 +0000 | [diff] [blame] | 84 | '{ ANDROID_SDK_ROOT=<(android_sdk_root) ' |
| 85 | 'ant debug > <(ant_log) 2>&1 || ' |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 86 | ' { cat <(ant_log) ; exit 1; } } && ' |
| 87 | 'cd - > /dev/null && ' |
| 88 | 'cp <(android_webrtc_demo_root)/bin/WebRTCDemo-debug.apk <(_outputs)' |
| 89 | ], |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 90 | }, |
| 91 | ], |
| 92 | }, |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 93 | ], |
| 94 | }], |
| 95 | ], |
| 96 | } |