File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed
Samples/JavaDependencySampleApp Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ let package = Package(
86
86
. product( name: " JavaKit " , package : " swift-java " ) ,
87
87
. product( name: " JavaKitFunction " , package : " swift-java " ) ,
88
88
. product( name: " JavaKitCollection " , package : " swift-java " ) ,
89
+ . product( name: " JavaKitIO " , package : " swift-java " ) ,
90
+ . product( name: " JavaKitNetwork " , package : " swift-java " ) ,
89
91
] ,
90
92
exclude: [ " swift-java.config " ] ,
91
93
swiftSettings: [
@@ -98,5 +100,7 @@ let package = Package(
98
100
]
99
101
) ,
100
102
103
+ . target( name: " JavaExample " ) ,
104
+
101
105
]
102
106
)
Original file line number Diff line number Diff line change 1
1
{
2
2
"classes" : {
3
3
"org.apache.commons.io.FilenameUtils" : "FilenameUtils",
4
- "org.apache.commons.io.IOCase" : "IOCase"
4
+ "org.apache.commons.io.IOCase" : "IOCase",
5
+ "org.apache.commons.csv.CSVFormat" : "CSVFormat",
6
+ "org.apache.commons.csv.CSVParser" : "CSVParser",
7
+ "org.apache.commons.csv.CSVRecord" : "CSVRecord"
5
8
},
6
9
"dependencies" : [
7
10
"org.apache.commons:commons-csv:1.12.0"
Original file line number Diff line number Diff line change 14
14
15
15
import JavaKit
16
16
import JavaKitFunction
17
+ import JavaKitIO
17
18
import JavaKitConfigurationShared
18
19
import Foundation
19
20
@@ -42,4 +43,13 @@ let ext = try! FilenameUtilsClass.getExtension(path)
42
43
print ( " org.apache.commons.io.FilenameUtils.getExtension = \( ext) " )
43
44
precondition ( ext == " exe " )
44
45
46
+ let CSCFormatClass = try JavaClass < CSVFormat > ( )
47
+
48
+ let reader = StringReader ( " hello,example " )
49
+ for record in try CSCFormatClass . RFC4180. parse ( reader) !. getRecords ( ) ! {
50
+ for field in record. toList ( ) ! {
51
+ print ( " Field: \( field) " )
52
+ }
53
+ }
54
+
45
55
print ( " Done. " )
You can’t perform that action at this time.
0 commit comments