This Gradle plugin provides you with some tasks to help your Embulk plugin development.
It's tested on Gradle 4.10.3. It might not work on other version.
Add the snippets to your build.gradle
buildscript {
repositories {
jcenter()
maven { url 'http://kamatama41.github.com/maven-repository/repository' }
}
dependencies {
classpath "com.github.kamatama41:gradle-embulk-plugin:<latest-version>"
}
}
apply plugin: "com.github.kamatama41.embulk"
embulk {
version = "0.8.18"
category = "file-input"
name = "xlsx"
authors = ["A User"]
email = "[email protected]"
homepage = "https://github.com/a.user/embulk-input-xlsx"
}
So that you can generate your plugin template with the command (./gradlew|gradle) newPlugin
% gradle newPlugin
Starting a Gradle Daemon (subsequent builds will be faster)
:embulkSetup
Setting Embulk version to 0.8.18
:embulk_new_java-file-input_xlsx
2017-03-21 04:12:05.020 +0900: Embulk v0.8.18
Creating embulk-input-xlsx/
Creating embulk-input-xlsx/README.md
Creating embulk-input-xlsx/LICENSE.txt
Creating embulk-input-xlsx/.gitignore
Creating embulk-input-xlsx/gradle/wrapper/gradle-wrapper.jar
Creating embulk-input-xlsx/gradle/wrapper/gradle-wrapper.properties
Creating embulk-input-xlsx/gradlew.bat
Creating embulk-input-xlsx/gradlew
Creating embulk-input-xlsx/config/checkstyle/checkstyle.xml
Creating embulk-input-xlsx/config/checkstyle/default.xml
Creating embulk-input-xlsx/build.gradle
Creating embulk-input-xlsx/lib/embulk/input/xlsx.rb
Creating embulk-input-xlsx/src/main/java/org/embulk/input/xlsx/XlsxFileInputPlugin.java
Creating embulk-input-xlsx/src/test/java/org/embulk/input/xlsx/TestXlsxFileInputPlugin.java
Plugin template is successfully generated.
Next steps:
$ cd embulk-input-xlsx
$ ./gradlew package
:newPlugin
BUILD SUCCESSFUL
Total time: 13.166 secs
This plugin automatically adds the following dependency into your project.
org.embulk:embulk-core:<version>
newPlugin
: Generate a new plugin templateclasspath
: Copy jar files to classpath directorygemspec
: Generate a gemspec file for this plugingem
: Generate a gem filepackage
: Generate a package, which is needed to run this plugin locallycheckstyle
: Run a Checkstyle processgemPush
: Push gem file to rubygems.orgembulkSetup
: Install a version of Embulk, which you specified byversion
embulk_#{command}
: Run an embulk command (details)
You can run an embulk command with a gradle task embulk_*
, which can be added command arguments with _
.
Also, this plugin automatically sets some arguments when executing a command such as run
or guess
,
so you don't have to specify yaml path and package path by default.
-
(./gradlew|gradle) embulk_--version
- This is equivalent to
embulk --version
- This is equivalent to
-
(./gradlew|gradle) embulk_run
- This is equivalent to
embulk run config.yml -L <project_root>
- This is equivalent to
-
(./gradlew|gradle) embulk_guess
- This is equivalent to
embulk guess config.yml -o output.yml -L <project_root>
- This is equivalent to
If you want to change config.yml
or output.yml
to other file, you can do it by passing a property configYaml
or outputYaml
such like following
$ ./gradlew embulk_guess -PconfigYaml=myconfig.yml -PoutputYaml=myoutput.yml