Skip to content

Commit

Permalink
Merge pull request #20 from maji-KY/feature/new-embulk
Browse files Browse the repository at this point in the history
embulk 0.9.12
  • Loading branch information
maji-KY committed Jan 12, 2019
2 parents c14debc + fadcbbe commit a2514ce
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,7 @@ language: ruby
jdk:
- oraclejdk8
rvm:
- jruby-head
- jruby-9.1.9.0

before_script:
- curl --create-dirs -o ~/bin/embulk -L http://dl.embulk.org/embulk-latest.jar
Expand Down
24 changes: 13 additions & 11 deletions build.gradle
@@ -1,6 +1,6 @@
plugins {
id "com.jfrog.bintray" version "1.1"
id "com.github.jruby-gradle.base" version "0.1.5"
id "com.jfrog.bintray" version "1.8.4"
id "com.github.jruby-gradle.base" version "1.6.0"
id "java"
id "scala"
}
Expand All @@ -13,9 +13,9 @@ configurations {
provided
}

version = "0.2.0.pre"
version = "0.2.1.pre"
ext {
embulkVersion = "0.8.39"
embulkVersion = "0.9.12"
}

sourceCompatibility = 1.8
Expand All @@ -27,10 +27,10 @@ dependencies {
provided "org.embulk:embulk-core:${embulkVersion}"
testCompile "org.embulk:embulk-core:${embulkVersion}:tests"
testCompile "org.embulk:embulk-standards:${embulkVersion}"
testCompile "junit:junit:4.+"
testCompile "junit:junit:4.12"

compile group: 'org.scala-lang', name: 'scala-library', version: '2.12.4'
testCompile group: 'org.scalatest', name: 'scalatest_2.12', version: '3.0.4'
compile group: 'org.scala-lang', name: 'scala-library', version: '2.12.8'
testCompile group: 'org.scalatest', name: 'scalatest_2.12', version: '3.0.5'

}

Expand All @@ -49,14 +49,16 @@ test {
}

task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "build"
script "${project.name}.gemspec"
jrubyArgs "-S"
script "gem"
scriptArgs "build", "${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"
jrubyArgs "-S"
script "gem"
scriptArgs "push", "pkg/${project.name}-${project.version}.gem"
}

task "package"(dependsOn: ["gemspec", "classpath"]) {
Expand Down
8 changes: 4 additions & 4 deletions build.sbt
@@ -1,8 +1,8 @@
val embulkVersion = "0.8.39"
val embulkVersion = "0.9.12"

lazy val commonSettings = Seq(
organization := "com.github.maji-KY",
scalaVersion := "2.12.4",
scalaVersion := "2.12.8",
version := "CANNOT_RELEASE",
scalacOptions ++= Seq(
"-deprecation",
Expand All @@ -19,8 +19,8 @@ lazy val commonSettings = Seq(
"com.ximpleware" % "vtd-xml" % "2.13.4",
"org.embulk" % "embulk-core" % embulkVersion,
"org.embulk" % "embulk-core" % embulkVersion classifier "tests",
"junit" % "junit" % "4.+" % "test",
"org.scalatest" %% "scalatest" % "3.0.4" % "test"
"junit" % "junit" % "4.12" % "test",
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
)
)

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=1.0.1
sbt.version=1.2.8
Expand Up @@ -32,7 +32,7 @@ class XPath2ParserPlugin extends ParserPlugin {
val stopOnInvalidRecord: Boolean = task.getStopOnInvalidRecord

val timestampParsers: Map[String, TimestampParser] = task.getSchema.columns.asScala
.collect { case ColumnConfig(_, name, _, Some(timestampColumnOption), _, _) => (name, new TimestampParser(task, timestampColumnOption)) }.toMap
.collect { case ColumnConfig(_, name, _, Some(timestampColumnOption), _, _) => (name, TimestampParser.of(task, timestampColumnOption)) }.toMap

val jsonStructures: Map[String, Seq[JsonStructureElement]] = task.getSchema.columns.asScala
.collect { case ColumnConfig(_, name, _, _, Some(jsonColumnOption), _) => (name, jsonColumnOption.structure.asScala) }.toMap
Expand Down
Expand Up @@ -7,7 +7,6 @@ import com.google.common.base.Optional
import org.embulk.config.{Config, ConfigDefault, ConfigSource}
import org.embulk.spi.`type`.{JsonType, TimestampType, Type}
import org.embulk.spi.time.TimestampParser.TimestampColumnOption
import org.joda.time.DateTimeZone

case class SchemaConfig @JsonCreator()(columns: java.util.List[ColumnConfig]) {
@JsonValue()
Expand All @@ -33,19 +32,19 @@ case class ColumnConfig(path: String, name: String, `type`: Type, timestampOptio

}

private class TimestampColumnOptionImpl(timezone: Optional[DateTimeZone], format: Optional[String], date: Optional[String]) extends TimestampColumnOption {
private class TimestampColumnOptionImpl(timezone: Optional[String], format: Optional[String], date: Optional[String]) extends TimestampColumnOption {

@JsonCreator()
def this(src: ConfigSource) = {
this(
src.get(classOf[Optional[String]], "timezone", Optional.absent[String]()).transform(x => DateTimeZone.forID(x)),
src.get(classOf[Optional[String]], "timezone", Optional.absent[String]()),
src.get(classOf[Optional[String]], "format", Optional.absent[String]()),
src.get(classOf[Optional[String]], "date", Optional.absent[String]()))
}

@Config("timezone")
@ConfigDefault("null")
override val getTimeZone = timezone
override val getTimeZoneId = timezone

@Config("format")
@ConfigDefault("null")
Expand Down

0 comments on commit a2514ce

Please sign in to comment.