Created
November 28, 2014 15:33
-
-
Save kamikat/a3dde3baab4668c5d21c to your computer and use it in GitHub Desktop.
Simple CI implementation for Gradle-based Android Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update: | |
@git pull | |
assemble: | |
@./gradlew clean :${MODULE}:assembleDebug :${MODULE}:assembleRelease && ./projection ${MODULE} "${VERSION}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROJECT_ROOT="$(dirname $0)" | |
BUILD_MODULE="$1" | |
VERSION_NAME="$2" | |
BUILD_SOURCE="$PROJECT_ROOT/$BUILD_MODULE/build/outputs" | |
ARCHIVE_DEST="$PROJECT_ROOT/../build" | |
ARCHIVE_NAME="$(date +%Y%m%d)$VERSION_NAME" | |
ARCHIVE_PATH="$ARCHIVE_DEST/$ARCHIVE_NAME" | |
mkdir -p $ARCHIVE_PATH | |
cp -rf "$BUILD_SOURCE"/proguard/release/mapping.txt "$ARCHIVE_PATH/mapping.txt" | |
cp -rf "$BUILD_SOURCE"/apk/$BUILD_MODULE-debug.apk "$ARCHIVE_PATH/" | |
cp -rf "$BUILD_SOURCE"/apk/$BUILD_MODULE-release.apk "$ARCHIVE_PATH/" | |
if [ -f "$BUILD_SOURCE"/apk/$BUILD_MODULE-release.apk -a -n "$VERSION_NAME" ] | |
then | |
# special projection logic on release builds | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment