plugins { id "com.jfrog.bintray" version "1.7" id "maven-publish" id "com.github.jruby-gradle.base" version "0.1.5" id "com.github.kt3k.coveralls" version "2.4.0" id "jacoco" id "java" id "checkstyle" } import com.github.jrubygradle.JRubyExec repositories { mavenCentral() jcenter() } configurations { provided } group = "org.embulk.output.sftp" version = "0.1.10" sourceCompatibility = 1.7 targetCompatibility = 1.7 dependencies { compile "org.embulk:embulk-core:0.8.6" provided "org.embulk:embulk-core:0.8.6" // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION" compile "org.apache.commons:commons-vfs2:2.2" compile "commons-io:commons-io:2.6" compile "com.jcraft:jsch:0.1.54" testCompile "junit:junit:4.+" testCompile "org.embulk:embulk-core:0.8.6:tests" testCompile "org.embulk:embulk-standards:0.8.6" testCompile "org.apache.sshd:apache-sshd:1.1.0+" testCompile "org.littleshoot:littleproxy:1.1.0-beta1" testCompile "io.netty:netty-all:4.0.34.Final" } jacocoTestReport { reports { xml.enabled = true // coveralls plugin depends on xml format report html.enabled = true } } javadoc { options { locale = 'en_US' encoding = 'UTF-8' } } // bintray bintray { // write at your bintray user name and api key to ~/.gradle/gradle.properties file: user = project.hasProperty('bintray_user') ? bintray_user : '' key = project.hasProperty('bintray_api_key') ? bintray_api_key : '' publications = ['bintrayMavenRelease'] publish = true pkg { userOrg = 'embulk-output-sftp' repo = 'maven' name = project.name desc = 'SFTP output plugin for Embulk' websiteUrl = 'https://github.com/embulk/embulk-output-sftp' issueTrackerUrl = 'https://github.com/embulk/embulk-output-sftp/issues' vcsUrl = 'https://github.com/embulk/embulk-output-sftp.git' licenses = ['MIT'] labels = ['embulk', 'java'] publicDownloadNumbers = true version { name = project.version } } } publishing { publications { bintrayMavenRelease(MavenPublication) { from components.java artifact testsJar artifact sourcesJar artifact javadocJar } } } task classpath(type: Copy, dependsOn: ["jar"]) { doFirst { file("classpath").deleteDir() } from (configurations.runtime - configurations.provided + files(jar.archivePath)) into "classpath" } clean { delete "classpath" } // add tests/javadoc/source jar tasks as artifacts to be released task testsJar(type: Jar, dependsOn: classes) { classifier = 'tests' from sourceSets.test.output } task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir } checkstyle { configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml") toolVersion = '6.14.1' } checkstyleMain { configFile = file("${project.rootDir}/config/checkstyle/default.xml") ignoreFailures = true } checkstyleTest { configFile = file("${project.rootDir}/config/checkstyle/default.xml") ignoreFailures = true } task checkstyle(type: Checkstyle) { classpath = sourceSets.main.output + sourceSets.test.output source = sourceSets.main.allJava + sourceSets.test.allJava } task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) { jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "build" script "${project.name}.gemspec" doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") } } task gemPush(type: JRubyExec, dependsOn: ["gem"]) { jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push" script "pkg/${project.name}-${project.version}.gem" } task "package"(dependsOn: ["gemspec", "classpath"]) << { println "> Build succeeded." println "> You can run embulk with '-L ${file(".").absolutePath}' argument." } task gemspec { ext.gemspecFile = file("${project.name}.gemspec") inputs.file "build.gradle" outputs.file gemspecFile doLast { gemspecFile.write($/ Gem::Specification.new do |spec| spec.name = "${project.name}" spec.version = "${project.version}" spec.authors = ["Civitaspo", "Satoshi Akama"] spec.summary = %[SFTP file output plugin for Embulk] spec.description = %[Stores files on SFTP server.] spec.email = ["civitaspo@gmail.com", "satoshiakama@gmail.com"] spec.licenses = ["MIT"] spec.homepage = "https://github.com/embulk/embulk-output-sftp" 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_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION'] spec.add_development_dependency 'bundler', ['~> 1.0'] spec.add_development_dependency 'rake', ['>= 10.0'] end /$) } } clean { delete "${project.name}.gemspec" }