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 | ], |
phoglund@webrtc.org | 5e3fea1 | 2015-02-24 14:50:53 +0000 | [diff] [blame] | 29 | 'variables': { |
| 30 | # This library uses native JNI exports; tell GYP so that the |
| 31 | # required symbols will be kept. |
| 32 | 'use_native_jni_exports': 1, |
| 33 | }, |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 34 | 'link_settings': { |
| 35 | 'libraries': [ |
| 36 | '-llog', |
| 37 | '-lGLESv2', |
| 38 | '-lOpenSLES', |
| 39 | ], |
| 40 | } |
| 41 | }, |
| 42 | { |
| 43 | 'target_name': 'WebRTCDemo', |
| 44 | 'type': 'none', |
| 45 | 'dependencies': [ |
| 46 | 'libwebrtcdemo-jni', |
| 47 | '<(modules_java_gyp_path):*', |
| 48 | ], |
| 49 | 'actions': [ |
| 50 | { |
| 51 | # TODO(yujie.mao): Convert building of the demo to a proper GYP |
| 52 | # target so this action is not needed once chromium's |
| 53 | # apk-building machinery can be used. (crbug.com/225101) |
| 54 | 'action_name': 'build_webrtcdemo_apk', |
| 55 | 'variables': { |
| 56 | 'android_webrtc_demo_root': '<(webrtc_root)/examples/android/media_demo', |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 57 | '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] | 58 | }, |
| 59 | 'inputs' : [ |
| 60 | '<(PRODUCT_DIR)/lib.java/audio_device_module_java.jar', |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 61 | '<(PRODUCT_DIR)/libwebrtcdemo-jni.so', |
| 62 | '<!@(find <(android_webrtc_demo_root)/src -name "*.java")', |
| 63 | '<!@(find <(android_webrtc_demo_root)/res -type f)', |
| 64 | '<(android_webrtc_demo_root)/AndroidManifest.xml', |
| 65 | '<(android_webrtc_demo_root)/build.xml', |
| 66 | '<(android_webrtc_demo_root)/project.properties', |
| 67 | ], |
| 68 | 'outputs': ['<(PRODUCT_DIR)/WebRTCDemo-debug.apk'], |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 69 | 'action': [ |
| 70 | 'bash', '-ec', |
kjellander@webrtc.org | d68fa65 | 2015-02-28 11:17:33 +0000 | [diff] [blame] | 71 | 'rm -fr <(_outputs) <(android_webrtc_demo_root)/{bin,libs,gen,obj} && ' |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 72 | 'mkdir -p <(INTERMEDIATE_DIR) && ' # Must happen _before_ the cd below |
| 73 | 'mkdir -p <(android_webrtc_demo_root)/libs/<(android_app_abi) && ' |
| 74 | '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] | 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) && ' |
kjellander@webrtc.org | 6e105ed | 2014-04-15 08:35:00 +0000 | [diff] [blame] | 77 | '{ ANDROID_SDK_ROOT=<(android_sdk_root) ' |
| 78 | 'ant debug > <(ant_log) 2>&1 || ' |
fischman@webrtc.org | 000dde9 | 2013-12-20 22:49:35 +0000 | [diff] [blame] | 79 | ' { cat <(ant_log) ; exit 1; } } && ' |
| 80 | 'cd - > /dev/null && ' |
| 81 | 'cp <(android_webrtc_demo_root)/bin/WebRTCDemo-debug.apk <(_outputs)' |
| 82 | ], |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 83 | }, |
| 84 | ], |
| 85 | }, |
henrike@webrtc.org | 451745e | 2013-12-12 16:55:37 +0000 | [diff] [blame] | 86 | ], |
| 87 | }], |
| 88 | ], |
| 89 | } |