Bug fixes, aria, cross platform support.
This commit is contained in:
@@ -54,7 +54,6 @@ extension BindingPlugin: BuildToolPlugin {
|
||||
#if canImport(XcodeProjectPlugin)
|
||||
|
||||
import XcodeProjectPlugin
|
||||
import System
|
||||
|
||||
// The entry point for Xcode project builds.
|
||||
extension BindingPlugin: XcodeBuildToolPlugin {
|
||||
@@ -149,15 +148,22 @@ struct BindingPlugin {
|
||||
let extIndex = fileName.index(fileName.startIndex, offsetBy: fileName.count - (ext.count + 1))
|
||||
let withoutExt = String(fileName[fileName.startIndex..<extIndex])
|
||||
let targetFileName = "\(withoutExt.uppercaseFirstLetter()).swift"
|
||||
|
||||
let rootFP = FilePath(rootPath.path)
|
||||
var inputFP = FilePath(eachFile.path)
|
||||
let outputDirFP = FilePath(outputDir.path)
|
||||
|
||||
let _ = inputFP.removePrefix(rootFP)
|
||||
inputFP.removeLastComponent()
|
||||
//let idk = outputDirFP.pushing(inputFP)
|
||||
let outputFileA = outputDir.appendingPathComponent(inputFP.string)
|
||||
|
||||
let rootPathP = Path(rootPath.path)
|
||||
let fileDirP = Path(eachFile.deletingLastPathComponent().path)
|
||||
let relativeDir: String
|
||||
let baseDir = rootPathP.string.hasSuffix("/") ? rootPathP.string : rootPathP.string + "/"
|
||||
if fileDirP.string == rootPathP.string {
|
||||
relativeDir = ""
|
||||
} else if fileDirP.string.hasPrefix(baseDir) {
|
||||
relativeDir = String(fileDirP.string.dropFirst(baseDir.count))
|
||||
} else {
|
||||
relativeDir = ""
|
||||
}
|
||||
|
||||
let outputFileA = relativeDir.isEmpty
|
||||
? outputDir
|
||||
: outputDir.appendingPathComponent(relativeDir)
|
||||
let outputFile = outputFileA.appendingPathComponent(targetFileName)
|
||||
print("Expected path: \(outputFile.path)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user