Skip to content

Instantly share code, notes, and snippets.

@vazexqi
Created February 24, 2013 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vazexqi/5024526 to your computer and use it in GitHub Desktop.
Save vazexqi/5024526 to your computer and use it in GitHub Desktop.
sfl4j logging with Groovy using Gradle to manage dependencies (build.gradle) See http://vazexqi.github.com/posts/2013/02/24/groovy-sfl4j.html
apply plugin: 'groovy'
repositories {
mavenCentral()
// For newer/beta versions of Groovy
maven {
url 'http://repository.codehaus.org/'
}
}
dependencies {
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '2.1.0'
// Using sfl4j allows us to replace different loggers later, if desired
compile group: 'org.slf4j', name:'slf4j-api', version: '1.7.2'
// sfl4j is just a facade for loggers. To actually get logging to work, you need to
// tie it in with some actual implementation, e.g., logback
compile group: 'ch.qos.logback', name:'logback-classic', version: '1.0.9'
compile group: 'ch.qos.logback', name:'logback-core', version: '1.0.9'
}
task(runMyExample, dependsOn: [compileGroovy], type: JavaExec) {
main = 'MyExample'
classpath = sourceSets.main.runtimeClasspath + files('config/')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment