Created
February 24, 2013 16:52
-
-
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
This file contains 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
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