blob: 624b599bd6770687655c851fb4adb2f974161360 [file] [log] [blame]
djsollen@google.comdcdd57f2013-04-29 12:09:31 +00001{
2 'targets': [
3 {
djsollen@google.comcc95b1a2013-08-12 12:30:04 +00004 'target_name': 'CopySampleAppDeps',
djsollen@google.comdcdd57f2013-04-29 12:09:31 +00005 'type': 'none',
6 'dependencies': [
djsollen@google.com52f02972013-06-03 12:10:19 +00007 'skia_lib.gyp:skia_lib',
djsollen@google.comdcdd57f2013-04-29 12:09:31 +00008 'SampleApp.gyp:SampleApp',
djsollen@google.comdcdd57f2013-04-29 12:09:31 +00009 ],
10 'variables': {
11 'conditions': [
12 [ 'skia_arch_type == "x86"', {
13 'android_arch%': "x86",
14 }, {
15 'conditions': [
djsollen@google.comf7542ba2013-07-31 12:57:27 +000016 [ 'arm_version == 7', {
djsollen@google.comdcdd57f2013-04-29 12:09:31 +000017 'android_arch%': "armeabi-v7a",
18 }, {
19 'android_arch%': "armeabi",
20 }],
21 ],
22 }],
23 ],
24 },
25 'copies': [
djsollen@google.comdcdd57f2013-04-29 12:09:31 +000026 # 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.comd6bab022013-12-02 13:50:38 +000033 '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.comdcdd57f2013-04-29 12:09:31 +000043 ],
44 },
45 ],
46 },
47 {
djsollen@google.comcc95b1a2013-08-12 12:30:04 +000048 'target_name': 'SampleApp_APK',
djsollen@google.comdcdd57f2013-04-29 12:09:31 +000049 'type': 'none',
50 'dependencies': [
djsollen@google.comcc95b1a2013-08-12 12:30:04 +000051 'CopySampleAppDeps',
djsollen@google.comdcdd57f2013-04-29 12:09:31 +000052 ],
53 'variables': {
commit-bot@chromium.orgec1ff6a2014-04-15 21:37:12 +000054 '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.comd1061e22014-04-16 03:04:01 +000057 # build.xml file so we do that adjustment here.
commit-bot@chromium.orgec1ff6a2014-04-15 21:37:12 +000058 'ANDROID_OUT': '../../<(PRODUCT_DIR)/android'
djsollen@google.comdcdd57f2013-04-29 12:09:31 +000059 },
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.comdcdd57f2013-04-29 12:09:31 +000067 '<(android_base)/app/jni/com_skia_SkiaSampleRenderer.h',
68 '<(android_base)/app/jni/com_skia_SkiaSampleRenderer.cpp',
djsollen@google.comdcdd57f2013-04-29 12:09:31 +000069 '<(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.com1c4015a2013-09-30 20:42:10 +000078 '-quiet',
djsollen@google.comdcdd57f2013-04-29 12:09:31 +000079 '-f',
80 '<(android_base)/app/build.xml',
commit-bot@chromium.orgec1ff6a2014-04-15 21:37:12 +000081 '-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.comdcdd57f2013-04-29 12:09:31 +000085 '-Dsdk.dir=<(ANDROID_SDK_ROOT)',
86 'debug',
87 ],
88 },
89 ],
90 },
91 ],
92}