Skip to content

Commit 2c40431

Browse files
committed
Fix build.txt entries for non-git libraries
1 parent dabbcbe commit 2c40431

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

build.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,18 @@ echo "Android API level: ${ANDROID_API_LEVEL}" >> "${BUILD_TXT}"
192192
for src in "${SRCROOT}"/*; do
193193
cd "${src}"
194194
PROJECT=`basename "${src}"`
195-
196-
project_rev=`git rev-parse HEAD`
197195
echo -e "\n* ${PROJECT}" >> "${BUILD_TXT}"
198-
echo -e "\t- Revision: ${project_rev}" >> "${BUILD_TXT}"
196+
197+
if [ -d ".git" ]; then
198+
project_rev=`git rev-parse HEAD`
199+
echo -e "\t- Revision: ${project_rev}" >> "${BUILD_TXT}"
200+
else
201+
cache_file=($CACHE_ROOT/$PROJECT*)
202+
cache_file=${cache_file[${#cache_file[@]}-1]} # last item
203+
if [ -e "$cache_file" ]; then
204+
echo -e "\t- File: $(basename $cache_file)" >> "${BUILD_TXT}"
205+
fi
206+
fi
199207

200208
has_patches=false
201209

0 commit comments

Comments
 (0)