Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Sources/SwiftJavaTool/Commands/WrapJavaCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,19 @@ extension SwiftJava.WrapJavaCommand {

private func shouldImportJavaClass(_ javaClassName: String, config: Configuration) -> Bool {
// If we have an inclusive filter, import only types from it
for include in config.filterInclude ?? [] {
guard javaClassName.starts(with: include) else {
log.info("Skip Java type: \(javaClassName) (does not match include filter: \(include))")
if let includes = config.filterInclude, !includes.isEmpty {
let anyIncludeFilterMatched = includes.contains { include in
if javaClassName.starts(with: include) {
// TODO: lower to trace level
log.info("Skip Java type: \(javaClassName) (does not match any include filter)")
return true
}

return false
}

guard anyIncludeFilterMatched else {
log.info("Skip Java type: \(javaClassName) (does not match any include filter)")
return false
}
}
Expand Down
Loading