11plugins {
2- id ' com.jfrog.bintray' version ' 1.8.4'
3- id " com.github.jruby-gradle.base" version " 1.6.0"
42 id " java"
53 id " checkstyle"
4+ id " maven-publish"
5+ id " org.embulk.embulk-plugins" version " 0.4.2"
66}
7- import com.github.jrubygradle.JRubyExec
87repositories {
98 mavenCentral()
10- jcenter()
11- maven {
12- url " https://dl.bintray.com/embulk-output-jdbc/maven"
13- }
14- }
15- configurations {
16- provided
17- defaultJdbcDriver
189}
1910
20- version = " 0.3.0"
11+ group = " io.trocco"
12+ version = " 0.3.1"
13+ description = " Dumps records to Snowflake."
2114
2215sourceCompatibility = 1.8
2316targetCompatibility = 1.8
@@ -47,31 +40,46 @@ dependencies {
4740 compile(" org.embulk:embulk-util-json:0.1.0" ) {
4841 exclude group : " org.msgpack" , module : " msgpack-core" // Included in embulk-api.
4942 }
50- testCompile " junit:junit:4.+"
51- testCompile " org.embulk:embulk-junit4:0.10.31"
52- testCompile " org.embulk:embulk-core:0.10.31"
53- testCompile " org.embulk:embulk-deps:0.10.31"
43+ testImplementation " junit:junit:4.+"
44+ testImplementation " org.embulk:embulk-junit4:0.10.31"
45+ testImplementation " org.embulk:embulk-core:0.10.31"
46+ testImplementation " org.embulk:embulk-deps:0.10.31"
5447
5548 compile " org.embulk:embulk-output-jdbc:0.10.1"
5649 compile " net.snowflake:snowflake-jdbc:3.13.5"
57- defaultJdbcDriver " net.snowflake:snowflake-jdbc:3.13.5"
5850}
59-
60- task classpath (type : Copy , dependsOn : [" jar" ]) {
61- doFirst { file(' classpath' ). deleteDir() }
62- from (configurations. runtime - configurations. provided - configurations. defaultJdbcDriver + files(jar. archivePath))
63- into ' classpath'
51+ embulkPlugin {
52+ mainClass = " org.embulk.output.snowflake.SnowflakeOutputPlugin"
53+ category = " output"
54+ type = " snowflake"
55+ }
56+ // This Gradle plugin's POM dependency modification works for "maven-publish" tasks.
57+ //
58+ // Note that "uploadArchives" is no longer supported. It is deprecated in Gradle 6 to be removed in Gradle 7.
59+ // https://github.com/gradle/gradle/issues/3003#issuecomment-495025844
60+ publishing {
61+ publications {
62+ embulkPluginMaven(MavenPublication ) { // Publish it with "publishEmbulkPluginMavenPublicationToMavenRepository".
63+ from components. java // Must be "components.java". The dependency modification works only for it.
64+ }
65+ }
66+ repositories {
67+ maven {
68+ url = " ${ project.buildDir} /mavenPublishLocal"
69+ }
70+ }
6471}
65- task defaultJdbcDriver (type : Copy , dependsOn : [" jar" ]) {
66- doFirst { file(' default_jdbc_driver' ). deleteDir() }
67- from (configurations. defaultJdbcDriver)
68- into ' default_jdbc_driver'
72+ gem {
73+ from(" LICENSE.txt" )
74+ authors = [ " giwa" ]
75+ email = [ " ugw.gi.world@gmail.com" ]
76+ summary = " Snowflake output plugin for Embulk"
77+ homepage = " https://github.com/trocco-io/embulk-output-snowflake"
78+ licenses = [ " MIT" ]
6979}
70- clean {
71- delete ' classpath'
72- delete ' default_jdbc_driver'
80+ gemPush {
81+ host = " https://rubygems.org"
7382}
74-
7583checkstyle {
7684 configFile = file(" ${ project.rootDir} /config/checkstyle/checkstyle.xml" )
7785 toolVersion = ' 6.14.1'
@@ -88,51 +96,3 @@ task checkstyle(type: Checkstyle) {
8896 classpath = sourceSets. main. output + sourceSets. test. output
8997 source = sourceSets. main. allJava + sourceSets. test. allJava
9098}
91-
92- task gem (type : JRubyExec , dependsOn : [" gemspec" , " classpath" , ' defaultJdbcDriver' ]) {
93- jrubyArgs " -S"
94- script " gem"
95- scriptArgs " build" , " ${ project.name} .gemspec"
96- doLast { ant. move(file : " ${ project.name} -${ project.version} .gem" , todir : " pkg" ) }
97- }
98-
99- task gemPush (type : JRubyExec , dependsOn : [" gem" ]) {
100- jrubyArgs " -S"
101- script " gem"
102- scriptArgs " push" , " pkg/${ project.name} -${ project.version} .gem"
103- }
104-
105- task " package" (dependsOn : [" gemspec" , " classpath" ]) {
106- doLast {
107- println " > Build succeeded."
108- println " > You can run embulk with '-L ${ file(".").absolutePath} ' argument."
109- }
110- }
111-
112- task gemspec {
113- ext. gemspecFile = file(" ${ project.name} .gemspec" )
114- inputs. file " build.gradle"
115- outputs. file gemspecFile
116- doLast { gemspecFile. write($/
117- Gem ::Specification . new do |spec|
118- spec. name = " ${ project.name} "
119- spec. version = " ${ project.version} "
120- spec. authors = [" giwa" ]
121- spec. summary = % [Snowflake output plugin for Embulk ]
122- spec. description = % [Dumps records to Snowflake . ]
123- spec. email = [" ugw.gi.world@gmail.com" ]
124- spec. licenses = [" MIT" ]
125- spec. homepage = " https://github.com/trocco-io/embulk-output-snowflake"
126-
127- spec. files = `git ls- files`. split(" \n " ) + Dir [" classpath/*.jar" ] + Dir [" default_jdbc_driver/*.jar" ]
128- spec. test_files = spec. files. grep(% r" ^(test|spec)/" )
129- spec. require_paths = [" lib" ]
130-
131- #spec. add_dependency ' YOUR_GEM_DEPENDENCY' , [' ~> YOUR_GEM_DEPENDENCY_VERSION' ]
132- spec. add_development_dependency ' bundler' , [' ~> 1.0' ]
133- spec. add_development_dependency ' rake' , [' ~> 12.0' ]
134- end
135- / $)
136- }
137- }
138- clean { delete " ${ project.name} .gemspec" }
0 commit comments