1#!/bin/bash 2 3if [[ $# -ne 3 ]] 4then 5 echo "Diff AAOS sysui & notifications projects between two revesions" 6 echo "Usage $0 <path_to_android_checkout> <diff_start_hash_or_label> <diff_end_hash_or_label>" 7 echo "Example 1: $0 ~/Android/android11-release remotes/aosp/android10-qpr3-release remotes/aosp/android11-release" 8 echo "Example 2: $0 ~/Android/master fbec38f2ae804519be36b146c4c5a3772ad0327a 5079993610225086d0c059cb693881d83ed64af9" 9 exit 1 10fi 11 12# i.e. something like ~/Android/android11-release 13ANDROID_CHECKOUT=$1 14# i.e. something like remotes/aosp/android10-qpr3-release 15# ref: branches https://android.googlesource.com/platform/frameworks/base/+refs 16LABEL_START=$2 17# i.e. something like remotes/aosp/android11-release 18LABEL_END=$3 19 20git_stat_method () { 21 FILE_LIST=`eval $1 | cat` 22 if [[ -z $FILE_LIST ]] 23 then 24 echo "Query does not return any files: \"$1\"" 25 else 26 echo "Running:" 27 echo "git diff --stat $LABEL_START $LABEL_END -- \`$1\`" 28 eval "git diff --stat $LABEL_START $LABEL_END -- \`$1\`" | cat 29 fi 30} 31 32no_sysui_ext_project() { 33 echo "sysui is not overwritten as no project at: $SYSUI_EXT_PROJECT" 34 echo "If there is, change SYSUI_EXT_PROJECT in the script." 35} 36 37# These values should be updated as necessary. 38SYSUI_BASE_PROJECT=frameworks/base 39SYSUI_BASE_PATTERN=packages/CarSystemUI 40SYSUI_EXT_PROJECT=vendor/auto/embedded 41SYSUI_EXT_PATTERN=AAECarSystemUI 42NOTIF_PROJECT=packages/apps/Car/Notification 43NOTIF_PATTERN=car/notification 44 45OVERLAY_PROJECT=packages/services/Car 46OVERLAY_PATTERN=res/values 47RRO_PATTERN=/rro/ 48SYSUI_RAW_PATTERN=SystemUI 49 50echo "Android Checkout:" $ANDROID_CHECKOUT 51echo "SysUI Base Pattern:" $SYSUI_BASE_PATTERN 52echo "SysUI Base Project:" $SYSUI_BASE_PROJECT 53echo "SysUI Ext Pattern:" $SYSUI_EXT_PATTERN 54echo "SysUI Ext Project:" $SYSUI_EXT_PROJECT 55echo "Notif Pattern:" $NOTIF_PATTERN 56echo "Notif Project:" $NOTIF_PROJECT 57echo "Overlay Pattern:" $OVERLAY_PATTERN 58echo "RRO Pattern:" $RRO_PATTERN 59echo "Overlay Project:" $OVERLAY_PROJECT 60echo "SysUI Raw Pattern:" $SYSUI_RAW_PATTERN 61 62echo "" 63echo "" 64 65echo "----------------------------------------------------------" 66echo "Customized Code" 67echo "----------------------------------------------------------" 68echo "*****************************" 69echo "Base SysUI" 70echo "*****************************" 71cd $ANDROID_CHECKOUT 72cd $SYSUI_BASE_PROJECT 73echo "Working directory:" `pwd` 74 75git_stat_method "find . -name '*.java' | egrep -v 'test' | egrep '$SYSUI_BASE_PATTERN'" 76 77echo "" 78 79echo "*****************************" 80echo "Ext SysUI" 81echo "*****************************" 82if [[ -e $SYSUI_EXT_PROJECT ]]; then 83 cd $ANDROID_CHECKOUT 84 cd $SYSUI_EXT_PROJECT 85 echo "Working directory:" `pwd` 86 87 git_stat_method "find . -name '*.java' | egrep -v 'test' | egrep '$SYSUI_EXT_PATTERN'" 88else 89 no_sysui_ext_project 90fi 91 92echo "" 93 94echo "*****************************" 95echo "Notification" 96echo "*****************************" 97cd $ANDROID_CHECKOUT 98cd $NOTIF_PROJECT 99echo "Working directory:" `pwd` 100 101git_stat_method "find . -name '*.java' | egrep -v 'test' | egrep '$NOTIF_PATTERN'" 102 103echo "" 104echo "" 105echo "" 106 107echo "----------------------------------------------------------" 108echo "Customized Configs" 109echo "----------------------------------------------------------" 110echo "*****************************" 111echo "Resource Overlays SysUI" 112echo "*****************************" 113cd $ANDROID_CHECKOUT 114cd $OVERLAY_PROJECT 115echo "Working directory:" `pwd` 116 117git_stat_method "find . -name '*.xml' | egrep -v '$RRO_PATTERN' | egrep '$OVERLAY_PATTERN' | egrep '$SYSUI_RAW_PATTERN'" 118 119echo "" 120 121echo "*****************************" 122echo "RROs SysUI" 123echo "*****************************" 124cd $ANDROID_CHECKOUT 125cd $OVERLAY_PROJECT 126echo "Working directory:" `pwd` 127 128git_stat_method "find . -name '*.xml' | egrep '$RRO_PATTERN' | egrep '$SYSUI_RAW_PATTERN'" 129 130echo "" 131 132echo "*****************************" 133echo "Resource Overlays Notification" 134echo "*****************************" 135cd $ANDROID_CHECKOUT 136cd $OVERLAY_PROJECT 137echo "Working directory:" `pwd` 138 139git_stat_method "find . -name '*.xml' | egrep -v '$RRO_PATTERN' | egrep '$OVERLAY_PATTERN' | egrep '$NOTIF_PATTERN'" 140 141echo "" 142 143echo "*****************************" 144echo "RROs Notification" 145echo "*****************************" 146cd $ANDROID_CHECKOUT 147cd $OVERLAY_PROJECT 148echo "Working directory:" `pwd` 149 150git_stat_method "find . -name '*.xml' | egrep '$RRO_PATTERN' | egrep '$NOTIF_PATTERN'" 151 152echo "" 153echo "" 154echo "" 155 156echo "----------------------------------------------------------" 157echo "Customized Tests" 158echo "----------------------------------------------------------" 159echo "*****************************" 160echo "Base SysUI" 161echo "*****************************" 162cd $ANDROID_CHECKOUT 163cd $SYSUI_BASE_PROJECT 164echo "Working directory:" `pwd` 165 166git_stat_method "find . -name '*.java' | egrep '*test*' | egrep '$SYSUI_BASE_PATTERN'" 167 168echo "" 169 170echo "*****************************" 171echo "Ext SysUI" 172echo "*****************************" 173if [[ -e $SYSUI_EXT_PROJECT ]]; then 174 cd $ANDROID_CHECKOUT 175 cd $SYSUI_EXT_PROJECT 176 echo "Working directory:" `pwd` 177 178 git_stat_method "find . -name '*.java' | egrep '*test*' | egrep '$SYSUI_EXT_PATTERN'" 179else 180 no_sysui_ext_project 181fi 182 183echo "" 184 185echo "*****************************" 186echo "Notification" 187echo "*****************************" 188cd $ANDROID_CHECKOUT 189cd $NOTIF_PROJECT 190echo "Working directory:" `pwd` 191 192git_stat_method "find . -name '*.java' | egrep '*test*' | egrep '$NOTIF_PATTERN'" 193