apply plugin: "com.github.jruby-gradle.jar" // include ruby scripts to jar. don't use sourceSets.main.resources.srcDirs // because IntelliJ causes error if srcDirs includes files out of projectDir. processResources.from("${rootProject.projectDir}/lib/", "${buildDir}/gemlib") configurations { // com.google.inject:guice depends on asm and cglib but version of the libraries conflict // with ones bundled in jruby-complete and cause bytecode compatibility error compile.exclude group: 'asm', module: 'asm' compile.exclude group: 'org.sonatype.sisu.inject', module: 'cglib' } import com.github.jrubygradle.JRubyExec import com.github.jrubygradle.JRubyPrepare // determine which dependencies have updates: $ gradle dependencyUpdates dependencies { compile 'org.embulk:guice-bootstrap:0.1.1' compile 'com.google.guava:guava:18.0' compile 'com.google.inject:guice:4.0' compile 'com.google.inject.extensions:guice-multibindings:4.0' compile 'javax.inject:javax.inject:1' compile 'com.fasterxml.jackson.core:jackson-annotations:2.5.3' compile 'com.fasterxml.jackson.core:jackson-core:2.5.3' compile 'com.fasterxml.jackson.core:jackson-databind:2.5.3' compile 'com.fasterxml.jackson.datatype:jackson-datatype-guava:2.5.3' compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.5.3' compile 'com.fasterxml.jackson.module:jackson-module-guice:2.5.3' compile 'ch.qos.logback:logback-classic:1.1.3' compile 'org.slf4j:slf4j-api:1.7.12' compile 'org.jruby:jruby-complete:' + project.jrubyVersion compile 'com.google.code.findbugs:annotations:3.0.0' compile 'org.yaml:snakeyaml:1.14' compile 'javax.validation:validation-api:1.1.0.Final' compile 'org.apache.bval:bval-jsr303:0.5' compile 'io.airlift:slice:0.9' compile 'joda-time:joda-time:2.9.2' compile 'io.netty:netty-buffer:5.0.0.Alpha1' compile 'org.fusesource.jansi:jansi:1.11' compile 'org.msgpack:msgpack-core:0.8.3' // For embulk/guess/charset.rb. See also embulk.gemspec compile 'com.ibm.icu:icu4j:54.1.1' gems 'rubygems:bundler:1.10.6' gems 'rubygems:msgpack:0.7.4' gems 'rubygems:liquid:3.0.6' } task unpackGems(type: JRubyPrepare) { outputDir file("${buildDir}/gem") dependencies configurations.gems doLast { // move to build/gem/*/lib/* to build/gemlib/ file("${buildDir}/gem/gems").eachDir { gemDir -> copy { from "${gemDir}/lib" into "${buildDir}/gemlib/" include "**" } } fileTree(dir: "${buildDir}/gemlib", include: "**/.jrubydir").each { f -> f.delete() } } } processResources.dependsOn("unpackGems")