@@ -309,7 +309,6 @@ public struct BridgeJSCoreError: Swift.Error, CustomStringConvertible {
309309
310310import struct Foundation. URL
311311import struct Foundation. Data
312- import struct Foundation. ObjCBool
313312import class Foundation. FileManager
314313import class Foundation. JSONDecoder
315314
@@ -329,33 +328,20 @@ public struct BridgeJSConfig: Codable {
329328 /// Default: `false`
330329 public var exposeToGlobal : Bool
331330
332- /// Additional directories containing Swift source files to scan for
333- /// `@JS` annotations.
334- ///
335- /// Paths are resolved relative to the target directory. This is useful
336- /// when Swift files with `@JS` annotations are generated by another
337- /// build plugin whose outputs aren't included in `target.sourceFiles`.
338- ///
339- /// Default: `nil` (no additional directories)
340- public var additionalSourceDirs : [ String ] ?
341-
342- public init ( tools: [ String : String ] ? = nil , exposeToGlobal: Bool = false , additionalSourceDirs: [ String ] ? = nil ) {
331+ public init ( tools: [ String : String ] ? = nil , exposeToGlobal: Bool = false ) {
343332 self . tools = tools
344333 self . exposeToGlobal = exposeToGlobal
345- self . additionalSourceDirs = additionalSourceDirs
346334 }
347335
348336 enum CodingKeys : String , CodingKey {
349337 case tools
350338 case exposeToGlobal
351- case additionalSourceDirs
352339 }
353340
354341 public init ( from decoder: Decoder ) throws {
355342 let container = try decoder. container ( keyedBy: CodingKeys . self)
356343 tools = try container. decodeIfPresent ( [ String : String ] . self, forKey: . tools)
357344 exposeToGlobal = try container. decodeIfPresent ( Bool . self, forKey: . exposeToGlobal) ?? false
358- additionalSourceDirs = try container. decodeIfPresent ( [ String ] . self, forKey: . additionalSourceDirs)
359345 }
360346
361347 /// Load the configuration file from the SwiftPM package target directory.
@@ -394,36 +380,11 @@ public struct BridgeJSConfig: Codable {
394380 return try JSONDecoder ( ) . decode ( BridgeJSConfig . self, from: data)
395381 }
396382
397- /// Resolve additional source directories relative to a base URL.
398- ///
399- /// Returns absolute URLs for each configured additional source directory.
400- /// Directories that don't exist are silently skipped.
401- public func resolveAdditionalSourceDirs( relativeTo baseURL: URL ) -> [ URL ] {
402- guard let dirs = additionalSourceDirs else { return [ ] }
403- return dirs. compactMap { dir in
404- let resolved = baseURL. appending ( path: dir) . standardized
405- var isDirectory : ObjCBool = false
406- guard FileManager . default. fileExists ( atPath: resolved. path, isDirectory: & isDirectory) ,
407- isDirectory. boolValue
408- else {
409- return nil
410- }
411- return resolved
412- }
413- }
414-
415383 /// Merge the current configuration with the overrides.
416384 func merging( overrides: BridgeJSConfig ) -> BridgeJSConfig {
417- let mergedDirs : [ String ] ? = {
418- let base = self . additionalSourceDirs ?? [ ]
419- let extra = overrides. additionalSourceDirs ?? [ ]
420- let combined = base + extra
421- return combined. isEmpty ? nil : combined
422- } ( )
423385 return BridgeJSConfig (
424386 tools: ( tools ?? [ : ] ) . merging ( overrides. tools ?? [ : ] , uniquingKeysWith: { $1 } ) ,
425- exposeToGlobal: overrides. exposeToGlobal,
426- additionalSourceDirs: mergedDirs
387+ exposeToGlobal: overrides. exposeToGlobal
427388 )
428389 }
429390}
0 commit comments