1#!/bin/bash 2set -x 3val=$(repo sync . | echo $?) 4if [ $val != 0 ]; then 5 echo could not repo sync local directory, bailing. 6fi 7 8rm -rf /tmp/robo 9mkdir -p /tmp/robo || true 10pushd /tmp/robo 11git clone -b google --single-branch https://github.com/robolectric/robolectric.git 12#git checkout google 13popd 14 15echo building patch 16# waiting on clean up the ttf/icu data -- hence nativeruntime resources are ignored. 17# we also need 18diff -Naur . /tmp/robo/robolectric \ 19 -x '*.bp' \ 20 -x '*.md' \ 21 -x 'harddiff.sh' \ 22 -x 'METADATA' \ 23 -x 'MODULE_LICENSE_MIT' \ 24 -x 'NOTICE' \ 25 -x 'OWNERS' \ 26 -x 'soong*' \ 27 -x '.git*' \ 28 -x 'buildSrc' \ 29 -x 'gradle' \ 30 -x '*.gradle' \ 31 -x 'sdks.txt' \ 32 -x '*.ttf' \ 33 -x '*.utf' \ 34 -x '*.otf' \ 35 -x '*.ttc' \ 36 -x 'fonts.xml' \ 37 -x '*.dat' \ 38 -x 'lint-baseline.xml' \ 39 -x 'robo-manifest.xml' \ 40 -x 'AndroidManifest.xml' \ 41 -x 'README' \ 42 -x 'robolectric.properties' \ 43> /tmp/robo/patch 44 45echo applying patch 46patch -p1 < /tmp/robo/patch 47 48echo patch applied 49 50# How to auto revert an existing CL from upstream on top of the diff 51# One per CL please. 52 53# echo reverting upstream CL due to ... 54# git diff 162eaf30e754fdc3322b2c6b0df6576b4555e650 162eaf30e754fdc3322b2c6b0df6576b4555e650^ | patch -p1 55