Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: lint
run: ./gradlew spotlessCheck
- name: Test
run: ./gradlew test
build:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ build/
.classpath
.project
config.yml
test.yml
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,16 @@ $ ./gradlew gem # -t to watch change of files and rebuild continuously
```
$ embulk run config.yml -L PATH/embulk-output-bigquery_java/build/gemContents/
```

## TEST


```
$ ./gradlew test
```

Real bigquery connection tests are normally disabled. To enable them, set the EMBULK_OUTPUT_BIGQUERY_TEST_CONFIG environment variable to config.yml path.

```
$ EMBULK_OUTPUT_BIGQUERY_TEST_CONFIG="example/test.yml" ./gradlew test # Create example/test.yml based on example/test.yml.example
```
57 changes: 28 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id "com.github.johnrengelman.shadow" version "5.2.0" apply false
id "java"
id "checkstyle"
id "maven-publish"
id "com.diffplug.spotless" version "5.17.1"
id "org.embulk.embulk-plugins" version "0.4.1"
id "com.palantir.git-version" version "0.12.3"
id "com.adarshr.test-logger" version "3.0.0"
}

repositories {
mavenCentral()
jcenter()
}

group = "io.trocco"
Expand All @@ -27,24 +27,32 @@ version = {
sourceCompatibility = 1.8
targetCompatibility = 1.8

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}

dependencies {
compileOnly "org.embulk:embulk-core:0.9.23"
def embulkVersion = "0.10.42"
compileOnly("org.embulk:embulk-api:${embulkVersion}")
compileOnly("org.embulk:embulk-spi:${embulkVersion}")

compile "org.embulk:embulk-util-config:0.3.4"
compile "org.embulk:embulk-util-file:0.2.0"
compile "org.embulk:embulk-util-text:0.2.0"
compile "org.embulk:embulk-util-timestamp:0.3.0"
compile "org.embulk:embulk-util-retryhelper:0.8.0"

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

// compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
testCompile "junit:junit:4.13"
testCompile "org.slf4j:slf4j-simple:1.7.12"
testCompile 'org.embulk:embulk-standards:0.9.23'
testCompile 'org.embulk:embulk-test:0.9.23'
testCompile "org.mockito:mockito-core:1.10.19"
testCompile "org.embulk:embulk-core:0.9.23:tests"
testCompile "org.embulk:embulk-deps-buffer:0.9.23"
testCompile "org.embulk:embulk-deps-config:0.9.23"
testImplementation "junit:junit:4.13.2"
testImplementation "org.slf4j:slf4j-simple:1.7.30"
testImplementation "org.mockito:mockito-core:1.10.19"
testImplementation "org.embulk:embulk-core:${embulkVersion}"
testImplementation "org.embulk:embulk-deps:${embulkVersion}"
testImplementation "org.embulk:embulk-junit4:${embulkVersion}"
testImplementation "org.embulk:embulk-input-file:0.11.1"
testImplementation "org.embulk:embulk-parser-csv:0.11.6"
}

embulkPlugin {
Expand All @@ -66,23 +74,6 @@ publishing {
}
}

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
}

gem {
from("LICENSE") // Optional -- if you need other files in the gem.
authors = [ "giwa" ]
Expand All @@ -96,3 +87,11 @@ gem {
gemPush {
host = "https://rubygems.org"
}

spotless {
java {
importOrder()
removeUnusedImports()
// googleJavaFormat()
}
}
128 changes: 0 additions & 128 deletions config/checkstyle/checkstyle.xml

This file was deleted.

108 changes: 0 additions & 108 deletions config/checkstyle/default.xml

This file was deleted.

3 changes: 3 additions & 0 deletions example/test.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
json_keyfile:
dataset:
table:
11 changes: 11 additions & 0 deletions gradle/dependency-locks/embulkPluginRuntime.lockfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson.core:jackson-annotations:2.6.7
com.fasterxml.jackson.core:jackson-core:2.6.7
com.fasterxml.jackson.core:jackson-databind:2.6.7.5
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.6.7
javax.validation:validation-api:1.1.0.Final
org.embulk:embulk-util-config:0.3.4
org.embulk:embulk-util-file:0.2.0
org.embulk:embulk-util-retryhelper:0.8.0
org.embulk:embulk-util-rubytime:0.4.0
org.embulk:embulk-util-text:0.2.0
org.embulk:embulk-util-timestamp:0.3.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading