plugins { id "com.jfrog.bintray" version "1.8.4" id "com.github.jruby-gradle.base" version "1.6.0" id "com.github.johnrengelman.shadow" version "4.0.3" id "com.github.spotbugs" version "1.6.8" id "java" id "checkstyle" id "jacoco" } import com.github.jrubygradle.JRubyExec repositories { mavenCentral() jcenter() } configurations { provided } sourceCompatibility = 1.8 targetCompatibility = 1.8 version = "0.3.1" // Relocate Guava packages since it's incompatible with Guava's version from Embulk shadowJar { classifier = "shadow" exclude "org/embulk/plugin/**" dependencies { include dependency("com.google.guava:guava") include dependency("com.google.cloud:google-cloud-storage") } relocate "com.google.common", "embulk.gcs.com.google.common" } dependencies { compile "org.embulk:embulk-core:0.9.12" provided "org.embulk:embulk-core:0.9.12" compile "com.google.cloud:google-cloud-storage:1.56.0" testCompile "junit:junit:4.12" testCompile "org.embulk:embulk-core:0.9.12:tests" testCompile "org.embulk:embulk-standards:0.9.12" testCompile "org.mockito:mockito-core:2.18.3" } task classpath(type: Copy, dependsOn: ["jar", "shadowJar"]) { doFirst { file("classpath").deleteDir() } from (configurations.runtime - configurations.provided + configurations.shadow - files(shadowJar.getIncludedDependencies()) + files(shadowJar.archivePath)) into "classpath" } clean { delete 'classpath' } test { jvmArgs '-XX:MaxPermSize=128M', '-Xmx2048m' testLogging { events "passed", "skipped", "failed" } } checkstyle { configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml") toolVersion = '6.14.1' } checkstyleMain { configFile = file("${project.rootDir}/config/checkstyle/default.xml") ignoreFailures = false } checkstyleTest { configFile = file("${project.rootDir}/config/checkstyle/default.xml") ignoreFailures = false } task checkstyle(type: Checkstyle) { classpath = sourceSets.main.output + sourceSets.test.output source = sourceSets.main.allJava + sourceSets.test.allJava } task gem(type: JRubyExec, dependsOn: ["build", "gemspec", "classpath"]) { script "gem" scriptArgs "build", "build/gemspec" doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") } } task gemspec { doLast { file("build/gemspec").write($/ Gem::Specification.new do |spec| spec.name = "${project.name}" spec.version = "${project.version}" spec.authors = ["Satoshi Akama"] spec.summary = %[Google Cloud Storage input plugin for Embulk] spec.description = %[Reads files stored on Google Cloud Storage (Standard, Durable Reduced Availability or Nearline)] spec.email = ["satoshiakama@gmail.com"] spec.licenses = ["Apache-2.0"] spec.homepage = "https://github.com/embulk/embulk-input-gcs" spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"] spec.test_files = spec.files.grep(%r"^(test|spec)/") spec.require_paths = ["lib"] spec.add_development_dependency 'bundler', ['~> 1.0'] spec.add_development_dependency 'rake', ['>= 10.0'] end /$) } }