embulk-parser-poi_excel 0.1.5 → 0.1.12
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 +4 -4
- data/README.md +80 -21
- data/build.gradle +21 -11
- data/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/gradle/wrapper/gradle-wrapper.properties +5 -6
- data/gradlew +43 -35
- data/gradlew.bat +4 -10
- data/src/main/java/org/embulk/parser/poi_excel/PoiExcelColumnValueType.java +25 -3
- data/src/main/java/org/embulk/parser/poi_excel/PoiExcelParserPlugin.java +102 -11
- data/src/main/java/org/embulk/parser/poi_excel/bean/PoiExcelColumnBean.java +132 -6
- data/src/main/java/org/embulk/parser/poi_excel/bean/PoiExcelColumnIndex.java +167 -47
- data/src/main/java/org/embulk/parser/poi_excel/bean/PoiExcelSheetBean.java +13 -1
- data/src/main/java/org/embulk/parser/poi_excel/bean/record/PoiExcelRecord.java +52 -0
- data/src/main/java/org/embulk/parser/poi_excel/bean/record/PoiExcelRecordColumn.java +80 -0
- data/src/main/java/org/embulk/parser/poi_excel/bean/record/PoiExcelRecordRow.java +76 -0
- data/src/main/java/org/embulk/parser/poi_excel/bean/record/PoiExcelRecordSheet.java +49 -0
- data/src/main/java/org/embulk/parser/poi_excel/bean/record/RecordType.java +114 -0
- data/src/main/java/org/embulk/parser/poi_excel/bean/util/PoiExcelCellAddress.java +59 -0
- data/src/main/java/org/embulk/parser/poi_excel/bean/util/SearchMergedCell.java +71 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/PoiExcelCellFontVisitor.java +0 -6
- data/src/main/java/org/embulk/parser/poi_excel/visitor/PoiExcelCellStyleVisitor.java +11 -11
- data/src/main/java/org/embulk/parser/poi_excel/visitor/PoiExcelCellTypeVisitor.java +52 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/PoiExcelCellValueVisitor.java +87 -41
- data/src/main/java/org/embulk/parser/poi_excel/visitor/PoiExcelClientAnchorVisitor.java +1 -1
- data/src/main/java/org/embulk/parser/poi_excel/visitor/PoiExcelColumnVisitor.java +60 -12
- data/src/main/java/org/embulk/parser/poi_excel/visitor/PoiExcelVisitorFactory.java +14 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/embulk/BooleanCellVisitor.java +5 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/embulk/CellVisitor.java +3 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/embulk/DoubleCellVisitor.java +5 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/embulk/LongCellVisitor.java +5 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/embulk/StringCellVisitor.java +30 -2
- data/src/main/java/org/embulk/parser/poi_excel/visitor/embulk/TimestampCellVisitor.java +5 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/util/MergedRegionFinder.java +9 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/util/MergedRegionList.java +20 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/util/MergedRegionMap.java +55 -0
- data/src/main/java/org/embulk/parser/poi_excel/visitor/util/MergedRegionNothing.java +12 -0
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin.java +27 -79
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_cellAddress.java +69 -0
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_cellComment.java +1 -1
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_cellError.java +1 -1
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_cellFont.java +1 -1
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_cellStyle.java +14 -14
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_cellType.java +79 -0
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_columnNumber.java +1 -1
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_constant.java +1 -1
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_convertError.java +1 -1
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_formula.java +90 -0
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_mergedCell.java +94 -0
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_recordType.java +192 -0
- data/src/test/java/org/embulk/parser/poi_excel/TestPoiExcelParserPlugin_sheets.java +35 -1
- metadata +36 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ce575511ee0ce2d0a9496f1d63013909d751504
|
4
|
+
data.tar.gz: f79c800fd6454ba5e2511e6e675a3465c3c2c7d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4ddf5f3506c56924bbe9147c6b23e40f31853356b53e91215120ef9f930e322db50a60a9c2277bc51c863cf588610e44d18cf5ec401a0d8b31d0c7ff30f4b50
|
7
|
+
data.tar.gz: bf22e1256df159efd21cdf40d98ae014c8ddf1dc053848dce95a2635fa68dbac2d174833731f5ff700d814fc98a680ab666774b15cce49c24d7a94eea87d6ac1
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ in:
|
|
20
20
|
skip_header_lines: 1 # first row is header.
|
21
21
|
columns:
|
22
22
|
- {name: row, type: long, value: row_number}
|
23
|
-
- {name: get_date, type: timestamp,
|
23
|
+
- {name: get_date, type: timestamp, cell_column: A, value: cell_value}
|
24
24
|
- {name: orb_type, type: string}
|
25
25
|
- {name: orb_name, type: string}
|
26
26
|
- {name: orb_shape, type: long}
|
@@ -28,13 +28,14 @@ in:
|
|
28
28
|
```
|
29
29
|
|
30
30
|
if omit **value**, specified `cell_value`.
|
31
|
-
if omit **
|
31
|
+
if omit **cell_column** when **value** is `cell_value`, specified next column.
|
32
32
|
|
33
33
|
|
34
34
|
## Configuration
|
35
35
|
|
36
|
-
* **sheets**: sheet name. (list of string, required)
|
37
|
-
* **
|
36
|
+
* **sheets**: sheet name. can use wildcards `*`, `?`. (list of string, required)
|
37
|
+
* **record_type**: record type. (`row`, `column` or `sheet`. default: `row`)
|
38
|
+
* **skip_header_lines**: skip rows when **record_type**=`row` (skip columns when **record_type**=`column`). ignored when **record_type**=`sheet`. (integer, default: `0`)
|
38
39
|
* **columns**: column definition. see below. (hash, required)
|
39
40
|
* **sheet_options**: sheet option. see below. (hash, default: null)
|
40
41
|
|
@@ -42,11 +43,19 @@ if omit **column_number** when **valus** is `cell_value`, specified next column.
|
|
42
43
|
|
43
44
|
* **name**: Embulk column name. (string, required)
|
44
45
|
* **type**: Embulk column type. (string, required)
|
45
|
-
* **value**: value type. see below. (string,
|
46
|
-
* **column_number**:
|
46
|
+
* **value**: value type. see below. (string, default: `cell_value`)
|
47
|
+
* **column_number**: same as **cell_column**.
|
48
|
+
* **cell_column**: Excel column number. see below. (string, default: next column when **record_type**=`row`)
|
49
|
+
* **cell_row**: Excel row number. see below. (integer, default: next row when **record_type**=`column`)
|
50
|
+
* **cell_address**: Excel cell address such as `A1`, `Sheet1!B3`. (string, not required)
|
51
|
+
* **numeric_format**: format of numeric(double) to string such as `%4.2f`. (default: Java's Double.toString())
|
47
52
|
* **attribute_name**: use with value `cell_style`, `cell_font`, etc. see below. (list of string)
|
48
53
|
* **on_cell_error**: processing method of Cell error. see below. (string, default: `constant`)
|
54
|
+
* **formula_handling**: processing method of formula. see below. (`evaluate` or `cashed_value`. default: `evaluate`)
|
55
|
+
* **on_evaluate_error**: processing method of evaluate formula error. see below. (string, default: `exception`)
|
56
|
+
* **formula_replace**: replace formula before evaluate. see below.
|
49
57
|
* **on_convert_error**: processing method of convert error. see below. (string, default: `exception`)
|
58
|
+
* **search_merged_cell**: search merged cell when cell is BLANK. (`none`, `linear_search`, `tree_search` or `hash_search`, default: `hash_search`)
|
50
59
|
|
51
60
|
### value
|
52
61
|
|
@@ -55,6 +64,8 @@ if omit **column_number** when **valus** is `cell_value`, specified next column.
|
|
55
64
|
* `cell_style`: all cell style attributes. returned json string. see **attribute_name**. (**type** required `string`)
|
56
65
|
* `cell_font`: all cell font attributes. returned json string. see **attribute_name**. (**type** required `string`)
|
57
66
|
* `cell_comment`: all cell comment attributes. returned json string. see **attribute_name**. (**type** required `string`)
|
67
|
+
* `cell_type`: cell type. returned Cell.getCellType() of POI.
|
68
|
+
* `cell_cached_type`: cell cached formula result type. returned Cell.getCachedFormulaResultType() of POI when CellType==FORMULA, otherwise same as `cell_type` (returned Cell.getCellType()).
|
58
69
|
* `sheet_name`: sheet name.
|
59
70
|
* `row_number`: row number(1 origin).
|
60
71
|
* `column_number`: column number(1 origin).
|
@@ -63,7 +74,9 @@ if omit **column_number** when **valus** is `cell_value`, specified next column.
|
|
63
74
|
* `constant.`*value*: specified value.
|
64
75
|
* `constant`: null.
|
65
76
|
|
66
|
-
###
|
77
|
+
### cell_column
|
78
|
+
|
79
|
+
Basically used for **record_type**=`row`.
|
67
80
|
|
68
81
|
* `A`,`B`,`C`,...: column number of "A1 format".
|
69
82
|
* *number*: column number (1 origin).
|
@@ -76,6 +89,12 @@ if omit **column_number** when **valus** is `cell_value`, specified next column.
|
|
76
89
|
* `=`: same column.
|
77
90
|
* `=`*name*: same column of name.
|
78
91
|
|
92
|
+
### cell_row
|
93
|
+
|
94
|
+
Basically used for **record_type**=`column`.
|
95
|
+
|
96
|
+
* *number*: row number (1 origin).
|
97
|
+
|
79
98
|
### attribute_name
|
80
99
|
|
81
100
|
**value**が`cell_style`, `cell_font`, `cell_comment`のとき、デフォルトでは、全属性を取得してJSON文字列に変換します。
|
@@ -83,7 +102,7 @@ if omit **column_number** when **valus** is `cell_value`, specified next column.
|
|
83
102
|
|
84
103
|
```yaml
|
85
104
|
columns:
|
86
|
-
- {name: foo, type: string,
|
105
|
+
- {name: foo, type: string, cell_column: A, value: cell_style}
|
87
106
|
```
|
88
107
|
|
89
108
|
|
@@ -93,7 +112,7 @@ attribute_nameを指定することで、指定された属性だけを取得し
|
|
93
112
|
|
94
113
|
```yaml
|
95
114
|
columns:
|
96
|
-
- {name: foo, type: string,
|
115
|
+
- {name: foo, type: string, cell_column: A, value: cell_style, attribute_name: [border_top, border_bottom, border_left, border_right]}
|
97
116
|
```
|
98
117
|
|
99
118
|
|
@@ -106,8 +125,8 @@ attribute_nameを指定することで、指定された属性だけを取得し
|
|
106
125
|
- {name: bar, type: long, value: cell_font.color}
|
107
126
|
```
|
108
127
|
|
109
|
-
なお、`cell_style`や`cell_font`では、**
|
110
|
-
(`cell_value`では、**
|
128
|
+
なお、`cell_style`や`cell_font`では、**cell_column**を省略した場合は直前と同じ列を対象とします。
|
129
|
+
(`cell_value`では、**cell_column**を省略すると次の列に移る)
|
111
130
|
|
112
131
|
|
113
132
|
### on_cell_error
|
@@ -116,56 +135,96 @@ Processing method of Cell error (`#DIV/0!`, `#REF!`, etc).
|
|
116
135
|
|
117
136
|
```yaml
|
118
137
|
columns:
|
119
|
-
- {name: foo, type: string,
|
138
|
+
- {name: foo, type: string, cell_column: A, value: cell_value, on_cell_error: error_code}
|
120
139
|
```
|
121
140
|
|
122
141
|
* `constant`: set null. (default)
|
123
|
-
* `constant.`*value*: set value.
|
142
|
+
* `constant.`*value*: set specified value.
|
124
143
|
* `error_code`: set error code.
|
125
144
|
* `exception`: throw exception.
|
126
145
|
|
127
146
|
|
147
|
+
### formula_handling
|
148
|
+
|
149
|
+
Processing method of formula.
|
150
|
+
|
151
|
+
```yaml
|
152
|
+
columns:
|
153
|
+
- {name: foo, type: string, cell_column: A, value: cell_value, formula_handling: cashed_value}
|
154
|
+
```
|
155
|
+
|
156
|
+
* `evaluate`: evaluate formula. (default)
|
157
|
+
* `cashed_value`: cashed value in cell.
|
158
|
+
|
159
|
+
|
160
|
+
### on_evaluate_error
|
161
|
+
|
162
|
+
Processing method of evaluate formula error.
|
163
|
+
|
164
|
+
```yaml
|
165
|
+
columns:
|
166
|
+
- {name: foo, type: string, cell_column: A, value: cell_value, on_evaluate_error: constant}
|
167
|
+
```
|
168
|
+
|
169
|
+
* `constant`: set null.
|
170
|
+
* `constant.`*value*: set specified value.
|
171
|
+
* `exception`: throw exception. (default)
|
172
|
+
|
173
|
+
|
174
|
+
### formula_replace
|
175
|
+
|
176
|
+
Replace formula before evaluate.
|
177
|
+
|
178
|
+
```yaml
|
179
|
+
columns:
|
180
|
+
- {name: foo, type: string, cell_column: A, value: cell_value, formula_replace: [{regex: aaa, to: "A${row}"}, {regex: bbb, to: "B${row}"}]}
|
181
|
+
```
|
182
|
+
|
183
|
+
`${row}` is replaced with the current row number.
|
184
|
+
`${column}` is replaced with the current column string.
|
185
|
+
|
186
|
+
|
128
187
|
### on_convert_error
|
129
188
|
|
130
189
|
Processing method of convert error. ex) Excel boolean to Embulk timestamp
|
131
190
|
|
132
191
|
```yaml
|
133
192
|
columns:
|
134
|
-
- {name: foo, type: timestamp, format: "%Y/%m/%d",
|
193
|
+
- {name: foo, type: timestamp, format: "%Y/%m/%d", cell_column: A, value: cell_value, on_convert_error: constant.9999/12/31}
|
135
194
|
```
|
136
195
|
|
137
196
|
* `constant`: set null.
|
138
|
-
* `constant.`*value*: set value.
|
197
|
+
* `constant.`*value*: set specified value.
|
139
198
|
* `exception`: throw exception. (default)
|
140
199
|
|
141
200
|
|
142
201
|
### sheet_options
|
143
202
|
|
144
|
-
Options of
|
203
|
+
Options of individual sheet.
|
145
204
|
|
146
205
|
```yaml
|
147
206
|
parser:
|
148
207
|
type: poi_excel
|
149
208
|
sheets: [Sheet1, Sheet2]
|
150
209
|
columns:
|
151
|
-
- {name: date, type: timestamp,
|
210
|
+
- {name: date, type: timestamp, cell_column: A}
|
152
211
|
- {name: foo, type: string}
|
153
212
|
- {name: bar, type: long}
|
154
213
|
sheet_options:
|
155
214
|
Sheet1:
|
156
215
|
skip_header_lines: 1
|
157
216
|
columns:
|
158
|
-
foo: {
|
159
|
-
bar: {
|
217
|
+
foo: {cell_column: B}
|
218
|
+
bar: {cell_column: C}
|
160
219
|
Sheet2:
|
161
220
|
skip_header_lines: 0
|
162
221
|
columns:
|
163
|
-
foo: {
|
222
|
+
foo: {cell_column: D}
|
164
223
|
bar: {value: constant.0}
|
165
224
|
```
|
166
225
|
|
167
226
|
**sheet_options** is map of sheet name.
|
168
|
-
Map values are **skip_header_lines**, **
|
227
|
+
Map values are **skip_header_lines**, **columns**.
|
169
228
|
|
170
229
|
**columns** is map of column name.
|
171
230
|
Map values are same **columns** in **parser** (excluding `name`, `type`).
|
data/build.gradle
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
plugins {
|
2
2
|
id "com.jfrog.bintray" version "1.1"
|
3
|
-
id "com.github.jruby-gradle.base" version "
|
3
|
+
id "com.github.jruby-gradle.base" version "1.5.0"
|
4
4
|
id "java"
|
5
5
|
id "eclipse"
|
6
6
|
}
|
@@ -13,7 +13,7 @@ configurations {
|
|
13
13
|
provided
|
14
14
|
}
|
15
15
|
|
16
|
-
version = "0.1.
|
16
|
+
version = "0.1.12"
|
17
17
|
|
18
18
|
sourceCompatibility = 1.7
|
19
19
|
targetCompatibility = 1.7
|
@@ -23,8 +23,8 @@ dependencies {
|
|
23
23
|
provided "org.embulk:embulk-core:0.7.5"
|
24
24
|
compile "org.embulk:embulk-standards:0.7.5"
|
25
25
|
// compile "YOUR_JAR_DEPENDENCY_GROUP:YOUR_JAR_DEPENDENCY_MODULE:YOUR_JAR_DEPENDENCY_VERSION"
|
26
|
-
compile group: 'org.apache.poi', name : 'poi', version: '3.
|
27
|
-
compile(group: 'org.apache.poi', name : 'poi-ooxml', version: '3.
|
26
|
+
compile group: 'org.apache.poi', name : 'poi', version: '3.17'
|
27
|
+
compile(group: 'org.apache.poi', name : 'poi-ooxml', version: '3.17') {
|
28
28
|
exclude group: 'stax', module: 'stax-api'
|
29
29
|
}
|
30
30
|
testCompile "junit:junit:4.+"
|
@@ -38,19 +38,29 @@ task classpath(type: Copy, dependsOn: ["jar"]) {
|
|
38
38
|
clean { delete "classpath" }
|
39
39
|
|
40
40
|
task gem(type: JRubyExec, dependsOn: ["gemspec", "classpath"]) {
|
41
|
-
jrubyArgs "-
|
42
|
-
script "
|
41
|
+
jrubyArgs "-S"
|
42
|
+
script "gem"
|
43
|
+
scriptArgs "build", "${project.name}.gemspec"
|
43
44
|
doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "pkg") }
|
44
45
|
}
|
45
46
|
|
46
47
|
task gemPush(type: JRubyExec, dependsOn: ["gem"]) {
|
47
|
-
jrubyArgs "-
|
48
|
-
script "
|
48
|
+
jrubyArgs "-S"
|
49
|
+
script "gem"
|
50
|
+
scriptArgs "push", "pkg/${project.name}-${project.version}.gem"
|
49
51
|
}
|
50
52
|
|
51
|
-
task "package"(dependsOn: ["gemspec", "classpath"])
|
52
|
-
|
53
|
-
|
53
|
+
task "package"(dependsOn: ["gemspec", "classpath"]) {
|
54
|
+
doLast {
|
55
|
+
println "> Build succeeded."
|
56
|
+
println "> You can run embulk with '-L ${file(".").absolutePath}' argument."
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
task gemUnpack(type: JRubyExec) {
|
61
|
+
jrubyArgs "-S"
|
62
|
+
script "gem"
|
63
|
+
scriptArgs "unpack", "pkg/${project.name}-${project.version}.gem"
|
54
64
|
}
|
55
65
|
|
56
66
|
task gemspec {
|
Binary file
|
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
|
1
|
+
distributionBase=GRADLE_USER_HOME
|
2
|
+
distributionPath=wrapper/dists
|
3
|
+
zipStoreBase=GRADLE_USER_HOME
|
4
|
+
zipStorePath=wrapper/dists
|
5
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
|
data/gradlew
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/env
|
1
|
+
#!/usr/bin/env sh
|
2
2
|
|
3
3
|
##############################################################################
|
4
4
|
##
|
@@ -6,20 +6,38 @@
|
|
6
6
|
##
|
7
7
|
##############################################################################
|
8
8
|
|
9
|
-
#
|
10
|
-
|
9
|
+
# Attempt to set APP_HOME
|
10
|
+
# Resolve links: $0 may be a link
|
11
|
+
PRG="$0"
|
12
|
+
# Need this for relative symlinks.
|
13
|
+
while [ -h "$PRG" ] ; do
|
14
|
+
ls=`ls -ld "$PRG"`
|
15
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
16
|
+
if expr "$link" : '/.*' > /dev/null; then
|
17
|
+
PRG="$link"
|
18
|
+
else
|
19
|
+
PRG=`dirname "$PRG"`"/$link"
|
20
|
+
fi
|
21
|
+
done
|
22
|
+
SAVED="`pwd`"
|
23
|
+
cd "`dirname \"$PRG\"`/" >/dev/null
|
24
|
+
APP_HOME="`pwd -P`"
|
25
|
+
cd "$SAVED" >/dev/null
|
11
26
|
|
12
27
|
APP_NAME="Gradle"
|
13
28
|
APP_BASE_NAME=`basename "$0"`
|
14
29
|
|
30
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
31
|
+
DEFAULT_JVM_OPTS=""
|
32
|
+
|
15
33
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
16
34
|
MAX_FD="maximum"
|
17
35
|
|
18
|
-
warn (
|
36
|
+
warn () {
|
19
37
|
echo "$*"
|
20
38
|
}
|
21
39
|
|
22
|
-
die (
|
40
|
+
die () {
|
23
41
|
echo
|
24
42
|
echo "$*"
|
25
43
|
echo
|
@@ -30,6 +48,7 @@ die ( ) {
|
|
30
48
|
cygwin=false
|
31
49
|
msys=false
|
32
50
|
darwin=false
|
51
|
+
nonstop=false
|
33
52
|
case "`uname`" in
|
34
53
|
CYGWIN* )
|
35
54
|
cygwin=true
|
@@ -40,31 +59,11 @@ case "`uname`" in
|
|
40
59
|
MINGW* )
|
41
60
|
msys=true
|
42
61
|
;;
|
62
|
+
NONSTOP* )
|
63
|
+
nonstop=true
|
64
|
+
;;
|
43
65
|
esac
|
44
66
|
|
45
|
-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
46
|
-
if $cygwin ; then
|
47
|
-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
48
|
-
fi
|
49
|
-
|
50
|
-
# Attempt to set APP_HOME
|
51
|
-
# Resolve links: $0 may be a link
|
52
|
-
PRG="$0"
|
53
|
-
# Need this for relative symlinks.
|
54
|
-
while [ -h "$PRG" ] ; do
|
55
|
-
ls=`ls -ld "$PRG"`
|
56
|
-
link=`expr "$ls" : '.*-> \(.*\)$'`
|
57
|
-
if expr "$link" : '/.*' > /dev/null; then
|
58
|
-
PRG="$link"
|
59
|
-
else
|
60
|
-
PRG=`dirname "$PRG"`"/$link"
|
61
|
-
fi
|
62
|
-
done
|
63
|
-
SAVED="`pwd`"
|
64
|
-
cd "`dirname \"$PRG\"`/" >&-
|
65
|
-
APP_HOME="`pwd -P`"
|
66
|
-
cd "$SAVED" >&-
|
67
|
-
|
68
67
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
69
68
|
|
70
69
|
# Determine the Java command to use to start the JVM.
|
@@ -90,7 +89,7 @@ location of your Java installation."
|
|
90
89
|
fi
|
91
90
|
|
92
91
|
# Increase the maximum file descriptors if we can.
|
93
|
-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
92
|
+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
94
93
|
MAX_FD_LIMIT=`ulimit -H -n`
|
95
94
|
if [ $? -eq 0 ] ; then
|
96
95
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
@@ -114,6 +113,7 @@ fi
|
|
114
113
|
if $cygwin ; then
|
115
114
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
116
115
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
116
|
+
JAVACMD=`cygpath --unix "$JAVACMD"`
|
117
117
|
|
118
118
|
# We build the pattern for arguments to be converted via cygpath
|
119
119
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
@@ -154,11 +154,19 @@ if $cygwin ; then
|
|
154
154
|
esac
|
155
155
|
fi
|
156
156
|
|
157
|
-
#
|
158
|
-
|
159
|
-
|
157
|
+
# Escape application args
|
158
|
+
save () {
|
159
|
+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
160
|
+
echo " "
|
160
161
|
}
|
161
|
-
|
162
|
-
|
162
|
+
APP_ARGS=$(save "$@")
|
163
|
+
|
164
|
+
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
165
|
+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
166
|
+
|
167
|
+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
168
|
+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
169
|
+
cd "$(dirname "$0")"
|
170
|
+
fi
|
163
171
|
|
164
|
-
exec "$JAVACMD" "
|
172
|
+
exec "$JAVACMD" "$@"
|
data/gradlew.bat
CHANGED
@@ -8,14 +8,14 @@
|
|
8
8
|
@rem Set local scope for the variables with windows NT shell
|
9
9
|
if "%OS%"=="Windows_NT" setlocal
|
10
10
|
|
11
|
-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
12
|
-
set DEFAULT_JVM_OPTS=
|
13
|
-
|
14
11
|
set DIRNAME=%~dp0
|
15
12
|
if "%DIRNAME%" == "" set DIRNAME=.
|
16
13
|
set APP_BASE_NAME=%~n0
|
17
14
|
set APP_HOME=%DIRNAME%
|
18
15
|
|
16
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
17
|
+
set DEFAULT_JVM_OPTS=
|
18
|
+
|
19
19
|
@rem Find java.exe
|
20
20
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
21
21
|
|
@@ -46,10 +46,9 @@ echo location of your Java installation.
|
|
46
46
|
goto fail
|
47
47
|
|
48
48
|
:init
|
49
|
-
@rem Get command-line arguments, handling
|
49
|
+
@rem Get command-line arguments, handling Windows variants
|
50
50
|
|
51
51
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
52
|
-
if "%@eval[2+2]" == "4" goto 4NT_args
|
53
52
|
|
54
53
|
:win9xME_args
|
55
54
|
@rem Slurp the command line arguments.
|
@@ -60,11 +59,6 @@ set _SKIP=2
|
|
60
59
|
if "x%~1" == "x" goto execute
|
61
60
|
|
62
61
|
set CMD_LINE_ARGS=%*
|
63
|
-
goto execute
|
64
|
-
|
65
|
-
:4NT_args
|
66
|
-
@rem Get arguments from the 4NT Shell from JP Software
|
67
|
-
set CMD_LINE_ARGS=%$
|
68
62
|
|
69
63
|
:execute
|
70
64
|
@rem Setup the command line
|