Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dalmat36/efda16c999eb6ff17b66 to your computer and use it in GitHub Desktop.
Save dalmat36/efda16c999eb6ff17b66 to your computer and use it in GitHub Desktop.
group 'testing'
version '1.0-SNAPSHOT'
apply plugin: 'groovy'
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
def mainClassName = 'testing.Hello'
repositories {
mavenCentral()
}
dependencies {
compile (
'org.codehaus.groovy:groovy-all:2.3.11',
'com.amazonaws:aws-lambda-java-core:1.1.0',
'com.amazonaws:aws-lambda-java-events:1.1.0'
)
testCompile group: 'junit', name: 'junit', version: '4.11'
}
//Did not work with Lambda
/*task buildZip(type: Zip) {
from compileGroovy
from processResources
into('lib') {
from configurations.runtime
}
}
build.dependsOn buildZip*/
//Works with Lambda
jar {
from(configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
manifest {
attributes 'Implementation-Title': 'Foobar',
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Main-Class': mainClassName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment