Skip to content

Commit

Permalink
Merge pull request #20 from yuokada/migrate
Browse files Browse the repository at this point in the history
Replace travis to Github Actions
  • Loading branch information
yuokada authored Dec 8, 2019
2 parents e29a7ca + ae42a74 commit 43711e1
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 28 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Java CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run:
./gradlew build
- name: Checkstyle & static check
run: |
./gradlew --info checkstyle
./gradlew --info check
# - name: Spotbugs
# run: |
# ./gradlew spotbugsMain spotbugsTest
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id "java"
id "scala"
id "checkstyle"
// id "com.github.spotbugs" version "3.0.1"
id "org.sonarqube" version "2.5"
}
import com.github.jrubygradle.JRubyExec
Expand All @@ -25,8 +26,8 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
compile "org.embulk:embulk-core:0.8.34"
provided "org.embulk:embulk-core:0.8.34"
compile "org.embulk:embulk-core:0.8.39"
provided "org.embulk:embulk-core:0.8.39"
compile "org.scala-lang:scala-library:2.12.+"

compile "org.apache.orc:orc:1.5.4"
Expand All @@ -42,8 +43,8 @@ dependencies {
// testCompile "junit:junit:4.+"
testCompile 'org.hamcrest:hamcrest-core:1.3'
testCompile 'org.testng:testng:6.14.2'
testCompile "org.embulk:embulk-core:0.8.34:tests"
testCompile "org.embulk:embulk-standards:0.8.34"
testCompile "org.embulk:embulk-core:0.8.39:tests"
testCompile "org.embulk:embulk-standards:0.8.39"
}

sourceSets {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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-5.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 17 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/embulk/output/orc/OrcOutputPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private Writer createWriter(PluginTask task, Schema schema, int processorIndex)
);
}
catch (IOException e) {
Throwables.propagate(e);
Throwables.throwIfUnchecked(e);
}
return writer;
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/scala/org/embulk/output/orc/OrcOutputPluginHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ object OrcOutputPluginHelper {
case "file" =>
try Files.deleteIfExists(Paths.get(fpath))
catch {
case e: IOException =>
Throwables.propagate(e)
case e: IOException => Throwables.throwIfUnchecked(e)
}
case "s3" | "s3n" | "s3a" =>
val s3Url = parseS3Url(fpath)
Expand All @@ -36,8 +35,8 @@ object OrcOutputPluginHelper {
case _ => false
}

def getSchema(fpath: String) = {
val schema = fpath.split("://").toList.apply(0)
def getSchema(fpath: String): String = {
val schema = fpath.split("://").toList.head
schema match {
case "s3" | "s3a" | "s3n" => schema
case _ => {
Expand All @@ -47,12 +46,13 @@ object OrcOutputPluginHelper {
}
}

def parseS3Url(s3url: String) = {
def parseS3Url(s3url: String): AmazonS3URILikeObject = {
val parts = s3url.split("(://|/)").toList
val bucket = parts.apply(1)
val key = parts.slice(2, parts.size).mkString("/")
new OrcOutputPluginHelper.AmazonS3URILikeObject(bucket, key)
}

case class AmazonS3URILikeObject(@BeanProperty bucket: String, @BeanProperty key: String)

}

0 comments on commit 43711e1

Please sign in to comment.