Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Plugin Derived Data Path #56

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,35 @@ extension SwiftPackageListJSONPlugin: XcodeBuildToolPlugin {
let executable = try context.tool(named: "swift-package-list").path
let outputPath = context.pluginWorkDirectory
let fileType = "json"
let derivedDataPath = context.derivedDataDirectory
return [
.buildCommand(
displayName: "SwiftPackageListPlugin",
executable: executable,
arguments: ["generate", projectPath, "--output-path", outputPath, "--file-type", fileType, "--requires-license"],
arguments: [
"generate",
projectPath,
"--derived-data-path", derivedDataPath,
"--output-path", outputPath,
"--file-type", fileType,
"--requires-license"
],
outputFiles: [outputPath.appending("package-list.json")]
)
]
}
}

extension XcodePluginContext {
var derivedDataDirectory: Path {
var path = pluginWorkDirectory
while path.lastComponent != "DerivedData" {
guard path.string != "/" else {
return Path("\(NSHomeDirectory())/Library/Developer/Xcode/DerivedData")
}
path = path.removingLastComponent()
}
return path
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,35 @@ extension SwiftPackageListPDFPlugin: XcodeBuildToolPlugin {
let executable = try context.tool(named: "swift-package-list").path
let outputPath = context.pluginWorkDirectory
let fileType = "pdf"
let derivedDataPath = context.derivedDataDirectory
return [
.buildCommand(
displayName: "SwiftPackageListPlugin",
executable: executable,
arguments: ["generate", projectPath, "--output-path", outputPath, "--file-type", fileType, "--requires-license"],
arguments: [
"generate",
projectPath,
"--derived-data-path", derivedDataPath,
"--output-path", outputPath,
"--file-type", fileType,
"--requires-license"
],
outputFiles: [outputPath.appending("Acknowledgements.pdf")]
)
]
}
}

extension XcodePluginContext {
var derivedDataDirectory: Path {
var path = pluginWorkDirectory
while path.lastComponent != "DerivedData" {
guard path.string != "/" else {
return Path("\(NSHomeDirectory())/Library/Developer/Xcode/DerivedData")
}
path = path.removingLastComponent()
}
return path
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,35 @@ extension SwiftPackageListPropertyListPlugin: XcodeBuildToolPlugin {
let executable = try context.tool(named: "swift-package-list").path
let outputPath = context.pluginWorkDirectory
let fileType = "plist"
let derivedDataPath = context.derivedDataDirectory
return [
.buildCommand(
displayName: "SwiftPackageListPlugin",
executable: executable,
arguments: ["generate", projectPath, "--output-path", outputPath, "--file-type", fileType, "--requires-license"],
arguments: [
"generate",
projectPath,
"--derived-data-path", derivedDataPath,
"--output-path", outputPath,
"--file-type", fileType,
"--requires-license"
],
outputFiles: [outputPath.appending("package-list.plist")]
)
]
}
}

extension XcodePluginContext {
var derivedDataDirectory: Path {
var path = pluginWorkDirectory
while path.lastComponent != "DerivedData" {
guard path.string != "/" else {
return Path("\(NSHomeDirectory())/Library/Developer/Xcode/DerivedData")
}
path = path.removingLastComponent()
}
return path
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,35 @@ extension SwiftPackageListSettingsBundlePlugin: XcodeBuildToolPlugin {
let executable = try context.tool(named: "swift-package-list").path
let outputPath = context.pluginWorkDirectory
let fileType = "settings-bundle"
let derivedDataPath = context.derivedDataDirectory
return [
.buildCommand(
displayName: "SwiftPackageListPlugin",
executable: executable,
arguments: ["generate", projectPath, "--output-path", outputPath, "--file-type", fileType, "--requires-license"],
arguments: [
"generate",
projectPath,
"--derived-data-path", derivedDataPath,
"--output-path", outputPath,
"--file-type", fileType,
"--requires-license"
],
outputFiles: [outputPath.appending("Settings.bundle")]
)
]
}
}

extension XcodePluginContext {
var derivedDataDirectory: Path {
var path = pluginWorkDirectory
while path.lastComponent != "DerivedData" {
guard path.string != "/" else {
return Path("\(NSHomeDirectory())/Library/Developer/Xcode/DerivedData")
}
path = path.removingLastComponent()
}
return path
}
}
#endif