                 }
 
                 if embed {
-                    let embedFile = PBXBuildFile(reference: generateUUID(PBXBuildFile.self, fileReference + target.name), fileRef: fileReference, settings: dependancy.buildSettings)
+                    let embedFile = PBXBuildFile(reference: generateUUID(PBXBuildFile.self, fileReference + target.name), fileRef: fileReference, settings: dependency.buildSettings)
                     addObject(embedFile)
                     copyFiles.append(embedFile.reference)
                 }

        var copyFiles: [String] = []
        var extensions: [String] = []

        for dependancy in target.dependencies {

            let embed = dependancy.embed ?? (target.type.isApp ? true : false)
            switch dependancy.type {
            case .target:
                let dependencyTargetName = dependancy.reference
                guard let dependencyTarget = spec.getTarget(dependencyTargetName) else { continue }
                let dependencyFileReference = targetFileReferences[dependencyTargetName]!

                let targetProxy = PBXContainerItemProxy(reference: generateUUID(PBXContainerItemProxy.self, target.name), containerPortal: project.rootObject, remoteGlobalIDString: targetNativeReferences[dependencyTargetName]!, proxyType: .nativeTarget, remoteInfo: dependencyTargetName)
                let targetDependancy = PBXTargetDependency(reference: generateUUID(PBXTargetDependency.self, dependencyTargetName + target.name), target: targetNativeReferences[dependencyTargetName]!, targetProxy: targetProxy.reference)

                addObject(targetProxy)
                addObject(targetDependancy)
                dependancies.append(targetDependancy.reference)

                // don't bother linking a target dependency
                // let dependencyBuildFile = targetBuildFileReferences[dependencyTargetName]!
                // targetFrameworkBuildFiles.append(dependencyBuildFile)

                if embed {
                    let embedSettings = dependancy.buildSettings
                    let embedFile = PBXBuildFile(reference: generateUUID(PBXBuildFile.self, dependencyFileReference + target.name), fileRef: dependencyFileReference, settings: embedSettings)
                    addObject(embedFile)


                    carthageFrameworksByPlatform[target.platform.carthageDirectoryName] = []
                }
                var platformPath = Path(getCarthageBuildPath(platform: target.platform))
                var frameworkPath = platformPath + dependency.reference
                if frameworkPath.extension == nil {
                    frameworkPath = Path(frameworkPath.string + ".framework")
                }
