INNER CODE UNIT · Swift

appendArguments

skiptools/skip · Plugins/SkipPlugin/SkipPlugin.swift:290

        func appendArguments(_ args: [String], unlessAlreadySet: Bool = true) {
            // scan the existing arguments to see if the same arg already exists
            if unlessAlreadySet == true && buildArguments.indices.first(where: {
                buildArguments.dropFirst($0).prefix(args.count) == .init(args)
            }) != nil {
                return
            }

            buildArguments += args
        }

        // create a map from [target ID: package] for all known targets
        let targetsToPackage = Dictionary(packageDeps.flatMap({ packageDep in
            packageDep.package.targets.map({ target in
                (target.id, packageDep.package)
            })
        }), uniquingKeysWith: { $1 })

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…