From 44df3eb431b88529143aba924f396a3fd7c894fd Mon Sep 17 00:00:00 2001 From: d-hrs Date: Tue, 7 Mar 2023 17:31:07 +0900 Subject: [PATCH] build with embulk-plugins --- .github/workflows/gem-push.yml | 2 +- build.gradle | 55 ++++++++-------------------------- 2 files changed, 13 insertions(+), 44 deletions(-) diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index 65d43cd..ea3285e 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -23,5 +23,5 @@ jobs: uses: trocco-io/push-gem-to-gpr-action@v1 with: language: java - gem-path: "./pkg/*.gem" + gem-path: "./build/gems/*.gem" github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/build.gradle b/build.gradle index 3f95cd9..bbdf93c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ plugins { + id "org.embulk.embulk-plugins" version "0.5.5" id "com.jfrog.bintray" version "1.1" id "com.github.jruby-gradle.base" version "1.5.0" id "java" @@ -69,50 +70,18 @@ task checkstyle(type: Checkstyle) { source = sourceSets.main.allJava + sourceSets.test.allJava } -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") } -} - -task gemPush(type: JRubyExec, dependsOn: ["gem"]) { - jrubyArgs "-S" - script "gem" - scriptArgs "push", "pkg/${project.name}-${project.version}.gem" -} -task "package"(dependsOn: ["gemspec", "classpath"]) { - doLast { - println "> Build succeeded." - println "> You can run embulk with '-L ${file(".").absolutePath}' argument." - } +embulkPlugin { + mainClass = "org.embulk.input.athena.AthenaInputPlugin" + category = "input" + type = "athena" } -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 = ["shinji19"] - spec.summary = %[Athena input plugin for Embulk] - spec.description = %[Loads records from Athena.] - spec.email = [""] - spec.licenses = ["MIT"] - spec.homepage = "https://github.com/shinji19/embulk-input-athena" - - 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', ['>= 10.0'] -end -/$) - } +gem { + from("LICENSE") + authors = [ "shinji19" ] + summary = "Athena input plugin for Embulk" + description = "Loads records from Athena." + homepage = "https://github.com/trocco-io/embulk-input-athena" + licenses = [ "MIT" ] } -clean { delete "${project.name}.gemspec" }