embulk-filter-mysql_lookup 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -12
- data/LICENSE +20 -20
- data/README.md +161 -147
- data/build.gradle +98 -98
- data/classpath/embulk-filter-mysql_lookup-0.1.7.jar +0 -0
- data/config/checkstyle/checkstyle.xml +128 -128
- data/config/checkstyle/default.xml +108 -108
- data/example/mysql-filter-lookup_testing.yml.liquid +37 -0
- data/example/mysql-filter-lookup_testing_csv.yml.liquid +54 -0
- data/example/mysql-filter-lookup_testing_mssql.yml.liquid +39 -0
- data/example/mysql-filter-lookup_testing_oracle.yml.liquid +42 -0
- data/example/mysql-filter-lookup_testing_postgres.yml.liquid +42 -0
- data/gradle/wrapper/gradle-wrapper.properties +5 -5
- data/gradlew +172 -172
- data/gradlew.bat +84 -84
- data/lib/embulk/filter/mysql_lookup.rb +3 -3
- data/src/main/java/org/embulk/filter/mysql_lookup/DatabaseConnection.java +199 -195
- data/src/main/java/org/embulk/filter/mysql_lookup/MysqlLookupFilterPlugin.java +380 -362
- data/src/test/java/org/embulk/filter/mysql_lookup/TestMysqlLookupFilterPlugin.java +5 -5
- metadata +13 -11
- data/classpath/embulk-filter-mysql_lookup-0.1.5.jar +0 -0
- data/config1.yml +0 -47
- data/embulk-filter-mysql_lookup-0.1.3.gem +0 -0
- data/embulk-filter-mysql_lookup-0.1.4.gem +0 -0
- data/example/config1.yml +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7486a3575cd34e562c8298dee178b17fc06cd2b1bb0446c84465874200a2fd55
|
4
|
+
data.tar.gz: 2f32f73302b28d4a6bcc57e3d69aaeb9dab5825d1d66428e00087e73c8db04f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15732f29be816f047cac06d2b9eff18466692e6900c0dd9854735314421fa7bb62fdb92db01cf963700575373c30edf4ba0a75e2134815524637fabe578f2af2
|
7
|
+
data.tar.gz: 98a5ac748904ee32de5e51afe3f610fde51082e9bb8357c1e070605cdafd85fcbf6493ec72ccdaa28512df02de375964bd008263952d7cff27a7a3e2a5e38f14
|
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,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2022 InfoObjects Inc.
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 InfoObjects Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,148 +1,162 @@
|
|
1
|
-
<p align="center">
|
2
|
-
<a href="https://www.infoobjects.com/" target="blank"><img src="screenshots/logo.png" width="150" alt="InfoObjects Logo" /></a>
|
3
|
-
</p>
|
4
|
-
<p align="center">Infoobjects is a consulting company that helps enterprises transform how and where they run applications and infrastructure.
|
5
|
-
From strategy, to implementation, to ongoing managed services, Infoobjects creates tailored cloud solutions for enterprises at all stages of the cloud journey.</p>
|
6
|
-
|
7
|
-
# MYSQL lookup filter plugin for Embulk
|
8
|
-
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
9
|
-
|
10
|
-
|
11
|
-
An Embulk filter plugin for Lookup Transformation with MySQL database
|
12
|
-
|
13
|
-
## Configuration
|
14
|
-
|
15
|
-
- **mysql_lookup**: Required attributes for the LookUp Filter Plugin -
|
16
|
-
- **filters**:
|
17
|
-
- **type**: Name of lookup type (required)
|
18
|
-
- **driver_path**: path to the jar file of the MySQL JDBC driver. If not set, the bundled JDBC driver (MySQL Connector/J 8.0.19) will be used (string)
|
19
|
-
- **driver_class**: Here we can provide driver class name,if not set,the com.mysql.cj.jdbc.Driver class will be used
|
20
|
-
- **host**: database host (example `localhost`) (required)
|
21
|
-
- **port**: database port (example port for mssql `1433`) (required
|
22
|
-
- **database**: database name (required)
|
23
|
-
- **table_name**: 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:
|
34
|
-
- **Name-2,Type-2**: Any Name, Type of the name (name:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
Output
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
```
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
```
|
146
|
-
|
147
|
-
|
1
|
+
<p align="center">
|
2
|
+
<a href="https://www.infoobjects.com/" target="blank"><img src="screenshots/logo.png" width="150" alt="InfoObjects Logo" /></a>
|
3
|
+
</p>
|
4
|
+
<p align="center">Infoobjects is a consulting company that helps enterprises transform how and where they run applications and infrastructure.
|
5
|
+
From strategy, to implementation, to ongoing managed services, Infoobjects creates tailored cloud solutions for enterprises at all stages of the cloud journey.</p>
|
6
|
+
|
7
|
+
# MYSQL lookup filter plugin for Embulk
|
8
|
+
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
|
9
|
+
|
10
|
+
|
11
|
+
An Embulk filter plugin for Lookup Transformation with MySQL database
|
12
|
+
|
13
|
+
## Configuration
|
14
|
+
|
15
|
+
- **mysql_lookup**: Required attributes for the LookUp Filter Plugin -
|
16
|
+
- **filters**:
|
17
|
+
- **type**: Name of lookup type (required)
|
18
|
+
- **driver_path**: path to the jar file of the MySQL JDBC driver. If not set, the bundled JDBC driver (MySQL Connector/J 8.0.19) will be used (string)
|
19
|
+
- **driver_class**: Here we can provide driver class name,if not set,the com.mysql.cj.jdbc.Driver class will be used
|
20
|
+
- **host**: database host (example `localhost`) (required)
|
21
|
+
- **port**: database port (example port for mssql `1433`) (required
|
22
|
+
- **database**: database name (required)
|
23
|
+
- **table_name**: 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: pin, type: string)
|
34
|
+
- **Name-2,Type-2**: Any Name, Type of the name (name: gender, type: string)
|
35
|
+
- **Name-3,Type-3**: Any Name, Type of the name (name: phone_number, type: string) etc ...
|
36
|
+
## Example - columns
|
37
|
+
|
38
|
+
Customer.csv for table 1 is as follows :-
|
39
|
+
|
40
|
+
```
|
41
|
+
id customer_name address email car_name company
|
42
|
+
1 John Doe 123 Main St, Anytown USA john.doe@example.com Civic Honda
|
43
|
+
2 Jane Smith 456 Elm St, Anytown USA jane.smith@example.com E-Class Mercedes-Benz
|
44
|
+
3 Bob Johnson 789 Oak St, Anytown USA bob.johnson@example.com GLE-Class Mercedes-Benz
|
45
|
+
4 Amanda Hernandez 999 Cedar St, Anytown USA amanda.hernandez@example.com 911 119
|
46
|
+
5 Tom Brown 567 Pine St, Anytown USA tom.brown@example.com C-Class Mercedes-Benz
|
47
|
+
6 Samantha Davis 890 Cedar St, Anytown USA samantha.davis@example.com Civic Honda
|
48
|
+
7 Mike Wilson 1234 Spruce St, Anytown USA mike.wilson@example.com GLE-Class Mercedes-Benz
|
49
|
+
8 Jason Brown 888 Pine St, Anytown USA jason.brown@example.com 911 Porsche
|
50
|
+
9 David Rodriguez 9010 Oak St, Anytown USA david.rodriguez@example.com GLC-Class Mercedes-Benz
|
51
|
+
10 Mark Davis 666 Spruce St, Anytown USA mark.davis@example.com C-Class Mercedes-Benz
|
52
|
+
11 Chris Thompson 222 Cedar St, Anytown USA chris.thompson@example.com Cayenne Porsche
|
53
|
+
12 Linda Young 555 Birch St, Anytown USA linda.young@example.com RAV4
|
54
|
+
13 Kevin Hernandez 444 Maple St, Anytown USA kevin.hernandez@example.com 911 119
|
55
|
+
```
|
56
|
+
|
57
|
+
Car.csv for table 2 is as follows :-
|
58
|
+
|
59
|
+
```
|
60
|
+
car_id model brand category fuel_capacity
|
61
|
+
87 GLE-Class Mercedes-Benz SUV 80
|
62
|
+
101 Cayenne Porsche SUV 75
|
63
|
+
119 911 Porsche Sports Car 64
|
64
|
+
205 Accord Honda Sedan 56
|
65
|
+
334 Pilot Honda SUV 70
|
66
|
+
434 CR-v Honda SUV 64
|
67
|
+
559 C-Class Mercedes-Benz Sedan 66
|
68
|
+
603 Civic Honda Sedan 42
|
69
|
+
697 E-Class Mercedes-Benz Sedan 72
|
70
|
+
812 GLC-Class Mercedes-Benz Sedan 68
|
71
|
+
|
72
|
+
|
73
|
+
```
|
74
|
+
|
75
|
+
As shown in yaml below, columns mentioned in mapping_from will be mapped with columns mentioned in mapping_to
|
76
|
+
ie:
|
77
|
+
|
78
|
+
car_name : model
|
79
|
+
company : brand
|
80
|
+
|
81
|
+
After successful mapping an Output.csv file containing the columns mentioned in new_columns will be generated
|
82
|
+
|
83
|
+
Output File generated :-
|
84
|
+
|
85
|
+
```
|
86
|
+
id customer_name address email car_name company car_id category fuel_capacity
|
87
|
+
1 John Doe 123 Main St, Anytown USA john.doe@example.com Civic Honda 603 Sedan 42
|
88
|
+
2 Jane Smith 456 Elm St, Anytown USA jane.smith@example.com E-Class Mercedes-Benz 697 Sedan 72
|
89
|
+
3 Bob Johnson 789 Oak St, Anytown USA bob.johnson@example.com GLE-Class Mercedes-Benz 87 SUV 80
|
90
|
+
4 Amanda Hernandez 999 Cedar St, Anytown USA amanda.hernandez@example.com 911 119 0
|
91
|
+
5 Tom Brown 567 Pine St, Anytown USA tom.brown@example.com C-Class Mercedes-Benz 559 Sedan 66
|
92
|
+
6 Samantha Davis 890 Cedar St, Anytown USA samantha.davis@example.com Civic Honda 603 Sedan 42
|
93
|
+
7 Mike Wilson 1234 Spruce St, Anytown USA mike.wilson@example.com GLE-Class Mercedes-Benz 87 SUV 80
|
94
|
+
8 Jason Brown 888 Pine St, Anytown USA jason.brown@example.com 911 Porsche 119 Sport Car 64
|
95
|
+
9 David Rodriguez 9010 Oak St, Anytown USA david.rodriguez@example.com GLC-Class Mercedes-Benz 812 SUV 68
|
96
|
+
10 Mark Davis 666 Spruce St, Anytown USA mark.davis@example.com C-Class Mercedes-Benz 559 Sedan 66
|
97
|
+
11 Chris Thompson 222 Cedar St, Anytown USA chris.thompson@example.com Cayenne Porsche 101 SUV 75
|
98
|
+
12 Linda Young 555 Birch St, Anytown USA linda.young@example.com RAV4 \N 0
|
99
|
+
13 Kevin Hernandez 444 Maple St, Anytown USA kevin.hernandez@example.com 911 119 0
|
100
|
+
```
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
```yaml
|
105
|
+
filters:
|
106
|
+
- type: mysql_lookup
|
107
|
+
host: localhost
|
108
|
+
port: 3306
|
109
|
+
database: test
|
110
|
+
table_name: car
|
111
|
+
username: root
|
112
|
+
password: 'passsword'
|
113
|
+
mapping_from:
|
114
|
+
- car_name
|
115
|
+
- company
|
116
|
+
mapping_to:
|
117
|
+
- model
|
118
|
+
- brand
|
119
|
+
new_columns:
|
120
|
+
- { name: car_id, type: string }
|
121
|
+
- { name: category, type: string }
|
122
|
+
- { name: fuel_capacity, type: string }
|
123
|
+
```
|
124
|
+
|
125
|
+
Notes:
|
126
|
+
1. mapping_from attribute should be in the same order as mentioned in the input file.
|
127
|
+
|
128
|
+
2. In case with JDBC plugin if any integer column returned as float/decimal then use to cast that column as long as below
|
129
|
+
```
|
130
|
+
column_options:
|
131
|
+
id: {value_type: long}
|
132
|
+
```
|
133
|
+
3. Matching columns data types must be int,long and String
|
134
|
+
## Development
|
135
|
+
|
136
|
+
Run example:
|
137
|
+
|
138
|
+
```
|
139
|
+
$ ./gradlew package
|
140
|
+
$ embulk run -I ./lib seed.yml
|
141
|
+
```
|
142
|
+
|
143
|
+
Deployment Steps:
|
144
|
+
|
145
|
+
```
|
146
|
+
Install ruby in your machine
|
147
|
+
$ gem install gemcutter (For windows OS)
|
148
|
+
|
149
|
+
$ ./gradlew gemPush
|
150
|
+
$ gem build NameOfYourPlugins (example: embulk-filter-mssql_lookup)
|
151
|
+
$ gem push embulk-filter-mssql_lookup-0.1.0.gem (You will get this name after running above command)
|
152
|
+
```
|
153
|
+
|
154
|
+
|
155
|
+
Release gem:
|
156
|
+
|
157
|
+
```
|
158
|
+
$ ./gradlew gemPush
|
159
|
+
```
|
160
|
+
## Licensing
|
161
|
+
|
148
162
|
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.1.
|
17
|
-
|
18
|
-
sourceCompatibility = 1.8
|
19
|
-
targetCompatibility = 1.8
|
20
|
-
|
21
|
-
dependencies {
|
22
|
-
compile "org.embulk:embulk-core:0.9.+"
|
23
|
-
provided "org.embulk:embulk-core:0.9.+"
|
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 = %[An Embulk filter plugin for Lookup Transformation with MySQL database]
|
82
|
-
spec.description = %[Mysql Lookup filter]
|
83
|
-
spec.email = ["utkarsh@infoobjects.com"]
|
84
|
-
spec.licenses = ["MIT"]
|
85
|
-
spec.homepage = "https://github.com/InfoObjects/embulk-filter-mysql_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_development_dependency 'bundler', ['~> 1.0']
|
92
|
-
spec.add_development_dependency 'rake', ['~> 12.0']
|
93
|
-
end
|
94
|
-
/$)
|
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.1.7"
|
17
|
+
|
18
|
+
sourceCompatibility = 1.8
|
19
|
+
targetCompatibility = 1.8
|
20
|
+
|
21
|
+
dependencies {
|
22
|
+
compile "org.embulk:embulk-core:0.9.+"
|
23
|
+
provided "org.embulk:embulk-core:0.9.+"
|
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 = %[An Embulk filter plugin for Lookup Transformation with MySQL database]
|
82
|
+
spec.description = %[Mysql Lookup filter]
|
83
|
+
spec.email = ["utkarsh@infoobjects.com"]
|
84
|
+
spec.licenses = ["MIT"]
|
85
|
+
spec.homepage = "https://github.com/InfoObjects/embulk-filter-mysql_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_development_dependency 'bundler', ['~> 1.0']
|
92
|
+
spec.add_development_dependency 'rake', ['~> 12.0']
|
93
|
+
end
|
94
|
+
/$)
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
clean { delete "${project.name}.gemspec" }
|
Binary file
|