-
-
Save owensd/6adfa7b665614e926e46dd12b32f3d7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO(owensd): Need to actually get the version of Swift that the workspace is using based on the OS. | |
projectPath = params.rootPath! | |
let includePath = "/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib/swift/pm" | |
let packagePath = "\(projectPath!)/Package.swift" | |
let swiftPath = "/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swift" | |
let output = shell( | |
tool: swiftPath, | |
arguments: ["-I", includePath, "-L", includePath, "-lPackageDescription", packagePath, "-fileno", "1"]) | |
let packageJson = try JSValue.parse(output) | |
moduleName = packageJson["package"]["name"].string! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment