From f1f558cde8efd4e95efd6ccb85194440a2b68a5c Mon Sep 17 00:00:00 2001 From: "glaznev@webrtc.org" Date: Sat, 14 Mar 2015 02:48:16 +0000 Subject: [PATCH] Fix AppRTCDemo and AppRTCDemoTest builds. On fresh checkout AppRTCDemo and corresponding tests fail to build because resource file R.java is not auto generated properly. On existing tree R.java will be picked up from previous build leftover at talk/examples/android/gen. Build bots did not detect this break for some reason. R=wzh@webrtc.org Review URL: https://webrtc-codereview.appspot.com/43749004 Cr-Commit-Position: refs/heads/master@{#8723} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8723 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/libjingle_examples.gyp | 39 +++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/talk/libjingle_examples.gyp b/talk/libjingle_examples.gyp index c3d2fe97d8..097270856b 100755 --- a/talk/libjingle_examples.gyp +++ b/talk/libjingle_examples.gyp @@ -317,10 +317,16 @@ { 'target_name': 'AppRTCDemo', 'type': 'none', + 'dependencies': [ + 'libjingle.gyp:libjingle_peerconnection_java', + ], 'variables': { 'apk_name': 'AppRTCDemo', 'java_in_dir': 'examples/android', + 'has_java_resources': 1, 'resource_dir': 'examples/android/res', + 'R_package': 'org.appspot.apprtc', + 'R_package_relpath': 'org/appspot/apprtc', 'input_jars_paths': [ 'examples/android/third_party/autobanh/autobanh.jar', ], @@ -328,32 +334,35 @@ 'examples/android/third_party/autobanh/autobanh.jar', ], 'native_lib_target': 'libjingle_peerconnection_so', + 'add_to_dependents_classpaths':1, }, - 'dependencies': [ - 'libjingle.gyp:libjingle_peerconnection_java', - ], 'includes': [ '../build/java_apk.gypi' ], }, # target AppRTCDemo - ], # targets - }], # OS=="android" - ['OS=="android"', { - 'targets': [ + { + # AppRTCDemo creates a .jar as a side effect. Any java targets + # that need that .jar in their classpath should depend on this target, + # AppRTCDemo_apk. Dependents of AppRTCDemo_apk receive its + # jar path in the variable 'apk_output_jar_path'. + # This target should only be used by targets which instrument + # AppRTCDemo_apk. + 'target_name': 'AppRTCDemo_apk', + 'type': 'none', + 'dependencies': [ + 'AppRTCDemo', + ], + 'includes': [ '../build/apk_fake_jar.gypi' ], + }, # target AppRTCDemo_apk + { 'target_name': 'AppRTCDemoTest', 'type': 'none', 'dependencies': [ - 'AppRTCDemo', - ], + 'AppRTCDemo_apk', + ], 'variables': { 'apk_name': 'AppRTCDemoTest', 'java_in_dir': 'examples/androidtests', - 'additional_src_dirs': [ - 'examples/android', - ], - 'input_jars_paths': [ - 'examples/android/third_party/autobanh/autobanh.jar', - ], 'is_test_apk': 1, }, 'includes': [ '../build/java_apk.gypi' ],