import default_flavor
import subprocess
+# Data should go under in _data_dir, which may be preserved across runs.
+_data_dir = '/sdcard/revenge_of_the_skiabot/'
+# Executables go under _bin_dir, which, well, allows executable files.
+_bin_dir = '/data/local/tmp/'
+
"""GN Android flavor utils, used for building Skia for Android with GN."""
class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
def __init__(self, m):
super(GNAndroidFlavorUtils, self).__init__(m)
self._ever_ran_adb = False
- prefix = '/data/local/tmp/'
self.device_dirs = default_flavor.DeviceDirs(
- dm_dir = prefix + 'dm_out',
- perf_data_dir = prefix + 'perf',
- resource_dir = prefix + 'resources',
- images_dir = prefix + 'images',
- skp_dir = prefix + 'skps',
- svg_dir = prefix + 'svgs',
- tmp_dir = prefix + 'tmp')
+ dm_dir = _data_dir + 'dm_out',
+ perf_data_dir = _data_dir + 'perf',
+ resource_dir = _data_dir + 'resources',
+ images_dir = _data_dir + 'images',
+ skp_dir = _data_dir + 'skps',
+ svg_dir = _data_dir + 'svgs',
+ tmp_dir = _data_dir)
def supported(self):
return 'GN_Android' in self.m.vars.builder_cfg.get('extra_config', '')
self._run('ninja', 'ninja', '-C', self.out_dir)
def install(self):
- self._adb('mkdir /data/local/tmp/resources',
- 'shell', 'mkdir', '-p', '/data/local/tmp/resources')
+ self._adb('mkdir ' + self.device_dirs.resource_dir,
+ 'shell', 'mkdir', '-p', self.device_dirs.resource_dir)
def cleanup_steps(self):
if self._ever_ran_adb:
def step(self, name, cmd, env=None, **kwargs):
app = self.m.vars.skia_out.join(self.m.vars.configuration, cmd[0])
self._adb('push %s' % cmd[0],
- 'push', app, '/data/local/tmp')
+ 'push', app, _bin_dir)
sh = '%s.sh' % cmd[0]
self.m.run.writefile(self.m.vars.tmp_dir.join(sh),
- 'set -x; /data/local/tmp/%s; echo $? >/data/local/tmp/rc' %
- subprocess.list2cmdline(map(str, cmd)))
+ 'set -x; %s%s; echo $? >%src' %
+ (_bin_dir, subprocess.list2cmdline(map(str, cmd)), _bin_dir))
self._adb('push %s' % sh,
- 'push', self.m.vars.tmp_dir.join(sh), '/data/local/tmp')
+ 'push', self.m.vars.tmp_dir.join(sh), _bin_dir)
self._adb('clear log', 'logcat', '-c')
- self._adb(cmd[0], 'shell', 'sh', '/data/local/tmp/' + sh)
+ self._adb(cmd[0], 'shell', 'sh', _bin_dir + sh)
self._adb('dump log ', 'logcat', '-d')
self.m.python.inline('check %s rc' % cmd[0], """
import subprocess
import sys
sys.exit(int(subprocess.check_output(['adb', 'shell', 'cat',
- '/data/local/tmp/rc'])))
- """)
+ '%src'])))
+ """ % _bin_dir)
def copy_file_to_device(self, host, device):
self._adb('push %s %s' % (host, device), 'push', host, device)
"shell",
"mkdir",
"-p",
- "/data/local/tmp/resources"
+ "/sdcard/revenge_of_the_skiabot/resources"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "mkdir /data/local/tmp/resources"
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/resources"
},
{
"cmd": [
"-u",
"\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['adb', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n",
"[SLAVE_BUILD]/skia/resources",
- "/data/local/tmp/resources"
+ "/sdcard/revenge_of_the_skiabot/resources"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "push [SLAVE_BUILD]/skia/resources/* /data/local/tmp/resources",
+ "name": "push [SLAVE_BUILD]/skia/resources/* /sdcard/revenge_of_the_skiabot/resources",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import os@@@",
"adb",
"shell",
"cat",
- "/data/local/tmp/tmp/SKP_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SKP_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "read /data/local/tmp/tmp/SKP_VERSION",
+ "name": "read /sdcard/revenge_of_the_skiabot/SKP_VERSION",
"stdout": "/path/to/tmp/"
},
{
"shell",
"rm",
"-f",
- "/data/local/tmp/tmp/SKP_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SKP_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "rm /data/local/tmp/tmp/SKP_VERSION"
+ "name": "rm /sdcard/revenge_of_the_skiabot/SKP_VERSION"
},
{
"cmd": [
"shell",
"rm",
"-rf",
- "/data/local/tmp/skps"
+ "/sdcard/revenge_of_the_skiabot/skps"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "rm /data/local/tmp/skps"
+ "name": "rm /sdcard/revenge_of_the_skiabot/skps"
},
{
"cmd": [
"shell",
"mkdir",
"-p",
- "/data/local/tmp/skps"
+ "/sdcard/revenge_of_the_skiabot/skps"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "mkdir /data/local/tmp/skps"
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/skps"
},
{
"cmd": [
"-u",
"\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['adb', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n",
"[SLAVE_BUILD]/skp",
- "/data/local/tmp/skps"
+ "/sdcard/revenge_of_the_skiabot/skps"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "push [SLAVE_BUILD]/skp/* /data/local/tmp/skps",
+ "name": "push [SLAVE_BUILD]/skp/* /sdcard/revenge_of_the_skiabot/skps",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import os@@@",
"adb",
"push",
"[SLAVE_BUILD]/tmp/SKP_VERSION",
- "/data/local/tmp/tmp/SKP_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SKP_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "push [SLAVE_BUILD]/tmp/SKP_VERSION /data/local/tmp/tmp/SKP_VERSION"
+ "name": "push [SLAVE_BUILD]/tmp/SKP_VERSION /sdcard/revenge_of_the_skiabot/SKP_VERSION"
},
{
"cmd": [
"adb",
"shell",
"cat",
- "/data/local/tmp/tmp/SK_IMAGE_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "read /data/local/tmp/tmp/SK_IMAGE_VERSION",
+ "name": "read /sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION",
"stdout": "/path/to/tmp/"
},
{
"shell",
"rm",
"-f",
- "/data/local/tmp/tmp/SK_IMAGE_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "rm /data/local/tmp/tmp/SK_IMAGE_VERSION"
+ "name": "rm /sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
},
{
"cmd": [
"shell",
"rm",
"-rf",
- "/data/local/tmp/images"
+ "/sdcard/revenge_of_the_skiabot/images"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "rm /data/local/tmp/images"
+ "name": "rm /sdcard/revenge_of_the_skiabot/images"
},
{
"cmd": [
"shell",
"mkdir",
"-p",
- "/data/local/tmp/images"
+ "/sdcard/revenge_of_the_skiabot/images"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "mkdir /data/local/tmp/images"
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/images"
},
{
"cmd": [
"-u",
"\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['adb', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n",
"[SLAVE_BUILD]/skimage",
- "/data/local/tmp/images"
+ "/sdcard/revenge_of_the_skiabot/images"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "push [SLAVE_BUILD]/skimage/* /data/local/tmp/images",
+ "name": "push [SLAVE_BUILD]/skimage/* /sdcard/revenge_of_the_skiabot/images",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import os@@@",
"adb",
"push",
"[SLAVE_BUILD]/tmp/SK_IMAGE_VERSION",
- "/data/local/tmp/tmp/SK_IMAGE_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "push [SLAVE_BUILD]/tmp/SK_IMAGE_VERSION /data/local/tmp/tmp/SK_IMAGE_VERSION"
+ "name": "push [SLAVE_BUILD]/tmp/SK_IMAGE_VERSION /sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION"
},
{
"cmd": [
"adb",
"shell",
"cat",
- "/data/local/tmp/tmp/SVG_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SVG_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "read /data/local/tmp/tmp/SVG_VERSION",
+ "name": "read /sdcard/revenge_of_the_skiabot/SVG_VERSION",
"stdout": "/path/to/tmp/"
},
{
"shell",
"rm",
"-f",
- "/data/local/tmp/tmp/SVG_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SVG_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "rm /data/local/tmp/tmp/SVG_VERSION"
+ "name": "rm /sdcard/revenge_of_the_skiabot/SVG_VERSION"
},
{
"cmd": [
"shell",
"rm",
"-rf",
- "/data/local/tmp/svgs"
+ "/sdcard/revenge_of_the_skiabot/svgs"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "rm /data/local/tmp/svgs"
+ "name": "rm /sdcard/revenge_of_the_skiabot/svgs"
},
{
"cmd": [
"shell",
"mkdir",
"-p",
- "/data/local/tmp/svgs"
+ "/sdcard/revenge_of_the_skiabot/svgs"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "mkdir /data/local/tmp/svgs"
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/svgs"
},
{
"cmd": [
"-u",
"\nimport os\nimport subprocess\nimport sys\nhost = sys.argv[1]\ndevice = sys.argv[2]\nfor d, _, fs in os.walk(host):\n p = os.path.relpath(d, host)\n if p != '.' and p.startswith('.'):\n continue\n for f in fs:\n print os.path.join(p,f)\n subprocess.check_call(['adb', 'push',\n os.path.realpath(os.path.join(host, p, f)),\n os.path.join(device, p, f)])\n",
"[SLAVE_BUILD]/svg",
- "/data/local/tmp/svgs"
+ "/sdcard/revenge_of_the_skiabot/svgs"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "push [SLAVE_BUILD]/svg/* /data/local/tmp/svgs",
+ "name": "push [SLAVE_BUILD]/svg/* /sdcard/revenge_of_the_skiabot/svgs",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import os@@@",
"adb",
"push",
"[SLAVE_BUILD]/tmp/SVG_VERSION",
- "/data/local/tmp/tmp/SVG_VERSION"
+ "/sdcard/revenge_of_the_skiabot/SVG_VERSION"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "push [SLAVE_BUILD]/tmp/SVG_VERSION /data/local/tmp/tmp/SVG_VERSION"
+ "name": "push [SLAVE_BUILD]/tmp/SVG_VERSION /sdcard/revenge_of_the_skiabot/SVG_VERSION"
},
{
"cmd": [
"shell",
"rm",
"-rf",
- "/data/local/tmp/dm_out"
+ "/sdcard/revenge_of_the_skiabot/dm_out"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "rm /data/local/tmp/dm_out"
+ "name": "rm /sdcard/revenge_of_the_skiabot/dm_out"
},
{
"cmd": [
"shell",
"mkdir",
"-p",
- "/data/local/tmp/dm_out"
+ "/sdcard/revenge_of_the_skiabot/dm_out"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "mkdir /data/local/tmp/dm_out"
+ "name": "mkdir /sdcard/revenge_of_the_skiabot/dm_out"
},
{
"cmd": [
"adb",
"push",
"[SLAVE_BUILD]/tmp/uninteresting_hashes.txt",
- "/data/local/tmp/tmp/uninteresting_hashes.txt"
+ "/sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "push [SLAVE_BUILD]/tmp/uninteresting_hashes.txt /data/local/tmp/tmp/uninteresting_hashes.txt"
+ "name": "push [SLAVE_BUILD]/tmp/uninteresting_hashes.txt /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt"
},
{
"cmd": [
"adb",
"push",
"[SLAVE_BUILD]/out/Release/dm",
- "/data/local/tmp"
+ "/data/local/tmp/"
],
"cwd": "[SLAVE_BUILD]/skia",
"name": "push dm"
"python",
"-u",
"\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
- "set -x; /data/local/tmp/dm --undefok --resourcePath /data/local/tmp/resources --skps /data/local/tmp/skps --images /data/local/tmp/images/dm --colorImages /data/local/tmp/images/colorspace --nameByHash --properties gitHash abc123 master client.skia builder Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-GN_Android build_number 5 --svgs /data/local/tmp/svgs --key arch arm compiler Clang configuration Release cpu_or_gpu CPU cpu_or_gpu_value MT6582 extra_config GN_Android model AndroidOne os Android --uninterestingHashesFile /data/local/tmp/tmp/uninteresting_hashes.txt --writePath /data/local/tmp/dm_out --nogpu --config 565 8888 gpu gpusrgb msaa4 serialize-8888 tiles_rt-8888 pic-8888 --src tests gm image colorImage svg --blacklist f16 _ _ dstreadshuffle f16 image _ _ srgb image _ _ gpusrgb image _ _ _ test _ GrShape serialize-8888 gm _ bleed_image serialize-8888 gm _ c_gms serialize-8888 gm _ colortype serialize-8888 gm _ colortype_xfermodes serialize-8888 gm _ drawfilter serialize-8888 gm _ fontmgr_bounds_0.75_0 serialize-8888 gm _ fontmgr_bounds_1_-0.25 serialize-8888 gm _ fontmgr_bounds serialize-8888 gm _ fontmgr_match serialize-8888 gm _ fontmgr_iter serialize-8888 gm _ imagemasksubset serialize-8888 gm _ bitmapfilters serialize-8888 gm _ bitmapshaders serialize-8888 gm _ bleed serialize-8888 gm _ bleed_alpha_bmp serialize-8888 gm _ bleed_alpha_bmp_shader serialize-8888 gm _ convex_poly_clip serialize-8888 gm _ extractalpha serialize-8888 gm _ filterbitmap_checkerboard_32_32_g8 serialize-8888 gm _ filterbitmap_image_mandrill_64 serialize-8888 gm _ shadows serialize-8888 gm _ simpleaaclip_aaclip serialize-8888 gm _ composeshader_bitmap serialize-8888 gm _ scaled_tilemodes_npot serialize-8888 gm _ scaled_tilemodes serialize-8888 gm _ bleed_alpha_image serialize-8888 gm _ bleed_alpha_image_shader serialize-8888 gm _ verylargebitmap serialize-8888 gm _ verylarge_picture_image sp-8888 gm _ drawfilter pic-8888 gm _ drawfilter 2ndpic-8888 gm _ drawfilter lite-8888 gm _ drawfilter sp-8888 gm _ image-cacherator-from-picture pic-8888 gm _ image-cacherator-from-picture 2ndpic-8888 gm _ image-cacherator-from-picture serialize-8888 gm _ image-cacherator-from-picture sp-8888 gm _ image-cacherator-from-raster pic-8888 gm _ image-cacherator-from-raster 2ndpic-8888 gm _ image-cacherator-from-raster serialize-8888 gm _ image-cacherator-from-raster sp-8888 gm _ image-cacherator-from-ctable pic-8888 gm _ image-cacherator-from-ctable 2ndpic-8888 gm _ image-cacherator-from-ctable serialize-8888 gm _ image-cacherator-from-ctable sp-8888 gm _ gamut pic-8888 gm _ gamut lite-8888 gm _ gamut 2ndpic-8888 gm _ gamut serialize-8888 gm _ gamut --match ~WritePixels; echo $? >/data/local/tmp/rc",
+ "set -x; /data/local/tmp/dm --undefok --resourcePath /sdcard/revenge_of_the_skiabot/resources --skps /sdcard/revenge_of_the_skiabot/skps --images /sdcard/revenge_of_the_skiabot/images/dm --colorImages /sdcard/revenge_of_the_skiabot/images/colorspace --nameByHash --properties gitHash abc123 master client.skia builder Test-Android-Clang-AndroidOne-CPU-MT6582-arm-Release-GN_Android build_number 5 --svgs /sdcard/revenge_of_the_skiabot/svgs --key arch arm compiler Clang configuration Release cpu_or_gpu CPU cpu_or_gpu_value MT6582 extra_config GN_Android model AndroidOne os Android --uninterestingHashesFile /sdcard/revenge_of_the_skiabot/uninteresting_hashes.txt --writePath /sdcard/revenge_of_the_skiabot/dm_out --nogpu --config 565 8888 gpu gpusrgb msaa4 serialize-8888 tiles_rt-8888 pic-8888 --src tests gm image colorImage svg --blacklist f16 _ _ dstreadshuffle f16 image _ _ srgb image _ _ gpusrgb image _ _ _ test _ GrShape serialize-8888 gm _ bleed_image serialize-8888 gm _ c_gms serialize-8888 gm _ colortype serialize-8888 gm _ colortype_xfermodes serialize-8888 gm _ drawfilter serialize-8888 gm _ fontmgr_bounds_0.75_0 serialize-8888 gm _ fontmgr_bounds_1_-0.25 serialize-8888 gm _ fontmgr_bounds serialize-8888 gm _ fontmgr_match serialize-8888 gm _ fontmgr_iter serialize-8888 gm _ imagemasksubset serialize-8888 gm _ bitmapfilters serialize-8888 gm _ bitmapshaders serialize-8888 gm _ bleed serialize-8888 gm _ bleed_alpha_bmp serialize-8888 gm _ bleed_alpha_bmp_shader serialize-8888 gm _ convex_poly_clip serialize-8888 gm _ extractalpha serialize-8888 gm _ filterbitmap_checkerboard_32_32_g8 serialize-8888 gm _ filterbitmap_image_mandrill_64 serialize-8888 gm _ shadows serialize-8888 gm _ simpleaaclip_aaclip serialize-8888 gm _ composeshader_bitmap serialize-8888 gm _ scaled_tilemodes_npot serialize-8888 gm _ scaled_tilemodes serialize-8888 gm _ bleed_alpha_image serialize-8888 gm _ bleed_alpha_image_shader serialize-8888 gm _ verylargebitmap serialize-8888 gm _ verylarge_picture_image sp-8888 gm _ drawfilter pic-8888 gm _ drawfilter 2ndpic-8888 gm _ drawfilter lite-8888 gm _ drawfilter sp-8888 gm _ image-cacherator-from-picture pic-8888 gm _ image-cacherator-from-picture 2ndpic-8888 gm _ image-cacherator-from-picture serialize-8888 gm _ image-cacherator-from-picture sp-8888 gm _ image-cacherator-from-raster pic-8888 gm _ image-cacherator-from-raster 2ndpic-8888 gm _ image-cacherator-from-raster serialize-8888 gm _ image-cacherator-from-raster sp-8888 gm _ image-cacherator-from-ctable pic-8888 gm _ image-cacherator-from-ctable 2ndpic-8888 gm _ image-cacherator-from-ctable serialize-8888 gm _ image-cacherator-from-ctable sp-8888 gm _ gamut pic-8888 gm _ gamut lite-8888 gm _ gamut 2ndpic-8888 gm _ gamut serialize-8888 gm _ gamut --match ~WritePixels; echo $? >/data/local/tmp/rc",
"[SLAVE_BUILD]/tmp/dm.sh"
],
"name": "write dm.sh"
"adb",
"push",
"[SLAVE_BUILD]/tmp/dm.sh",
- "/data/local/tmp"
+ "/data/local/tmp/"
],
"cwd": "[SLAVE_BUILD]/skia",
"name": "push dm.sh"
"cmd": [
"adb",
"pull",
- "/data/local/tmp/dm_out",
+ "/sdcard/revenge_of_the_skiabot/dm_out",
"[CUSTOM_[SWARM_OUT_DIR]]/dm"
],
"cwd": "[SLAVE_BUILD]/skia",
- "name": "pull /data/local/tmp/dm_out [CUSTOM_[SWARM_OUT_DIR]]/dm"
+ "name": "pull /sdcard/revenge_of_the_skiabot/dm_out [CUSTOM_[SWARM_OUT_DIR]]/dm"
},
{
"cmd": [