File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,11 @@ enum IDLBuilder {
27
27
" DOMMatrix_or_Float32Array_or_Float64Array " ,
28
28
]
29
29
30
- static let outDir = " Sources/DOMKit/ "
31
- static func writeFile( named name: String , content: String ) throws -> String {
32
- let path = outDir + name + " .swift "
30
+ static func writeFile( path: String , content: String ) throws {
33
31
if FileManager . default. fileExists ( atPath: path) {
34
32
try FileManager . default. removeItem ( atPath: path)
35
33
}
36
34
try ( preamble + content) . write ( toFile: path, atomically: true , encoding: . utf8)
37
- return path
38
35
}
39
36
40
37
static func generateIDLBindings( idl: [ GenericCollection < IDLNode > ] ) throws -> SwiftSource {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ func main() {
7
7
do {
8
8
let startTime = Date ( )
9
9
let idl = try IDLParser . parseIDL ( )
10
+ let outputPath = " Sources/DOMKit/Generated.swift "
10
11
var contents : [ SwiftSource ] = [ ]
11
12
print ( " Generating bindings... " )
12
13
contents. append ( try IDLBuilder . generateIDLBindings ( idl: idl) )
@@ -16,8 +17,8 @@ func main() {
16
17
contents. append ( try IDLBuilder . generateStrings ( ) )
17
18
print ( " Generating union protocols... " )
18
19
contents. append ( try IDLBuilder . generateUnions ( ) )
19
- let outputPath = try IDLBuilder . writeFile (
20
- named : " Generated " ,
20
+ try IDLBuilder . writeFile (
21
+ path : outputPath ,
21
22
content: contents. joined ( separator: " \n \n " ) . source)
22
23
23
24
SwiftFormatter . run ( source: outputPath)
You can’t perform that action at this time.
0 commit comments