Skip to content

Instantly share code, notes, and snippets.

@ed-george
Created August 19, 2022 12:27
Show Gist options
  • Save ed-george/b343b6b73730e74a2f60ff63198594c9 to your computer and use it in GitHub Desktop.
Save ed-george/b343b6b73730e74a2f60ff63198594c9 to your computer and use it in GitHub Desktop.
A simple bash script to see how your projects Synthetics usage has changed over time
#! /bin/bash
# To use:
# Copy this file to the root of your Android Project
# chmod +x trackSynthetics.sh
# ./trackSynthetics.sh | tee results.csv
# Open CSV file in your choice of spreadsheet software
start=2022-02-23 # Date to start tracking
end=2022-08-19 # Date to end tracking
branch="develop"
echo "date,count"
while ! [[ $start > $end ]]; do
# MacOS use brew install coreutils to get gdate
# Linux replace gdate with date
start=$(gdate -d "$start + 1 day" +%F)
git checkout `git rev-list -n 1 --before="$start 00:00" $branch` > /dev/null 2>&1
count=$(grep -lr "kotlinx.android.synthetic" --include \*.kt * | grep src | wc -l | xargs)
echo "$start,$count"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment