diff --git a/Plugins/Enlighter/Enlighter.swift b/Plugins/Enlighter/Enlighter.swift index 0a7ff61..13f8d56 100644 --- a/Plugins/Enlighter/Enlighter.swift +++ b/Plugins/Enlighter/Enlighter.swift @@ -532,34 +532,7 @@ extension Enlighter: XcodeBuildToolPlugin { inputFiles : inputFiles, outputFiles : outputFiles )) - - // So, in Xcode, if a resource is handled by Enlighter, Xcode itself - // doesn't copy the resource anymore. Likely a bug. - // So what we do is copy them ourselves into the plugin dir. They then - // get bundled properly. - let inResourceURLs = groups.map({ $0.resourceURLs }).reduce([], +) - try inResourceURLs.forEach { ( inputResource : URL ) in - #if compiler(>=6) && canImport(Foundation) - let outResourceURL = context.pluginWorkDirectoryURL - .appendingPathComponent(inputResource.lastPathComponent) - #else - let outResourceFile = context.pluginWorkDirectory // TODO: Xcode16b2? - .appending(inputResource.lastPathComponent) - let outResourceURL = URL(fileURLWithPath: outResourceFile.string) - #endif - - buildCommands.append(.buildCommand( - displayName : "Copy \(group.stem) resource " - + "\(inputResource.lastPathComponent) into \(target.name)", - executable : try context.tool(named: "cp").url, - arguments : [ "-a", - inputResource .path(percentEncoded: false), - outResourceURL.path(percentEncoded: false) ], - inputFiles : [ inputResource ], - outputFiles : [ outResourceURL ] - )) - } - #else + #else // Xcode <16 let inputFiles : [ Path ] = { var inputFiles = group.matches.map { Path($0.path) } if let configURL = configuration.configURL { @@ -592,6 +565,9 @@ extension Enlighter: XcodeBuildToolPlugin { outputFiles : outputFiles )) + // Fixed in Xcode 16, and maybe in 15.4 already. + // The fix resulted in this issue I think: + // https://github.com/Lighter-swift/Lighter/issues/27 // So, in Xcode, if a resource is handled by Enlighter, Xcode itself // doesn't copy the resource anymore. Likely a bug. // So what we do is copy them ourselves into the plugin dir. They then