Skip to content

Instantly share code, notes, and snippets.

@bodiam
bodiam / gist:5999047
Last active December 19, 2015 18:29
Marcin is a crazy fish.
def artifacts = []
addListener(new TaskExecutionAdapter() {
void afterExecute(Task task, TaskState state) {
if(task in AbstractArchiveTask) {
artifacts << task.outputs.files.singleFile
}
}
})
@bodiam
bodiam / gist:5998377
Last active December 19, 2015 18:28 — forked from erdi/gist:5998112
Gradle script to prints the file location of the produced artifact. Can be put in ~/.gradle/init.gradle so it can be used across projects.
allprojects {
tasks.withType(AbstractArchiveTask) { task ->
outputs.upToDateWhen { false }
task.doLast {
println "\nOutput location: ${archiveName}\n"
}
}
}
@bodiam
bodiam / gist:5795800
Last active January 30, 2019 22:05
A small description of my use case for Groovy data classes.
// Current way in Groovy
@Immutable
class Person {
String firstName, lastName
int age
Date dateCreated
}
// But: This would be nice
data class Person(String name, String lastName, int age, Date dateCreated)