OLD | NEW |
1 # Copyright 2015 Google Inc. | 1 # Copyright 2015 Google Inc. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # This GYP file stores the dependencies necessary to build Skia on the Android | 6 # This GYP file stores the dependencies necessary to build Skia on the Android |
7 # platform. The OS doesn't provide many stable libraries as part of the | 7 # platform. The OS doesn't provide many stable libraries as part of the |
8 # distribution so we have to build a few of them ourselves. | 8 # distribution so we have to build a few of them ourselves. |
9 # | 9 # |
10 { | 10 { |
(...skipping 30 matching lines...) Expand all Loading... |
41 'skia_lib.gyp:skia_lib', | 41 'skia_lib.gyp:skia_lib', |
42 'SampleApp.gyp:SampleApp', | 42 'SampleApp.gyp:SampleApp', |
43 ], | 43 ], |
44 'copies': [ | 44 'copies': [ |
45 # Copy all shared libraries into the Android app's libs folder. Note | 45 # Copy all shared libraries into the Android app's libs folder. Note |
46 # that this copy requires us to build SkiaAndroidApp after those | 46 # that this copy requires us to build SkiaAndroidApp after those |
47 # libraries, so that they exist by the time it occurs. If there are no | 47 # libraries, so that they exist by the time it occurs. If there are no |
48 # libraries to copy, this will cause an error in Make, but the app will | 48 # libraries to copy, this will cause an error in Make, but the app will |
49 # still build. | 49 # still build. |
50 { | 50 { |
51 'destination': '<(PRODUCT_DIR)/android/SampleApp/libs/<(android_arch)'
, | 51 'destination': '<(android_base)/apps/sample_app/src/main/libs/<(androi
d_arch)', |
52 'conditions': [ | 52 'conditions': [ |
53 [ 'skia_shared_lib', { | 53 [ 'skia_shared_lib', { |
54 'files': [ | 54 'files': [ |
55 '<(SHARED_LIB_DIR)/libSampleApp.so', | 55 '<(SHARED_LIB_DIR)/libSampleApp.so', |
56 '<(SHARED_LIB_DIR)/libskia_android.so', | 56 '<(SHARED_LIB_DIR)/libskia_android.so', |
57 ]}, { | 57 ]}, { |
58 'files': [ | 58 'files': [ |
59 '<(SHARED_LIB_DIR)/libSampleApp.so', | 59 '<(SHARED_LIB_DIR)/libSampleApp.so', |
60 ]} | 60 ]} |
61 ], | 61 ], |
62 ], | 62 ], |
63 }, | 63 }, |
64 ], | 64 ], |
65 }, | 65 }, |
66 { | 66 { |
67 'target_name': 'SampleApp_APK', | 67 'target_name': 'SampleApp_APK', |
68 'type': 'none', | 68 'type': 'none', |
69 'dependencies': [ | 69 'dependencies': [ |
70 'CopySampleAppDeps', | 70 'CopySampleAppDeps', |
71 ], | 71 ], |
72 'variables': { | |
73 'ANDROID_SDK_ROOT': '<!(echo $ANDROID_SDK_ROOT)', | |
74 # the ninja generator treats PRODUCT_DIR as a relative path to the | |
75 # gyp directory but android ant build wants a path relative to the | |
76 # build.xml file so we do that adjustment here. | |
77 'ANDROID_OUT': '../../<(PRODUCT_DIR)/android/SampleApp' | |
78 }, | |
79 'actions': [ | 72 'actions': [ |
80 { | 73 { |
81 'action_name': 'SampleApp_apk', | 74 'action_name': 'SampleApp_apk', |
82 'inputs': [ | 75 'inputs': [ |
83 '<(android_base)/app/AndroidManifest.xml', | 76 '<(android_base)/apps/sample_app/src/main/AndroidManifest.xml', |
84 '<(android_base)/app/build.xml', | 77 '<(android_base)/apps/sample_app/src/main/jni/com_skia_SkiaSampleRen
derer.h', |
85 '<(android_base)/app/project.properties', | 78 '<(android_base)/apps/sample_app/src/main/jni/com_skia_SkiaSampleRen
derer.cpp', |
86 '<(android_base)/app/jni/com_skia_SkiaSampleRenderer.h', | 79 '<(android_base)/apps/sample_app/src/main/java/com/skia/SkiaSampleAc
tivity.java', |
87 '<(android_base)/app/jni/com_skia_SkiaSampleRenderer.cpp', | 80 '<(android_base)/apps/sample_app/src/main/java/com/skia/SkiaSampleRe
nderer.java', |
88 '<(android_base)/app/src/com/skia/SkiaSampleActivity.java', | 81 '<(android_base)/apps/sample_app/src/main/java/com/skia/SkiaSampleVi
ew.java', |
89 '<(android_base)/app/src/com/skia/SkiaSampleRenderer.java', | |
90 '<(android_base)/app/src/com/skia/SkiaSampleView.java', | |
91 ], | 82 ], |
92 'outputs': [ | 83 'outputs': [ |
93 '<(PRODUCT_DIR)/../android/SampleApp/bin/SampleApp.apk', | 84 '<(android_base)/apps/sample_app/build', |
94 ], | 85 ], |
95 'action': [ | 86 'action': [ |
96 'ant', | 87 '<(android_base)/apps/gradlew', |
97 '-quiet', | 88 ':sample_app:assembleDebug', |
98 '-f', | 89 '-p<(android_base)/apps/sample_app', |
99 '<(android_base)/app/build.xml', | 90 '-PsuppressNativeBuild', |
100 '-Dout.dir=<(ANDROID_OUT)/bin', | |
101 '-Dgen.absolute.dir=<(ANDROID_OUT)/gen', | |
102 '-Dnative.libs.absolute.dir=<(ANDROID_OUT)/libs', | |
103 '-Dout.final.file=<(ANDROID_OUT)/bin/SampleApp.apk', | |
104 '-Dsdk.dir=<(ANDROID_SDK_ROOT)', | |
105 'debug', | |
106 ], | 91 ], |
107 }, | 92 }, |
108 ], | 93 ], |
109 }, | 94 }, |
110 { | 95 { |
111 'target_name': 'CopyVisualBenchDeps', | 96 'target_name': 'CopyVisualBenchDeps', |
112 'type': 'none', | 97 'type': 'none', |
113 'dependencies': [ | 98 'dependencies': [ |
114 'skia_lib.gyp:skia_lib', | 99 'skia_lib.gyp:skia_lib', |
115 'visualbench.gyp:visualbench', | 100 'visualbench.gyp:visualbench', |
116 ], | 101 ], |
117 | 102 |
118 'copies': [ | 103 'copies': [ |
119 # Copy all shared libraries into the Android app's libs folder. Note | 104 # Copy all shared libraries into the Android app's libs folder. Note |
120 # that this copy requires us to build SkiaAndroidApp after those | 105 # that this copy requires us to build SkiaAndroidApp after those |
121 # libraries, so that they exist by the time it occurs. If there are no | 106 # libraries, so that they exist by the time it occurs. If there are no |
122 # libraries to copy, this will cause an error in Make, but the app will | 107 # libraries to copy, this will cause an error in Make, but the app will |
123 # still build. | 108 # still build. |
124 { | 109 { |
125 'destination': '<(PRODUCT_DIR)/android/VisualBench/libs/<(android_arch
)', | 110 'destination': '<(android_base)/apps/visualbench/src/main/libs/<(andro
id_arch)', |
126 'conditions': [ | 111 'conditions': [ |
127 [ 'skia_shared_lib', { | 112 [ 'skia_shared_lib', { |
128 'files': [ | 113 'files': [ |
129 '<(SHARED_LIB_DIR)/libskia_android.so', | 114 '<(SHARED_LIB_DIR)/libskia_android.so', |
130 '<(SHARED_LIB_DIR)/libvisualbench.so', | 115 '<(SHARED_LIB_DIR)/libvisualbench.so', |
131 ]}, { | 116 ]}, { |
132 'files': [ | 117 'files': [ |
133 '<(SHARED_LIB_DIR)/libvisualbench.so', | 118 '<(SHARED_LIB_DIR)/libvisualbench.so', |
134 ]} | 119 ]} |
135 ], | 120 ], |
136 ], | 121 ], |
137 }, | 122 }, |
138 ], | 123 ], |
139 }, | 124 }, |
140 { | 125 { |
141 'target_name': 'VisualBench_APK', | 126 'target_name': 'VisualBench_APK', |
142 'type': 'none', | 127 'type': 'none', |
143 'dependencies': [ | 128 'dependencies': [ |
144 'CopyVisualBenchDeps', | 129 'CopyVisualBenchDeps', |
145 ], | 130 ], |
146 'variables': { | |
147 'ANDROID_SDK_ROOT': '<!(echo $ANDROID_SDK_ROOT)', | |
148 # the ninja generator treats PRODUCT_DIR as a relative path to the | |
149 # gyp directory but android ant build wants a path relative to the | |
150 # build.xml file so we do that adjustment here. | |
151 'ANDROID_OUT': '../../<(PRODUCT_DIR)/android/VisualBench/' | |
152 }, | |
153 'actions': [ | 131 'actions': [ |
154 { | 132 { |
155 'action_name': 'SkiaVisualBench_apk', | 133 'action_name': 'SkiaVisualBench_apk', |
156 'inputs': [ | 134 'inputs': [ |
157 '<(android_base)/visualbench/AndroidManifest.xml', | 135 '<(android_base)/apps/visualbench/src/main/AndroidManifest.xml', |
158 '<(android_base)/visualbench/build.xml', | 136 '<(android_base)/apps/visualbench/src/main/java/com/skia/VisualBench
Activity.java', |
159 '<(android_base)/visualbench/project.properties', | |
160 '<(android_base)/visualbench/src/com/skia/VisualBenchActivity.java', | |
161 ], | 137 ], |
162 'outputs': [ | 138 'outputs': [ |
163 '<(PRODUCT_DIR)/../android/VisualBench/bin/VisualBench.apk', | 139 '<(android_base)/apps/visualbench/build', |
164 ], | 140 ], |
165 'action': [ | 141 'action': [ |
166 'ant', | 142 '<(android_base)/apps/gradlew', |
167 '-quiet', | 143 ':visualbench:assembleDebug', |
168 '-f', | 144 '-p<(android_base)/apps/visualbench', |
169 '<(android_base)/visualbench/build.xml', | 145 '-PsuppressNativeBuild', |
170 '-Dout.dir=<(ANDROID_OUT)/bin', | |
171 '-Dgen.absolute.dir=<(ANDROID_OUT)/gen', | |
172 '-Dnative.libs.absolute.dir=<(ANDROID_OUT)/libs', | |
173 '-Dout.final.file=<(ANDROID_OUT)/bin/VisualBench.apk', | |
174 '-Dsdk.dir=<(ANDROID_SDK_ROOT)', | |
175 'debug', | |
176 ], | 146 ], |
177 }, | 147 }, |
178 ], | 148 ], |
179 }, | 149 }, |
180 ], | 150 ], |
181 } | 151 } |
OLD | NEW |