embulk-filter-oracle_lookup 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 464d119de6b47a6bf44852894d18683571b22c8ceda27fa1c64b9c6dc1fb4509
4
- data.tar.gz: 535810408776e0794d970b42d2d293d6e3611e2e194ac31d15d2261d77c707e4
3
+ metadata.gz: a4d201a6b3ae08b5d26da16dd35171de259dec14f4b365eee3e373c23015b8f0
4
+ data.tar.gz: 8385fd851b6e517c2228d4a391d498fff3e4efceca2e0db3db2e69b4767910bc
5
5
  SHA512:
6
- metadata.gz: 61ff1c40c30d4d70b3123e1e9e9e8579fe4e098ff046c2ae9a0d6cdf45fa2ed3b747ba60c8d386b19eda3cbc005b55449a19bbe485b6a27d3341103915d59fd7
7
- data.tar.gz: 27ffa03a0cb5f62cb47175a10b42506eb413c158f9c6592804080ab658f25886e62ada60d8f5d9b007172777db1be2dd933ccd1d050ce9be47c3f900ec3e3fa6
6
+ metadata.gz: 210a2a22904444a7102a7aa2ede014741b6f6314d0d92474034d9395ad3a1ca3a5f19aef5eeb89b57e4131927f8ddb26120f3403b898955547eb7fe80410c3f2
7
+ data.tar.gz: a89dcb296577116eb391c8fcec467bf7230b4291bc05e89c81bc8c9d88bc58f94c60f9b8ab0c19e252d01312cfec79e42e18ca8f7abec5e11f57bb7785bd11a1
data/.gitignore CHANGED
@@ -1,12 +1,12 @@
1
- *~
2
- /pkg/
3
- /tmp/
4
- *.gemspec
5
- .gradle/
6
- /classpath/
7
- build/
8
- .idea
9
- /.settings/
10
- /.metadata/
11
- .classpath
12
- .project
1
+ *~
2
+ /pkg/
3
+ /tmp/
4
+ *.gemspec
5
+ .gradle/
6
+ /classpath/
7
+ build/
8
+ .idea
9
+ /.settings/
10
+ /.metadata/
11
+ .classpath
12
+ .project
data/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2022 InfoObjects
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1
+ Copyright (c) 2022 InfoObjects
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
22
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,149 +1,164 @@
1
-
2
- <p align="center">
3
- <a href="https://www.infoobjects.com/" target="blank"><img src="screenshots/logo.png" width="150" alt="InfoObjects Logo" /></a>
4
- </p>
5
- <p align="center">Infoobjects is a consulting company that helps enterprises transform how and where they run applications and infrastructure.
6
- From strategy, to implementation, to ongoing managed services, Infoobjects creates tailored cloud solutions for enterprises at all stages of the cloud journey.</p>
7
-
8
- # Postgres lookup filter plugin for Embulk
9
- [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
-
11
- # Oracle lookup filter plugin for Embulk
12
-
13
- An Embulk filter plugin for Lookup Transformation with Oracle database
14
-
15
- ## Configuration
16
-
17
- - **oracle_lookup**: Required attributes for the LookUp Filter Plugin -
18
- - **driver_path**: driver path for your driver which you installed in your system (example `C:/Users/Abhishek Gupta/Desktop/mysql-connector-java-8.0.29-tidb-1.0.1.jar`)
19
- - **driver_class**: driver class name (example `oracle.jdbc.driver.OracleDriver`)
20
- - **host**: database host (example `localhost`) (required)
21
- - **port**: database port (example port for oracle `1521`) (required)
22
- - **database**: database name (required)
23
- - **table**: table name of your database (required)
24
- - **username**: username for your database (required)
25
- - **password**: password for database (required)
26
- - **mapping_from**: (Name of columns to be matched with table 2 columns) (required)
27
- - **Name of column-1**: column name-1 from input file
28
- - **Name of column-2**: column name-2 from input file etc ...
29
- - **mapping_to**: (Name of columns to be matched with table 1 columns) (required)
30
- - **Name of column-1**: column name-1 from input file
31
- - **Name of column-2**: column name-2 from input file
32
- - **new_columns**: (New generated column names) (required)
33
- - **Name-1,Type-1**: Any Name, Type of the name (name: country_name, type: string)
34
- - **Name-2,Type-2**: Any Name, Type of the name (name: country_address, type: string) etc ...
35
- ## Example - columns
36
-
37
- Input1 for table 1 is as follows :-
38
-
39
- ```
40
- year country_code country_name literacy_rate
41
-
42
- 1990 1 India 80%
43
- 1993 2 USA 83%
44
- 1997 3 JAPAN
45
- 1999 4 China 72%
46
- 2000 5 Ukraine 68%
47
- 2002 6 Italy 79%
48
- 2004 7 UK 75%
49
- 2011 8 NULL 42%
50
- ```
51
-
52
- Input2 for table 2 is as follows :-
53
-
54
- ```
55
- id country_population country_address country_GDP
56
-
57
- 1 11.3 India 1.67
58
- 2 18.2 USA 16.72
59
- 3 30 JAPAN 5.00
60
- 4 4 China 9.33
61
- 5 57 Ukraine 1.08
62
- 6 63 Italy 2.068
63
- 7 17 UK 2.49
64
- 8 28 UAE 1.18
65
-
66
-
67
- Note: country_population is calculated in Billion and country_GDP is calculated in $USD Trillion
68
- ```
69
-
70
- As shown in yaml below, columns mentioned in mapping_from will be mapped with columns mentioned in mapping_to
71
- ie:
72
-
73
-
74
- country_code : id
75
- country_name : country_address
76
-
77
- After successful mapping an Output.csv file containing the columns mentioned in new_columns will be generated
78
-
79
-
80
-
81
- Output File generated :-
82
-
83
- ```
84
- year country_code country_name literacy_rate country_GDP country_population
85
-
86
- 1990 1 India 80% 1.67 11.3
87
- 1993 2 USA 83% 16.72 18.2
88
- 1997 3 JAPAN 5.00 30
89
- 1999 4 China 72% 9.33 4
90
- 2000 5 Ukraine 68% 1.08 57
91
- 2002 6 Italy 79% 2.068 63
92
- 2004 7 UK 75% 2.49 17
93
- 2011 8 NULL 42%
94
- ```
95
-
96
-
97
-
98
- ```yaml
99
- - type: oracle_lookup
100
- lookup_destination: mysql
101
- host: localhost
102
- port: 1521
103
- database: XE
104
- tablename: country
105
- username: sys as sysdba
106
- password: root
107
- mapping_from:
108
- - quarter_number
109
- - attr_1
110
- mapping_to:
111
- - id
112
- - country_address
113
- new_columns:
114
- - { name: country_name, type: string }
115
- - { name: country_address, type: string }
116
- ```
117
-
118
- Notes:
119
- 1. mapping_from attribute should be in same order as mentioned in input file.
120
-
121
- ## Development
122
-
123
- Run example:
124
-
125
- ```
126
- $ ./gradlew package
127
- $ embulk run -I ./lib seed.yml
128
- ```
129
-
130
- Deployment Steps:
131
-
132
- ```
133
- Install ruby in your machine
134
- $ gem install gemcutter (For windows OS)
135
-
136
- $ ./gradlew gemPush
137
- $ gem build NameOfYourPlugins (example: embulk-filter-oracle_lookup)
138
- $ gem push embulk-filter-oracle_lookup-0.1.0.gem (You will get this name after running above command)
139
- ```
140
-
141
-
142
- Release gem:
143
-
144
- ```
145
- $ ./gradlew gemPush
146
- ```
147
- ## Licensing
148
-
1
+
2
+ <p align="center">
3
+ <a href="https://www.infoobjects.com/" target="blank"><img src="screenshots/logo.png" width="150" alt="InfoObjects Logo" /></a>
4
+ </p>
5
+ <p align="center">Infoobjects is a consulting company that helps enterprises transform how and where they run applications and infrastructure.
6
+ From strategy, to implementation, to ongoing managed services, Infoobjects creates tailored cloud solutions for enterprises at all stages of the cloud journey.</p>
7
+
8
+ # Oracle lookup filter plugin for Embulk
9
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
+
11
+
12
+ An Embulk filter plugin for Lookup Transformation with Oracle database
13
+
14
+ ## Configuration
15
+
16
+ - **oracle_lookup**: Required attributes for the LookUp Filter Plugin -
17
+ - **driver_path**: driver path for your driver which you installed in your system(required) (example `....Path..../jarname.jar`)
18
+ - **driver_class**: driver class name(required) (example `oracle.jdbc.driver.OracleDriver`)
19
+ - **host**: database host (example `localhost`) (required)
20
+ - **port**: database port (example port for oracle `1521`) (required)
21
+ - **database**: database name (required)
22
+ - **url**: url name (Either url or sid must be provided)
23
+ - **sid_name**: sid name (Either url or sid must be provided)
24
+ - **table_name**: table name of your database (required)
25
+ - **username**: username for your database (required)
26
+ - **password**: password for database (required)
27
+ - **mapping_from**: (Name of columns to be matched with table 2 columns) (required)
28
+ - **Name of column-1**: column name-1 from input file
29
+ - **Name of column-2**: column name-2 from input file etc ...
30
+ - **mapping_to**: (Name of columns to be matched with table 1 columns) (required)
31
+ - **Name of column-1**: column name-1 from input file
32
+ - **Name of column-2**: column name-2 from input file
33
+ - **new_columns**: (New generated column names) (required)
34
+ - **Name-1,Type-1**: Any Name, Type of the name (name: pin, type: string)
35
+ - **Name-2,Type-2**: Any Name, Type of the name (name: gender, type: string)
36
+ - **Name-3,Type-3**: Any Name, Type of the name (name: phone_number, type: string) etc ...
37
+ ## Example - columns
38
+
39
+ Customer.csv for table 1 is as follows :-
40
+
41
+ ```
42
+ id customer_name address email car_name company
43
+ 1 John Doe 123 Main St, Anytown USA john.doe@example.com Civic Honda
44
+ 2 Jane Smith 456 Elm St, Anytown USA jane.smith@example.com E-Class Mercedes-Benz
45
+ 3 Bob Johnson 789 Oak St, Anytown USA bob.johnson@example.com GLE-Class Mercedes-Benz
46
+ 4 Amanda Hernandez 999 Cedar St, Anytown USA amanda.hernandez@example.com 911 119
47
+ 5 Tom Brown 567 Pine St, Anytown USA tom.brown@example.com C-Class Mercedes-Benz
48
+ 6 Samantha Davis 890 Cedar St, Anytown USA samantha.davis@example.com Civic Honda
49
+ 7 Mike Wilson 1234 Spruce St, Anytown USA mike.wilson@example.com GLE-Class Mercedes-Benz
50
+ 8 Jason Brown 888 Pine St, Anytown USA jason.brown@example.com 911 Porsche
51
+ 9 David Rodriguez 9010 Oak St, Anytown USA david.rodriguez@example.com GLC-Class Mercedes-Benz
52
+ 10 Mark Davis 666 Spruce St, Anytown USA mark.davis@example.com C-Class Mercedes-Benz
53
+ 11 Chris Thompson 222 Cedar St, Anytown USA chris.thompson@example.com Cayenne Porsche
54
+ 12 Linda Young 555 Birch St, Anytown USA linda.young@example.com RAV4
55
+ 13 Kevin Hernandez 444 Maple St, Anytown USA kevin.hernandez@example.com 911 119
56
+ ```
57
+
58
+ Car.csv for table 2 is as follows :-
59
+
60
+ ```
61
+ car_id model brand category fuel_capacity
62
+ 87 GLE-Class Mercedes-Benz SUV 80
63
+ 101 Cayenne Porsche SUV 75
64
+ 119 911 Porsche Sports Car 64
65
+ 205 Accord Honda Sedan 56
66
+ 334 Pilot Honda SUV 70
67
+ 434 CR-v Honda SUV 64
68
+ 559 C-Class Mercedes-Benz Sedan 66
69
+ 603 Civic Honda Sedan 42
70
+ 697 E-Class Mercedes-Benz Sedan 72
71
+ 812 GLC-Class Mercedes-Benz Sedan 68
72
+
73
+
74
+ ```
75
+
76
+ As shown in yaml below, columns mentioned in mapping_from will be mapped with columns mentioned in mapping_to
77
+ ie:
78
+
79
+ car_name : model
80
+ company : brand
81
+
82
+ After successful mapping an Output.csv file containing the columns mentioned in new_columns will be generated
83
+
84
+ Output File generated :-
85
+
86
+ ```
87
+ id customer_name address email car_name company car_id category fuel_capacity
88
+ 1 John Doe 123 Main St, Anytown USA john.doe@example.com Civic Honda 603 Sedan 42
89
+ 2 Jane Smith 456 Elm St, Anytown USA jane.smith@example.com E-Class Mercedes-Benz 697 Sedan 72
90
+ 3 Bob Johnson 789 Oak St, Anytown USA bob.johnson@example.com GLE-Class Mercedes-Benz 87 SUV 80
91
+ 4 Amanda Hernandez 999 Cedar St, Anytown USA amanda.hernandez@example.com 911 119 0
92
+ 5 Tom Brown 567 Pine St, Anytown USA tom.brown@example.com C-Class Mercedes-Benz 559 Sedan 66
93
+ 6 Samantha Davis 890 Cedar St, Anytown USA samantha.davis@example.com Civic Honda 603 Sedan 42
94
+ 7 Mike Wilson 1234 Spruce St, Anytown USA mike.wilson@example.com GLE-Class Mercedes-Benz 87 SUV 80
95
+ 8 Jason Brown 888 Pine St, Anytown USA jason.brown@example.com 911 Porsche 119 Sport Car 64
96
+ 9 David Rodriguez 9010 Oak St, Anytown USA david.rodriguez@example.com GLC-Class Mercedes-Benz 812 SUV 68
97
+ 10 Mark Davis 666 Spruce St, Anytown USA mark.davis@example.com C-Class Mercedes-Benz 559 Sedan 66
98
+ 11 Chris Thompson 222 Cedar St, Anytown USA chris.thompson@example.com Cayenne Porsche 101 SUV 75
99
+ 12 Linda Young 555 Birch St, Anytown USA linda.young@example.com RAV4 \N 0
100
+ 13 Kevin Hernandez 444 Maple St, Anytown USA kevin.hernandez@example.com 911 119 0
101
+
102
+ ```
103
+
104
+
105
+
106
+ ```yaml
107
+ filters:
108
+ - type: oracle_lookup
109
+ url: jdbc:oracle:thin:@localhost:1521:orcl
110
+ driver_path: "C:/drivers/ojdbc8.jar"
111
+ driver_class: 'oracle.jdbc.driver.OracleDriver'
112
+ table_name: car
113
+ username: MYUSER
114
+ password: ABCD
115
+ mapping_from:
116
+ - car_name
117
+ - company
118
+ mapping_to:
119
+ - name_of_car
120
+ - brand
121
+ new_columns:
122
+ - { name: car_id, type: string }
123
+ - { name: category, type: string }
124
+ - { name: fuel_capacity, type: string }
125
+ ```
126
+
127
+ Notes:
128
+ 1. mapping_from attribute should be in the same order as mentioned in the input file.
129
+
130
+ 2. In case with JDBC plugin if any integer column returned as float/decimal then use to cast that column as long as below
131
+ ```
132
+ column_options:
133
+ id: {value_type: long}
134
+ ```
135
+ 3. Matching columns data types must be int,long and String
136
+ ## Development
137
+
138
+ Run example:
139
+
140
+ ```
141
+ $ ./gradlew package
142
+ $ embulk run -I ./lib seed.yml
143
+ ```
144
+
145
+ Deployment Steps:
146
+
147
+ ```
148
+ Install ruby in your machine
149
+ $ gem install gemcutter (For windows OS)
150
+
151
+ $ ./gradlew gemPush
152
+ $ gem build NameOfYourPlugins (example: embulk-filter-oracle_lookup)
153
+ $ gem push embulk-filter-oracle_lookup-0.1.0.gem (You will get this name after running above command)
154
+ ```
155
+
156
+
157
+ Release gem:
158
+
159
+ ```
160
+ $ ./gradlew gemPush
161
+ ```
162
+ ## Licensing
163
+
149
164
  InfoObjects [license](LICENSE) (MIT License)
data/build.gradle CHANGED
@@ -1,98 +1,98 @@
1
- plugins {
2
- id "com.jfrog.bintray" version "1.1"
3
- id "com.github.jruby-gradle.base" version "1.5.0"
4
- id "java"
5
- id "checkstyle"
6
- }
7
- import com.github.jrubygradle.JRubyExec
8
- repositories {
9
- mavenCentral()
10
- jcenter()
11
- }
12
- configurations {
13
- provided
14
- }
15
-
16
- version = "0.2.3"
17
-
18
- sourceCompatibility = 1.8
19
- targetCompatibility = 1.8
20
-
21
- dependencies {
22
- compile "org.embulk:embulk-core:0.9.8"
23
- provided "org.embulk:embulk-core:0.9.8"
24
- // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
25
- testCompile "junit:junit:4.+"
26
- compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.19'
27
- }
28
-
29
- task classpath(type: Copy, dependsOn: ["jar"]) {
30
- doFirst { file("classpath").deleteDir() }
31
- from (configurations.runtime - configurations.provided + files(jar.archivePath))
32
- into "classpath"
33
- }
34
- clean { delete "classpath" }
35
-
36
- checkstyle {
37
- configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
38
- toolVersion = '6.14.1'
39
- }
40
- checkstyleMain {
41
- configFile = file("${project.rootDir}/config/checkstyle/default.xml")
42
- ignoreFailures = true
43
- }
44
- checkstyleTest {
45
- configFile = file("${project.rootDir}/config/checkstyle/default.xml")
46
- ignoreFailures = true
47
- }
48
- task checkstyle(type: Checkstyle) {
49
- classpath = sourceSets.main.output + sourceSets.test.output
50
- source = sourceSets.main.allJava + sourceSets.test.allJava
51
- }
52
-
53
- task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
54
- jrubyArgs "-S"
55
- script "gem"
56
- scriptArgs "build", "${project.name}.gemspec"
57
- doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
58
- }
59
-
60
- task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
61
- jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
62
- script "pkg/${project.name}-${project.version}.gem"
63
- }
64
-
65
- task "package"(dependsOn: ["gemspec", "classpath"]) {
66
- doLast {
67
- println "> Build succeeded."
68
- println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
69
- }
70
- }
71
-
72
- task gemspec {
73
- ext.gemspecFile = file("${project.name}.gemspec")
74
- inputs.file "build.gradle"
75
- outputs.file gemspecFile
76
- doLast { gemspecFile.write($/
77
- Gem::Specification.new do |spec|
78
- spec.name = "${project.name}"
79
- spec.version = "${project.version}"
80
- spec.authors = ["Infoobjects Inc."]
81
- spec.summary = %[Oracle Lookup filter plugin for Embulk]
82
- spec.description = %[Oracle Lookup]
83
- spec.email = ["utkarsh@infoobjects.com"]
84
- spec.licenses = ["MIT"]
85
- # TODO set this: spec.homepage = "https://github.com/InfoObjects/embulk-filter-oracle_lookup"
86
-
87
- spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
88
- spec.test_files = spec.files.grep(%r"^(test|spec)/")
89
- spec.require_paths = ["lib"]
90
-
91
- #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
92
- spec.add_development_dependency 'bundler', ['~> 1.0']
93
- spec.add_development_dependency 'rake', ['~> 12.0']
94
- end
95
- /$)
96
- }
97
- }
98
- clean { delete "${project.name}.gemspec" }
1
+ plugins {
2
+ id "com.jfrog.bintray" version "1.1"
3
+ id "com.github.jruby-gradle.base" version "1.5.0"
4
+ id "java"
5
+ id "checkstyle"
6
+ }
7
+ import com.github.jrubygradle.JRubyExec
8
+ repositories {
9
+ mavenCentral()
10
+ jcenter()
11
+ }
12
+ configurations {
13
+ provided
14
+ }
15
+
16
+ version = "0.2.5"
17
+
18
+ sourceCompatibility = 1.8
19
+ targetCompatibility = 1.8
20
+
21
+ dependencies {
22
+ compile "org.embulk:embulk-core:0.9.8"
23
+ provided "org.embulk:embulk-core:0.9.8"
24
+ // compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
25
+ testCompile "junit:junit:4.+"
26
+ implementation group: 'com.oracle.database.jdbc', name: 'ojdbc8', version: '21.3.0.0'
27
+ }
28
+
29
+ task classpath(type: Copy, dependsOn: ["jar"]) {
30
+ doFirst { file("classpath").deleteDir() }
31
+ from (configurations.runtime - configurations.provided + files(jar.archivePath))
32
+ into "classpath"
33
+ }
34
+ clean { delete "classpath" }
35
+
36
+ checkstyle {
37
+ configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
38
+ toolVersion = '6.14.1'
39
+ }
40
+ checkstyleMain {
41
+ configFile = file("${project.rootDir}/config/checkstyle/default.xml")
42
+ ignoreFailures = true
43
+ }
44
+ checkstyleTest {
45
+ configFile = file("${project.rootDir}/config/checkstyle/default.xml")
46
+ ignoreFailures = true
47
+ }
48
+ task checkstyle(type: Checkstyle) {
49
+ classpath = sourceSets.main.output + sourceSets.test.output
50
+ source = sourceSets.main.allJava + sourceSets.test.allJava
51
+ }
52
+
53
+ task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
54
+ jrubyArgs "-S"
55
+ script "gem"
56
+ scriptArgs "build", "${project.name}.gemspec"
57
+ doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
58
+ }
59
+
60
+ task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
61
+ jrubyArgs "-rrubygems/gem_runner", "-eGem::GemRunner.new.run(ARGV)", "push"
62
+ script "pkg/${project.name}-${project.version}.gem"
63
+ }
64
+
65
+ task "package"(dependsOn: ["gemspec", "classpath"]) {
66
+ doLast {
67
+ println "> Build succeeded."
68
+ println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
69
+ }
70
+ }
71
+
72
+ task gemspec {
73
+ ext.gemspecFile = file("${project.name}.gemspec")
74
+ inputs.file "build.gradle"
75
+ outputs.file gemspecFile
76
+ doLast { gemspecFile.write($/
77
+ Gem::Specification.new do |spec|
78
+ spec.name = "${project.name}"
79
+ spec.version = "${project.version}"
80
+ spec.authors = ["Infoobjects Inc."]
81
+ spec.summary = %[Oracle Lookup filter plugin for Embulk]
82
+ spec.description = %[Oracle Lookup]
83
+ spec.email = ["utkarsh@infoobjects.com"]
84
+ spec.licenses = ["MIT"]
85
+ # TODO set this: spec.homepage = "https://github.com/InfoObjects/embulk-filter-oracle_lookup"
86
+
87
+ spec.files = `git ls-files`.split("\n") + Dir["classpath/*.jar"]
88
+ spec.test_files = spec.files.grep(%r"^(test|spec)/")
89
+ spec.require_paths = ["lib"]
90
+
91
+ #spec.add_dependency 'YOUR_GEM_DEPENDENCY', ['~> YOUR_GEM_DEPENDENCY_VERSION']
92
+ spec.add_development_dependency 'bundler', ['~> 1.0']
93
+ spec.add_development_dependency 'rake', ['~> 12.0']
94
+ end
95
+ /$)
96
+ }
97
+ }
98
+ clean { delete "${project.name}.gemspec" }