w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
TeamCity: building with Gradle to retrieve path to /build/outputs/apk/*.apk regardless of which project?

To answer my initial question: I created a simple terminal search for the apk in the build folder sorted by date/last modified:

LAST_APK_FILE=`find . -name "*.apk" 2>/dev/null | xargs ls
-1tr | tail -n 1`

We then copy this apk to a more readable filename:

NEW_APK_FILENAME=`echo $( echo "%teamcity.project.id%.apk" | tr
" ()&'"! "______" )`
cp $LAST_APK_FILE $NEW_APK_FILENAME




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.