Created
August 31, 2015 21:50
-
-
Save EminYahyayev/9e63de9c96e4cd097dbc to your computer and use it in GitHub Desktop.
Gradle: packs the 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
task copyApkForZip(type: Copy) { | |
from 'build/outputs/apk' | |
into '../apk' | |
include '**/app-release.apk' | |
} | |
task zipBackup(type: Zip) { | |
dependsOn "copyApkForZip" | |
from('../'){ | |
exclude "**/build" | |
exclude "**/.gradle" | |
exclude "**/gradle" | |
exclude "**/captures" | |
exclude "**/backups" | |
exclude "**/*backupzip*" | |
} | |
baseName = "backupzip" + getDate() | |
} | |
task moveBackup(type: Copy) { | |
dependsOn "zipBackup" | |
from 'build/distributions' | |
into '../backups' | |
include '**/backupzip*' | |
doLast { | |
project.delete "build/distributions" | |
project.delete "../apk" | |
} | |
} | |
task moveBackup(type: Copy) { | |
description "Reduces in size and packs the project" | |
tasks = [":moveBackup"] | |
} | |
def getDate() { | |
def date = new Date() | |
def formattedDate = date.format('yyyyMMddHHmmss') | |
return formattedDate | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment