Skip to content

Commit ca59b47

Browse files
committed
Build with the "org.embulk.embulk-plugins" Gradle plugin
Along with that, * Upgrade the Gradle wrapper to use Gradle 6.1.1 * Upgrade the Bintray Gradle plugin to 1.8.4 (latest) * Upgrade depending embulk-core to 0.9.23 (latest) * Set JavaCompile option for deprecation and unchecked * Test with GitHub Actions, instead of Travis-CI
1 parent 77c0cba commit ca59b47

File tree

9 files changed

+163
-146
lines changed

9 files changed

+163
-146
lines changed

.github/workflows/build.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Build and test
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v1
8+
- name: Set up JDK 1.8
9+
uses: actions/setup-java@v1
10+
with:
11+
java-version: 1.8
12+
- name: Build with testing
13+
run: ./gradlew --stacktrace test

.travis.yml

-10
This file was deleted.

build.gradle

+56-78
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,89 @@
11
plugins {
2-
id "com.jfrog.bintray" version "1.7"
2+
id "com.jfrog.bintray" version "1.8.4"
33
id "maven-publish"
4-
id "com.github.jruby-gradle.base" version "0.1.5"
54
id "java"
65
id "checkstyle"
76
id "jacoco"
7+
id "org.embulk.embulk-plugins" version "0.3.0"
88
}
9-
import com.github.jrubygradle.JRubyExec
9+
1010
repositories {
1111
mavenCentral()
1212
jcenter()
1313
}
14-
configurations {
15-
provided
16-
}
1714

1815
group = "org.embulk.input.sftp"
19-
version = "0.3.2"
16+
version = "0.3.3"
17+
description = "Reads files stored on remote server using SFTP."
2018

2119
sourceCompatibility = 1.8
2220
targetCompatibility = 1.8
2321

22+
tasks.withType(JavaCompile) {
23+
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
24+
}
25+
2426
dependencies {
25-
compile "org.embulk:embulk-core:0.9.12"
26-
provided "org.embulk:embulk-core:0.9.12"
27+
compileOnly "org.embulk:embulk-core:0.9.23"
2728
compile "org.apache.commons:commons-vfs2:2.2"
2829
compile "commons-io:commons-io:2.6"
2930
compile "com.jcraft:jsch:0.1.55"
30-
testCompile "junit:junit:4.+"
31-
testCompile "org.embulk:embulk-core:0.9.12:tests"
32-
testCompile "org.embulk:embulk-standards:0.9.12"
31+
32+
testCompile "junit:junit:4.13"
33+
testCompile "org.embulk:embulk-core:0.9.23:tests"
34+
testCompile "org.embulk:embulk-standards:0.9.23"
35+
testCompile "org.embulk:embulk-deps-buffer:0.9.23"
36+
testCompile "org.embulk:embulk-deps-config:0.9.23"
3337
testCompile "org.apache.sshd:apache-sshd:1.1.0"
3438
testCompile "org.littleshoot:littleproxy:1.1.0-beta1"
3539
testCompile "io.netty:netty-all:4.0.34.Final"
3640
}
3741

42+
embulkPlugin {
43+
mainClass = "org.embulk.input.sftp.SftpFileInputPlugin"
44+
category = "input"
45+
type = "sftp"
46+
}
47+
3848
javadoc {
3949
options {
4050
locale = 'en_US'
4151
encoding = 'UTF-8'
4252
}
4353
}
4454

55+
// add tests/javadoc/source jar tasks as artifacts to be released
56+
task testsJar(type: Jar, dependsOn: classes) {
57+
classifier = 'tests'
58+
from sourceSets.test.output
59+
}
60+
task sourcesJar(type: Jar, dependsOn: classes) {
61+
classifier = 'sources'
62+
from sourceSets.main.allSource
63+
}
64+
task javadocJar(type: Jar, dependsOn: javadoc) {
65+
classifier = 'javadoc'
66+
from javadoc.destinationDir
67+
}
68+
69+
publishing {
70+
publications {
71+
embulkPluginMaven(MavenPublication) { // Publish it with "publishEmbulkPluginMavenPublicationTo???Repository".
72+
from components.java
73+
artifact testsJar
74+
artifact sourcesJar
75+
artifact javadocJar
76+
}
77+
}
78+
}
79+
4580
// bintray
4681
bintray {
4782
// write at your bintray user name and api key to ~/.gradle/gradle.properties file:
4883
user = project.hasProperty('bintray_user') ? bintray_user : ''
4984
key = project.hasProperty('bintray_api_key') ? bintray_api_key : ''
5085

51-
publications = ['bintrayMavenRelease']
86+
publications = [ "embulkPluginMaven" ]
5287
publish = true
5388

5489
pkg {
@@ -68,36 +103,17 @@ bintray {
68103
}
69104
}
70105
}
71-
publishing {
72-
publications {
73-
bintrayMavenRelease(MavenPublication) {
74-
from components.java
75-
artifact testsJar
76-
artifact sourcesJar
77-
artifact javadocJar
78-
}
79-
}
80-
}
81106

82-
task classpath(type: Copy, dependsOn: ["jar"]) {
83-
doFirst { file("classpath").deleteDir() }
84-
from (configurations.runtime - configurations.provided + files(jar.archivePath))
85-
into "classpath"
107+
gem {
108+
authors = [ "Satoshi Akama" ]
109+
email = [ "[email protected]" ]
110+
summary = "SFTP file input plugin for Embulk"
111+
homepage = "https://github.com/embulk/embulk-input-sftp"
112+
licenses = [ "Apache-2.0" ]
86113
}
87-
clean { delete "classpath" }
88114

89-
// add tests/javadoc/source jar tasks as artifacts to be released
90-
task testsJar(type: Jar, dependsOn: classes) {
91-
classifier = 'tests'
92-
from sourceSets.test.output
93-
}
94-
task sourcesJar(type: Jar, dependsOn: classes) {
95-
classifier = 'sources'
96-
from sourceSets.main.allSource
97-
}
98-
task javadocJar(type: Jar, dependsOn: javadoc) {
99-
classifier = 'javadoc'
100-
from javadoc.destinationDir
115+
gemPush {
116+
host = "https://rubygems.org"
101117
}
102118

103119
checkstyle {
@@ -116,41 +132,3 @@ task checkstyle(type: Checkstyle) {
116132
classpath = sourceSets.main.output + sourceSets.test.output
117133
source = sourceSets.main.allJava + sourceSets.test.allJava
118134
}
119-
120-
task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
121-
jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "build"
122-
script "build/gemspec"
123-
doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
124-
}
125-
126-
task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
127-
jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
128-
script "pkg/${project.name}-${project.version}.gem"
129-
}
130-
131-
task "package"(dependsOn: ["gemspec", "classpath"]) << {
132-
println "> Build succeeded."
133-
println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
134-
}
135-
136-
task gemspec << { file("build/gemspec").write($/
137-
Gem::Specification.new do |spec|
138-
spec.name = "${project.name}"
139-
spec.version = "${project.version}"
140-
spec.authors = ["Satoshi Akama"]
141-
spec.summary = %[SFTP file input plugin for Embulk]
142-
spec.description = %[Reads files stored on remote server using SFTP.]
143-
spec.email = ["[email protected]"]
144-
spec.licenses = ["Apache-2.0"]
145-
spec.homepage = "https://github.com/embulk/embulk-input-sftp"
146-
147-
spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
148-
spec.test_files = spec.files.grep(%r"^(test|spec)/")
149-
spec.require_paths = ["lib"]
150-
151-
spec.add_development_dependency 'bundler', ['~> 1.0']
152-
spec.add_development_dependency 'rake', ['>= 10.0']
153-
end
154-
/$)
155-
}
156-
clean { delete "${project.name}.gemspec" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This is a Gradle generated file for dependency locking.
2+
# Manual edits can break the build and are not advised.
3+
# This file is expected to be part of source control.
4+
com.jcraft:jsch:0.1.55
5+
commons-io:commons-io:2.6
6+
commons-logging:commons-logging:1.2
7+
org.apache.commons:commons-vfs2:2.2

gradle/wrapper/gradle-wrapper.jar

5.74 KB
Binary file not shown.
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sun Jan 08 00:35:58 PST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip

0 commit comments

Comments
 (0)