Skip to content
Permalink
Browse files

Added @grab, and configure gradle to ignore Grape

  • Loading branch information...
linhpham committed Aug 9, 2015
1 parent d9965ee commit ffaf1f67ab0a88785fcee444f01600875e755a76
Showing with 25 additions and 2 deletions.
  1. +13 −0 build.gradle
  2. +8 −2 src/main/groovy/Processor.groovy
  3. +4 −0 src/main/groovy/data-fix.groovy
@@ -19,4 +19,17 @@ dependencies {
testCompile "org.spockframework:spock-core:1.0-groovy-2.4"
testCompile "cglib:cglib:2.2"
testCompile "org.objenesis:objenesis:1.2"

compile "log4j:log4j:1.2.17"
}

test {
systemProperty 'groovy.grape.enable', 'false'
}

compileGroovy {
groovyOptions.forkOptions.jvmArgs = [ '-Dgroovy.grape.enable=false' ]
}
compileTestGroovy {
groovyOptions.forkOptions.jvmArgs = [ '-Dgroovy.grape.enable=false' ]
}
@@ -1,11 +1,17 @@
import groovy.sql.Sql
import org.apache.log4j.*
import groovy.util.logging.*

@Log4j
class Processor {
def opts

Processor(opts) {
log.level = Level.DEBUG
this.opts = opts
}

void run() {
println "Running..."
log.info "Running..."
}
}
@@ -1,5 +1,9 @@
#!/usr/bin/env groovy

@GrabConfig(systemClassLoader=true)
@Grab('mysql:mysql-connector-java:5.1.27')
@Grab('log4j:log4j:1.2.17')

def cli = new CliBuilder(usage:'data-fix')
cli.with {
u longOpt: 'user', args: 1, argName: 'user', required: true, 'DB user'

0 comments on commit ffaf1f6

Please sign in to comment.
You can’t perform that action at this time.