| 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 { |
| 11 'variables': { | 11 'variables': { |
| 12 'conditions': [ | 12 'conditions': [ |
| 13 [ 'skia_arch_type == "arm" and arm_version != 7', { | 13 [ 'skia_arch_type == "arm" and arm_version != 7', { |
| 14 'android_arch%': "armeabi", | 14 'android_arch%': "armeabi", |
| 15 'android_variant%': "arm", |
| 15 }], | 16 }], |
| 16 [ 'skia_arch_type == "arm" and arm_version == 7', { | 17 [ 'skia_arch_type == "arm" and arm_version == 7', { |
| 17 'android_arch%': "armeabi-v7a", | 18 'android_arch%': "armeabi-v7a", |
| 19 'android_variant%': "arm", |
| 18 }], | 20 }], |
| 19 [ 'skia_arch_type == "arm64"', { | 21 [ 'skia_arch_type == "arm64"', { |
| 20 'android_arch%': "arm64-v8a", | 22 'android_arch%': "arm64-v8a", |
| 23 'android_variant%': "arm64", |
| 21 }], | 24 }], |
| 22 [ 'skia_arch_type == "x86"', { | 25 [ 'skia_arch_type == "x86"', { |
| 23 'android_arch%': "x86", | 26 'android_arch%': "x86", |
| 27 'android_variant%': "x86", |
| 24 }], | 28 }], |
| 25 [ 'skia_arch_type == "x86_64"', { | 29 [ 'skia_arch_type == "x86_64"', { |
| 26 'android_arch%': "x86_64", | 30 'android_arch%': "x86_64", |
| 31 'android_variant%': "x86_64", |
| 27 }], | 32 }], |
| 28 [ 'skia_arch_type == "mips" and skia_arch_width == 32', { | 33 [ 'skia_arch_type == "mips" and skia_arch_width == 32', { |
| 29 'android_arch%': "mips", | 34 'android_arch%': "mips", |
| 35 'android_variant%': "mips", |
| 30 }], | 36 }], |
| 31 [ 'skia_arch_type == "mips" and skia_arch_width == 64', { | 37 [ 'skia_arch_type == "mips" and skia_arch_width == 64', { |
| 32 'android_arch%': "mips64", | 38 'android_arch%': "mips64", |
| 39 'android_variant%': "mips64", |
| 33 }], | 40 }], |
| 34 ], | 41 ], |
| 35 }, | 42 }, |
| 36 'targets': [ | 43 'targets': [ |
| 37 { | 44 { |
| 38 'target_name': 'CopySampleAppDeps', | 45 'target_name': 'CopySampleAppDeps', |
| 39 'type': 'none', | 46 'type': 'none', |
| 40 'dependencies': [ | 47 'dependencies': [ |
| 41 'skia_lib.gyp:skia_lib', | 48 'skia_lib.gyp:skia_lib', |
| 42 'SampleApp.gyp:SampleApp', | 49 'SampleApp.gyp:SampleApp', |
| 43 ], | 50 ], |
| 44 'copies': [ | 51 'copies': [ |
| 45 # Copy all shared libraries into the Android app's libs folder. Note | 52 # Copy all shared libraries into the Android app's libs folder. Note |
| 46 # that this copy requires us to build SkiaAndroidApp after those | 53 # 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 | 54 # 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 | 55 # libraries to copy, this will cause an error in Make, but the app will |
| 49 # still build. | 56 # still build. |
| 50 { | 57 { |
| 51 'destination': '<(PRODUCT_DIR)/android/SampleApp/libs/<(android_arch)'
, | 58 'destination': '<(android_base)/apps/sample_app/src/main/libs/<(androi
d_arch)', |
| 52 'conditions': [ | 59 'conditions': [ |
| 53 [ 'skia_shared_lib', { | 60 [ 'skia_shared_lib', { |
| 54 'files': [ | 61 'files': [ |
| 55 '<(SHARED_LIB_DIR)/libSampleApp.so', | 62 '<(SHARED_LIB_DIR)/libSampleApp.so', |
| 56 '<(SHARED_LIB_DIR)/libskia_android.so', | 63 '<(SHARED_LIB_DIR)/libskia_android.so', |
| 57 ]}, { | 64 ]}, { |
| 58 'files': [ | 65 'files': [ |
| 59 '<(SHARED_LIB_DIR)/libSampleApp.so', | 66 '<(SHARED_LIB_DIR)/libSampleApp.so', |
| 60 ]} | 67 ]} |
| 61 ], | 68 ], |
| 62 ], | 69 ], |
| 63 }, | 70 }, |
| 64 ], | 71 ], |
| 65 }, | 72 }, |
| 66 { | 73 { |
| 67 'target_name': 'SampleApp_APK', | 74 'target_name': 'SampleApp_APK', |
| 68 'type': 'none', | 75 'type': 'none', |
| 69 'dependencies': [ | 76 'dependencies': [ |
| 70 'CopySampleAppDeps', | 77 'CopySampleAppDeps', |
| 71 ], | 78 ], |
| 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': [ | 79 'actions': [ |
| 80 { | 80 { |
| 81 'action_name': 'SampleApp_apk', | 81 'action_name': 'SampleApp_apk', |
| 82 'inputs': [ | 82 'inputs': [ |
| 83 '<(android_base)/app/AndroidManifest.xml', | 83 '<(android_base)/apps/sample_app/src/main/AndroidManifest.xml', |
| 84 '<(android_base)/app/build.xml', | 84 '<(android_base)/apps/sample_app/src/main/jni/com_skia_SkiaSampleRen
derer.h', |
| 85 '<(android_base)/app/project.properties', | 85 '<(android_base)/apps/sample_app/src/main/jni/com_skia_SkiaSampleRen
derer.cpp', |
| 86 '<(android_base)/app/jni/com_skia_SkiaSampleRenderer.h', | 86 '<(android_base)/apps/sample_app/src/main/java/com/skia/SkiaSampleAc
tivity.java', |
| 87 '<(android_base)/app/jni/com_skia_SkiaSampleRenderer.cpp', | 87 '<(android_base)/apps/sample_app/src/main/java/com/skia/SkiaSampleRe
nderer.java', |
| 88 '<(android_base)/app/src/com/skia/SkiaSampleActivity.java', | 88 '<(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 ], | 89 ], |
| 92 'outputs': [ | 90 'outputs': [ |
| 93 '<(PRODUCT_DIR)/../android/SampleApp/bin/SampleApp.apk', | 91 '<(android_base)/apps/sample_app/build', |
| 94 ], | 92 ], |
| 95 'action': [ | 93 'action': [ |
| 96 'ant', | 94 '<(android_base)/apps/gradlew', |
| 97 '-quiet', | 95 ':sample_app:assemble<(android_variant)Debug', |
| 98 '-f', | 96 '-p<(android_base)/apps/sample_app', |
| 99 '<(android_base)/app/build.xml', | 97 '-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 ], | 98 ], |
| 107 }, | 99 }, |
| 108 ], | 100 ], |
| 109 }, | 101 }, |
| 110 { | 102 { |
| 111 'target_name': 'CopyVisualBenchDeps', | 103 'target_name': 'CopyVisualBenchDeps', |
| 112 'type': 'none', | 104 'type': 'none', |
| 113 'dependencies': [ | 105 'dependencies': [ |
| 114 'skia_lib.gyp:skia_lib', | 106 'skia_lib.gyp:skia_lib', |
| 115 'visualbench.gyp:visualbench', | 107 'visualbench.gyp:visualbench', |
| 116 ], | 108 ], |
| 117 | 109 |
| 118 'copies': [ | 110 'copies': [ |
| 119 # Copy all shared libraries into the Android app's libs folder. Note | 111 # Copy all shared libraries into the Android app's libs folder. Note |
| 120 # that this copy requires us to build SkiaAndroidApp after those | 112 # 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 | 113 # 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 | 114 # libraries to copy, this will cause an error in Make, but the app will |
| 123 # still build. | 115 # still build. |
| 124 { | 116 { |
| 125 'destination': '<(PRODUCT_DIR)/android/VisualBench/libs/<(android_arch
)', | 117 'destination': '<(android_base)/apps/visualbench/src/main/libs/<(andro
id_arch)', |
| 126 'conditions': [ | 118 'conditions': [ |
| 127 [ 'skia_shared_lib', { | 119 [ 'skia_shared_lib', { |
| 128 'files': [ | 120 'files': [ |
| 129 '<(SHARED_LIB_DIR)/libskia_android.so', | 121 '<(SHARED_LIB_DIR)/libskia_android.so', |
| 130 '<(SHARED_LIB_DIR)/libvisualbench.so', | 122 '<(SHARED_LIB_DIR)/libvisualbench.so', |
| 131 ]}, { | 123 ]}, { |
| 132 'files': [ | 124 'files': [ |
| 133 '<(SHARED_LIB_DIR)/libvisualbench.so', | 125 '<(SHARED_LIB_DIR)/libvisualbench.so', |
| 134 ]} | 126 ]} |
| 135 ], | 127 ], |
| 136 ], | 128 ], |
| 137 }, | 129 }, |
| 138 ], | 130 ], |
| 139 }, | 131 }, |
| 140 { | 132 { |
| 141 'target_name': 'VisualBench_APK', | 133 'target_name': 'VisualBench_APK', |
| 142 'type': 'none', | 134 'type': 'none', |
| 143 'dependencies': [ | 135 'dependencies': [ |
| 144 'CopyVisualBenchDeps', | 136 'CopyVisualBenchDeps', |
| 145 ], | 137 ], |
| 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': [ | 138 'actions': [ |
| 154 { | 139 { |
| 155 'action_name': 'SkiaVisualBench_apk', | 140 'action_name': 'SkiaVisualBench_apk', |
| 156 'inputs': [ | 141 'inputs': [ |
| 157 '<(android_base)/visualbench/AndroidManifest.xml', | 142 '<(android_base)/apps/visualbench/src/main/AndroidManifest.xml', |
| 158 '<(android_base)/visualbench/build.xml', | 143 '<(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 ], | 144 ], |
| 162 'outputs': [ | 145 'outputs': [ |
| 163 '<(PRODUCT_DIR)/../android/VisualBench/bin/VisualBench.apk', | 146 '<(android_base)/apps/visualbench/build', |
| 164 ], | 147 ], |
| 165 'action': [ | 148 'action': [ |
| 166 'ant', | 149 '<(android_base)/apps/gradlew', |
| 167 '-quiet', | 150 ':visualbench:assemble<(android_variant)Debug', |
| 168 '-f', | 151 '-p<(android_base)/apps/visualbench', |
| 169 '<(android_base)/visualbench/build.xml', | 152 '-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 ], | 153 ], |
| 177 }, | 154 }, |
| 178 ], | 155 ], |
| 179 }, | 156 }, |
| 180 ], | 157 ], |
| 181 } | 158 } |
| OLD | NEW |