djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 1 | { |
| 2 | 'targets': [ |
| 3 | { |
djsollen@google.com | cc95b1a | 2013-08-12 12:30:04 +0000 | [diff] [blame] | 4 | 'target_name': 'CopySampleAppDeps', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 5 | 'type': 'none', |
| 6 | 'dependencies': [ |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 7 | 'skia_lib.gyp:skia_lib', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 8 | 'SampleApp.gyp:SampleApp', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 9 | ], |
| 10 | 'variables': { |
| 11 | 'conditions': [ |
| 12 | [ 'skia_arch_type == "x86"', { |
| 13 | 'android_arch%': "x86", |
| 14 | }, { |
| 15 | 'conditions': [ |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 16 | [ 'arm_version == 7', { |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 17 | 'android_arch%': "armeabi-v7a", |
| 18 | }, { |
| 19 | 'android_arch%': "armeabi", |
| 20 | }], |
| 21 | ], |
| 22 | }], |
| 23 | ], |
| 24 | }, |
| 25 | 'copies': [ |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 26 | # Copy all shared libraries into the Android app's libs folder. Note |
| 27 | # that this copy requires us to build SkiaAndroidApp after those |
| 28 | # libraries, so that they exist by the time it occurs. If there are no |
| 29 | # libraries to copy, this will cause an error in Make, but the app will |
| 30 | # still build. |
| 31 | { |
| 32 | 'destination': '<(PRODUCT_DIR)/android/libs/<(android_arch)', |
rmistry@google.com | d6bab02 | 2013-12-02 13:50:38 +0000 | [diff] [blame] | 33 | 'conditions': [ |
| 34 | [ 'skia_shared_lib', { |
| 35 | 'files': [ |
| 36 | '<(SHARED_LIB_DIR)/libSampleApp.so', |
| 37 | '<(SHARED_LIB_DIR)/libskia_android.so', |
| 38 | ]}, { |
| 39 | 'files': [ |
| 40 | '<(SHARED_LIB_DIR)/libSampleApp.so', |
| 41 | ]} |
| 42 | ], |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 43 | ], |
| 44 | }, |
| 45 | ], |
| 46 | }, |
| 47 | { |
djsollen@google.com | cc95b1a | 2013-08-12 12:30:04 +0000 | [diff] [blame] | 48 | 'target_name': 'SampleApp_APK', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 49 | 'type': 'none', |
| 50 | 'dependencies': [ |
djsollen@google.com | cc95b1a | 2013-08-12 12:30:04 +0000 | [diff] [blame] | 51 | 'CopySampleAppDeps', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 52 | ], |
| 53 | 'variables': { |
commit-bot@chromium.org | ec1ff6a | 2014-04-15 21:37:12 +0000 | [diff] [blame] | 54 | 'ANDROID_SDK_ROOT': '<!(echo $ANDROID_SDK_ROOT)', |
| 55 | # the ninja generator treats PRODUCT_DIR as a relative path to the |
| 56 | # gyp directory but android ant build wants a path relative to the |
skia.committer@gmail.com | d1061e2 | 2014-04-16 03:04:01 +0000 | [diff] [blame] | 57 | # build.xml file so we do that adjustment here. |
commit-bot@chromium.org | ec1ff6a | 2014-04-15 21:37:12 +0000 | [diff] [blame] | 58 | 'ANDROID_OUT': '../../<(PRODUCT_DIR)/android' |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 59 | }, |
| 60 | 'actions': [ |
| 61 | { |
| 62 | 'action_name': 'SkiaAndroid_apk', |
| 63 | 'inputs': [ |
| 64 | '<(android_base)/app/AndroidManifest.xml', |
| 65 | '<(android_base)/app/build.xml', |
| 66 | '<(android_base)/app/project.properties', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 67 | '<(android_base)/app/jni/com_skia_SkiaSampleRenderer.h', |
| 68 | '<(android_base)/app/jni/com_skia_SkiaSampleRenderer.cpp', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 69 | '<(android_base)/app/src/com/skia/SkiaSampleActivity.java', |
| 70 | '<(android_base)/app/src/com/skia/SkiaSampleRenderer.java', |
| 71 | '<(android_base)/app/src/com/skia/SkiaSampleView.java', |
| 72 | ], |
| 73 | 'outputs': [ |
| 74 | '<(PRODUCT_DIR)/../android/bin/SkiaAndroid.apk', |
| 75 | ], |
| 76 | 'action': [ |
| 77 | 'ant', |
mtklein@google.com | 1c4015a | 2013-09-30 20:42:10 +0000 | [diff] [blame] | 78 | '-quiet', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 79 | '-f', |
| 80 | '<(android_base)/app/build.xml', |
commit-bot@chromium.org | ec1ff6a | 2014-04-15 21:37:12 +0000 | [diff] [blame] | 81 | '-Dout.dir=<(ANDROID_OUT)/bin', |
| 82 | '-Dgen.absolute.dir=<(ANDROID_OUT)/gen', |
| 83 | '-Dnative.libs.absolute.dir=<(ANDROID_OUT)/libs', |
| 84 | '-Dout.final.file=<(ANDROID_OUT)/bin/SkiaAndroid.apk', |
djsollen@google.com | dcdd57f | 2013-04-29 12:09:31 +0000 | [diff] [blame] | 85 | '-Dsdk.dir=<(ANDROID_SDK_ROOT)', |
| 86 | 'debug', |
| 87 | ], |
| 88 | }, |
| 89 | ], |
| 90 | }, |
| 91 | ], |
| 92 | } |