@@ -103,17 +103,16 @@ extension SwiftJava.ConfigureCommand {
103103 var log = Self . log
104104 log. logLevel = . init( rawValue: self . logLevel. rawValue) !
105105
106-
107106 log. info ( " Run: emit configuration... " )
108107 var ( amendExistingConfig, configuration) = try getBaseConfigurationForWrite ( )
109108
110- if let filterJavaPackage = self . commonJVMOptions . filterJavaPackage {
111- log. debug ( " Generate Java->Swift type mappings. Active filter : \( filterJavaPackage ) " )
112- } else if let filterJavaPackage = configuration. filterJavaPackage {
109+ if ! self . commonOptions . filterInclude . isEmpty {
110+ log. debug ( " Generate Java->Swift type mappings. Active include filters : \( self . commonOptions . filterInclude ) " )
111+ } else if let filters = configuration. filterInclude , !filters . isEmpty {
113112 // take the package filter from the configuration file
114- self . commonJVMOptions . filterJavaPackage = filterJavaPackage
113+ self . commonOptions . filterInclude = filters
115114 } else {
116- log. debug ( " Generate Java->Swift type mappings. No package filter applied. " )
115+ log. debug ( " Generate Java->Swift type mappings. No package include filter applied. " )
117116 }
118117 log. debug ( " Classpath: \( classpathEntries) " )
119118
@@ -195,10 +194,8 @@ extension SwiftJava.ConfigureCommand {
195194 let javaCanonicalName = String ( entry. getName ( ) . replacing ( " / " , with: " . " )
196195 . dropLast ( " .class " . count) )
197196
198-
199- if let filterJavaPackage = self . commonJVMOptions. filterJavaPackage,
200- !javaCanonicalName. hasPrefix ( filterJavaPackage) {
201- // Skip classes which don't match our expected prefix
197+ guard SwiftJava . shouldImport ( javaCanonicalName: javaCanonicalName, commonOptions: self . commonOptions) else {
198+ log. info ( " Skip importing class: \( javaCanonicalName) due to include/exclude filters " )
202199 continue
203200 }
204201
0 commit comments