xcode - Locate source project directory in Swift from compiled code -
I want to find a directory of my uncompressed source code (because I want to count my lines) project. Project Rippo = "/ User / Tomburorn / Workspace / SwiftGolf" // < - I want this program to know that path = "\ (project ripo) / swift / Gulf Gulf / swift" var fileContents = String.stringWithContentsOfFile (path, encoding: NSUTF8StringEncoding, error: zero)
I've found the compiled location with the The challenge is getting faster Runtime versus location to estimate on collection time. The logic in Xcode suggestion works fine and can be accepted as a solution. I could not use this approach because I am using SPM without XM. Package in you. Swift Then enter Another option is commandlinekit / xcode logic NSBundle.mainBundle (). BundlePath , but does not contain unrelated code in any ideas? Perhaps there is a way that I can write a temporary file during the build process?
Dependencies: [. Package .git ", version (1,8,0))]
import files in your code projectrepo =" (Folder .home .path) / gitWorkspace / SwiftGolf "{Enter Model = Try Data (Content: URL (fileURLWithPath:" \ (projectDir) / \ (modelFile) ")}} Hold {Print (" Error: \ (error) " )}
import command line kit cmdline = commandline kit.commandline (). File = string ocean (shortflag) : "F", Longflag: "File", Required Yes: true, help message: "the file that you are trying to parse"). CmdLine.addOptions (file) {try cmdLine.parse () print (file.value!)} {Print ("Error: \ (Error) ") exit (-1)}
Comments
Post a Comment