Skip to content

Instantly share code, notes, and snippets.

@alwarren
Created May 11, 2018 02:47
Show Gist options
  • Save alwarren/3a9ddf974c7d1e411808fbe5870a9159 to your computer and use it in GitHub Desktop.
Save alwarren/3a9ddf974c7d1e411808fbe5870a9159 to your computer and use it in GitHub Desktop.
import java.text.DateFormat
import java.text.SimpleDateFormat
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// your other gradle code here
static def getDateTime() {
DateFormat df = new SimpleDateFormat("YYYYMMddHHmm");
return df.format(new Date());
}
task _projectZip(type:Zip) {
description = 'Makes a single zip file suitable for import.'
from projectDir
baseName = "project-files-" + getDateTime()
include 'build.gradle'
include 'gradle.properties'
include 'gradlew'
include 'gradlew.bat'
include 'settings.gradle'
include 'gradle/**'
exclude 'build'
exclude '.gradle'
exclude '*.iml'
exclude 'local.properties'
include 'app/**'
exclude 'app/*.iml'
exclude 'app/build'
include 'data/**'
exclude 'data/*.iml'
exclude 'data/build'
include 'domain/**'
exclude 'domain/*.iml'
exclude 'domain/build'
include '.idea/**'
exclude '.idea/workspace.xml'
exclude '.idea/libraries'
include 'documents/**'
destinationDir file('zip')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment