Skip to content

Commit 8ddf58a

Browse files
authored
Merge pull request #98 from trocco-io/feature/embulk-v0.1x
Implementation for embulk v0.1x
2 parents 3d5ffbf + fcd0c14 commit 8ddf58a

31 files changed

+692
-585
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
uses: actions/setup-java@v1
3333
with:
3434
java-version: 1.8
35+
- name: lint
36+
run: ./gradlew spotlessCheck
3537
- name: Test
3638
run: ./gradlew test
3739
build:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ build/
1111
.classpath
1212
.project
1313
config.yml
14+
test.yml

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,16 @@ $ ./gradlew gem # -t to watch change of files and rebuild continuously
159159
```
160160
$ embulk run config.yml -L PATH/embulk-output-bigquery_java/build/gemContents/
161161
```
162+
163+
## TEST
164+
165+
166+
```
167+
$ ./gradlew test
168+
```
169+
170+
Real bigquery connection tests are normally disabled. To enable them, set the EMBULK_OUTPUT_BIGQUERY_TEST_CONFIG environment variable to config.yml path.
171+
172+
```
173+
$ EMBULK_OUTPUT_BIGQUERY_TEST_CONFIG="example/test.yml" ./gradlew test # Create example/test.yml based on example/test.yml.example
174+
```

build.gradle

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
plugins {
22
id "com.github.johnrengelman.shadow" version "5.2.0" apply false
33
id "java"
4-
id "checkstyle"
54
id "maven-publish"
5+
id "com.diffplug.spotless" version "5.17.1"
66
id "org.embulk.embulk-plugins" version "0.4.1"
77
id "com.palantir.git-version" version "0.12.3"
8+
id "com.adarshr.test-logger" version "3.0.0"
89
}
910

1011
repositories {
1112
mavenCentral()
12-
jcenter()
1313
}
1414

1515
group = "io.trocco"
@@ -27,24 +27,32 @@ version = {
2727
sourceCompatibility = 1.8
2828
targetCompatibility = 1.8
2929

30-
tasks.withType(JavaCompile) {
30+
tasks.withType(JavaCompile).configureEach {
3131
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
3232
}
3333

3434
dependencies {
35-
compileOnly "org.embulk:embulk-core:0.9.23"
35+
def embulkVersion = "0.10.42"
36+
compileOnly("org.embulk:embulk-api:${embulkVersion}")
37+
compileOnly("org.embulk:embulk-spi:${embulkVersion}")
38+
39+
compile "org.embulk:embulk-util-config:0.3.4"
40+
compile "org.embulk:embulk-util-file:0.2.0"
41+
compile "org.embulk:embulk-util-text:0.2.0"
42+
compile "org.embulk:embulk-util-timestamp:0.3.0"
43+
compile "org.embulk:embulk-util-retryhelper:0.8.0"
3644

3745
compile project(path: ":shadow-google-cloud-bigquery-helper", configuration: "shadow")
3846

3947
// compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
40-
testCompile "junit:junit:4.13"
41-
testCompile "org.slf4j:slf4j-simple:1.7.12"
42-
testCompile 'org.embulk:embulk-standards:0.9.23'
43-
testCompile 'org.embulk:embulk-test:0.9.23'
44-
testCompile "org.mockito:mockito-core:1.10.19"
45-
testCompile "org.embulk:embulk-core:0.9.23:tests"
46-
testCompile "org.embulk:embulk-deps-buffer:0.9.23"
47-
testCompile "org.embulk:embulk-deps-config:0.9.23"
48+
testImplementation "junit:junit:4.13.2"
49+
testImplementation "org.slf4j:slf4j-simple:1.7.30"
50+
testImplementation "org.mockito:mockito-core:1.10.19"
51+
testImplementation "org.embulk:embulk-core:${embulkVersion}"
52+
testImplementation "org.embulk:embulk-deps:${embulkVersion}"
53+
testImplementation "org.embulk:embulk-junit4:${embulkVersion}"
54+
testImplementation "org.embulk:embulk-input-file:0.11.1"
55+
testImplementation "org.embulk:embulk-parser-csv:0.11.6"
4856
}
4957

5058
embulkPlugin {
@@ -66,23 +74,6 @@ publishing {
6674
}
6775
}
6876

69-
checkstyle {
70-
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
71-
toolVersion = '6.14.1'
72-
}
73-
checkstyleMain {
74-
configFile = file("${project.rootDir}/config/checkstyle/default.xml")
75-
ignoreFailures = true
76-
}
77-
checkstyleTest {
78-
configFile = file("${project.rootDir}/config/checkstyle/default.xml")
79-
ignoreFailures = true
80-
}
81-
task checkstyle(type: Checkstyle) {
82-
classpath = sourceSets.main.output + sourceSets.test.output
83-
source = sourceSets.main.allJava + sourceSets.test.allJava
84-
}
85-
8677
gem {
8778
from("LICENSE") // Optional -- if you need other files in the gem.
8879
authors = [ "giwa" ]
@@ -96,3 +87,11 @@ gem {
9687
gemPush {
9788
host = "https://rubygems.org"
9889
}
90+
91+
spotless {
92+
java {
93+
importOrder()
94+
removeUnusedImports()
95+
// googleJavaFormat()
96+
}
97+
}

config/checkstyle/checkstyle.xml

Lines changed: 0 additions & 128 deletions
This file was deleted.

config/checkstyle/default.xml

Lines changed: 0 additions & 108 deletions
This file was deleted.

example/test.yml.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
json_keyfile:
2+
dataset:
3+
table:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
# This is a Gradle generated file for dependency locking.
22
# Manual edits can break the build and are not advised.
33
# This file is expected to be part of source control.
4+
com.fasterxml.jackson.core:jackson-annotations:2.6.7
5+
com.fasterxml.jackson.core:jackson-core:2.6.7
6+
com.fasterxml.jackson.core:jackson-databind:2.6.7.5
7+
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.6.7
8+
javax.validation:validation-api:1.1.0.Final
9+
org.embulk:embulk-util-config:0.3.4
10+
org.embulk:embulk-util-file:0.2.0
11+
org.embulk:embulk-util-retryhelper:0.8.0
12+
org.embulk:embulk-util-rubytime:0.4.0
13+
org.embulk:embulk-util-text:0.2.0
14+
org.embulk:embulk-util-timestamp:0.3.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)