INNER CODE UNIT · Swift

createBuildCommands

mono0926/LicensePlist · Plugins/LicensePlistBuildTool/LicensePlistBuildTool.swift:6

    func createBuildCommands(context: PluginContext, target: Target) async throws -> [Command] {
        Diagnostics.error("Plugin only supported in Xcode build phases")
        return []
    }
}

#if canImport(XcodeProjectPlugin)
import XcodeProjectPlugin

extension LicensePlistBuildTool: XcodeBuildToolPlugin {
    func createBuildCommands(context: XcodePluginContext, target: XcodeTarget) throws -> [Command] {
        let licensePlist = try context.tool(named: "license-plist")
        let fileManager = FileManager.default
        
        // Checks LicensePlist config
        let configPath = context.xcodeProject.directoryURL.appending(component: "license_plist.yml")
        guard fileManager.fileExists(atPath: configPath.path) else {
            Diagnostics.error("Can't find 'license_plist.yml' file")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…