Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate for Embulk v0.1x #4

Merged
merged 1 commit into from
Dec 20, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: push gem
uses: trocco-io/push-gem-to-gpr-action@v1
uses: trocco-io/push-gem-to-gpr-action@v2
with:
language: java
gem-path: "./pkg/*.gem"
gem-path: "./build/gems/*.gem"
github-token: "${{ secrets.GITHUB_TOKEN }}"
140 changes: 35 additions & 105 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,134 +1,64 @@
plugins {
id "com.jfrog.bintray" version "1.1"
id "com.github.jruby-gradle.base" version "1.5.0"
id "java"
id "checkstyle"
id "com.palantir.git-version" version "3.0.0"
id "org.embulk.embulk-plugins" version "0.7.0"
id "com.palantir.git-version" version "3.1.0"
}

import com.github.jrubygradle.JRubyExec
repositories {
mavenCentral()
jcenter()
}
configurations {
provided
}

group = "trocco-io"
version = {
def vd = versionDetails()
if (vd.commitDistance == 0 && vd.lastTag ==~ /^v?[0-9]+\.[0-9]+\.[0-9]+([.-][a-zA-Z0-9.-]+)?/) {
vd.lastTag.replaceFirst(/^v/, "")
if (vd.commitDistance == 0 && vd.lastTag ==~ /^[0-9]+\.[0-9]+\.[0-9]+([.-][.a-zA-Z0-9-]+)?/) {
vd.lastTag
} else {
"0.0.0.${vd.gitHash}"
}
}()
description = "Loads records from Cloudwatch Logs."

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
compile "org.embulk:embulk-core:0.10.1"
provided "org.embulk:embulk-core:0.10.1"
implementation "com.google.guava:guava:28.2-jre"
compile group: 'com.amazonaws', name: 'aws-java-sdk-logs', version: '1.11.749'
compile group: 'com.amazonaws', name: 'aws-java-sdk-sts', version: '1.11.749'
// compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
testCompile "junit:junit:4.+"
testCompile "org.mockito:mockito-core:1.+"
testCompile "org.embulk:embulk-core:0.10.1:tests"
testCompile "org.embulk:embulk-standards:0.10.1"
testCompile "org.embulk:embulk-junit4:0.10.1"
testCompile "org.embulk:embulk-deps-buffer:0.10.1"
testCompile "org.embulk:embulk-deps-config:0.10.1"
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

// add tests/javadoc/source jar tasks as artifacts to be released
task testsJar(type: Jar, dependsOn: classes) {
classifier = 'tests'
from sourceSets.test.output
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

task classpath(type: Copy, dependsOn: ["jar"]) {
doFirst { file("classpath").deleteDir() }
from (configurations.runtime - configurations.provided + files(jar.archivePath))
into "classpath"
configurations {
compileClasspath.resolutionStrategy.activateDependencyLocking()
runtimeClasspath.resolutionStrategy.activateDependencyLocking()
}
clean { delete "classpath" }

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
}
dependencies {
compileOnly "org.embulk:embulk-spi:0.11"

task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
jrubyArgs "-S"
script "gem"
scriptArgs "build", "${project.name}.gemspec"
doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
}
implementation "org.embulk:embulk-util-config:0.3.4"
implementation "com.google.guava:guava:28.2-jre"
implementation "com.amazonaws:aws-java-sdk-logs:1.11.749"
implementation "com.amazonaws:aws-java-sdk-sts:1.11.749"

task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
jrubyArgs "-S"
script "gem"
scriptArgs "push", "pkg/${project.name}-${project.version}.gem"
testImplementation "junit:junit:4.+"
testImplementation "org.mockito:mockito-core:1.+"
testImplementation "org.embulk:embulk-core:0.11.5"
testImplementation "org.embulk:embulk-deps:0.11.5"
testImplementation "org.embulk:embulk-junit4:0.11.5"
}

task "package"(dependsOn: ["gemspec", "classpath"]) {
doLast {
println "> Build succeeded."
println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:all" << "-Xlint:-serial"
}

artifacts {
archives testsJar, sourcesJar, javadocJar
embulkPlugin {
mainClass = "org.embulk.input.cloudwatch_logs.CloudwatchLogsInputPlugin"
category = "input"
type = "cloudwatch_logs"
}

task gemspec {
ext.gemspecFile = file("${project.name}.gemspec")
inputs.file "build.gradle"
outputs.file gemspecFile
doLast { gemspecFile.write($/
Gem::Specification.new do |spec|
spec.name = "${project.name}"
spec.version = "${project.version}"
spec.authors = ["Hiroshi Hatake"]
spec.summary = %[Cloudwatch Logs input plugin for Embulk]
spec.description = %[Loads records from Cloudwatch Logs.]
spec.email = ["[email protected]"]
spec.licenses = ["MIT"]
spec.homepage = "https://github.com/cosmo0920/embulk-input-cloudwatch_logs"

spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
spec.test_files = spec.files.grep(%r"^(test|spec)/")
spec.require_paths = ["lib"]

#spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
spec.add_development_dependency 'bundler', ['~> 1.0']
spec.add_development_dependency 'rake', ['~> 12.0']
end
/$)
}
gem {
authors = [ "Hiroshi Hatake" ]
email = [ "[email protected]" ]
summary = "Cloudwatch Logs input plugin for Embulk"
homepage = "https://github.com/trocco-io/embulk-input-cloudwatch_logs"
licenses = [ "MIT" ]
}
clean { delete "${project.name}.gemspec" }
31 changes: 31 additions & 0 deletions gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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.amazonaws:aws-java-sdk-core:1.11.749=compileClasspath,runtimeClasspath
com.amazonaws:aws-java-sdk-logs:1.11.749=compileClasspath,runtimeClasspath
com.amazonaws:aws-java-sdk-sts:1.11.749=compileClasspath,runtimeClasspath
com.amazonaws:jmespath-java:1.11.749=compileClasspath,runtimeClasspath
com.fasterxml.jackson.core:jackson-annotations:2.6.7=compileClasspath,runtimeClasspath
com.fasterxml.jackson.core:jackson-core:2.6.7=compileClasspath,runtimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.6.7.5=compileClasspath,runtimeClasspath
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7=compileClasspath,runtimeClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.6.7=compileClasspath,runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath
com.google.errorprone:error_prone_annotations:2.3.4=compileClasspath,runtimeClasspath
com.google.guava:failureaccess:1.0.1=compileClasspath,runtimeClasspath
com.google.guava:guava:28.2-jre=compileClasspath,runtimeClasspath
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath
com.google.j2objc:j2objc-annotations:1.3=compileClasspath,runtimeClasspath
commons-codec:commons-codec:1.11=compileClasspath,runtimeClasspath
commons-logging:commons-logging:1.2=compileClasspath,runtimeClasspath
javax.validation:validation-api:1.1.0.Final=compileClasspath,runtimeClasspath
joda-time:joda-time:2.8.1=compileClasspath,runtimeClasspath
org.apache.httpcomponents:httpclient:4.5.9=compileClasspath,runtimeClasspath
org.apache.httpcomponents:httpcore:4.4.11=compileClasspath,runtimeClasspath
org.checkerframework:checker-qual:2.10.0=compileClasspath,runtimeClasspath
org.embulk:embulk-spi:0.11=compileClasspath
org.embulk:embulk-util-config:0.3.4=compileClasspath,runtimeClasspath
org.msgpack:msgpack-core:0.8.24=compileClasspath
org.slf4j:slf4j-api:2.0.7=compileClasspath
software.amazon.ion:ion-java:1.0.2=compileClasspath,runtimeClasspath
empty=
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-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 0 additions & 3 deletions lib/embulk/input/cloudwatch_logs.rb

This file was deleted.

Loading
Loading