tools: Add changelog generator
Signed-off-by: Jackeagle <jackeagle102@gmail.com>
Change-Id: Ic0b5713e9897cef4d919a47f0fd7a548aa6d4504
diff --git a/tools/changelog b/tools/changelog
new file mode 100755
index 0000000..3cb1fe4
--- /dev/null
+++ b/tools/changelog
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Exports
+
+. $ANDROID_BUILD_TOP/vendor/bliss/tools/colors
+
+export Changelog=Changelog.txt
+
+if [ -f $Changelog ];
+then
+ rm -f $Changelog
+fi
+
+touch $Changelog
+
+# Print something to build output
+echo ${bldppl}"Generating changelog..."${txtrst}
+
+for i in $(seq 5);
+do
+export After_Date=`date --date="$i days ago" +%m-%d-%Y`
+k=$(expr $i - 1)
+ export Until_Date=`date --date="$k days ago" +%m-%d-%Y`
+
+ # Line with after --- until was too long for a small ListView
+ echo '====================' >> $Changelog;
+ echo " "$Until_Date >> $Changelog;
+ echo '====================' >> $Changelog;
+ echo >> $Changelog;
+
+ # Cycle through every repo to find commits between 2 dates
+ repo forall -pc 'git log --oneline --after=$After_Date --until=$Until_Date' >> $Changelog
+ echo >> $Changelog;
+done
+
+sed -i 's/project/ */g' $Changelog
+
+cp $Changelog $OUT/
+rm $Changelog