JamitLabs / Accio

A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.
MIT License
664 stars 32 forks source link

$ accio install won't add build phase after re-generate Xcode project #87

Closed devxoul closed 4 years ago

devxoul commented 4 years ago

Hi, I'm using XcodeGen and would like to try Accio. I ran $ accio install after generating xcode project using $ xcodegen generate but it didn't add a build phase. You can easily reproduce it by deleting the build phase manually and run $ accio install.

How to reproduce

  1. Delete Accio build phase from Xcode.
  2. Run $ accio install.

Expected behavior

Accio adds the build phase.

Actual behavior

Nothing happened.

devxoul commented 4 years ago

https://github.com/JamitLabs/Accio/blob/0.6.5/Sources/AccioKit/Commands/InstallCommand.swift#L18-L21 seems to be too optimistic. It will also returns true on the next time after it fails to install but generates Package.resolved 🤔

Package.swift

// swift-tools-version:5.0
import PackageDescription

let package = Package(
  name: "MyApp",
  dependencies: [
    .package(url: "https://github.com/devxoul/Then", .upToNextMajor(from: "2.6.0")),
  ],
  targets: [] // it will fail since targets arry is empty
)
$ accio install # fails but generates Package.resolved
⚠️  No targets specified in manifest file. Please add at least one target to the 'targets' array in Package.swift.
Error: The operation couldn’t be completed. (AccioKit.DependencyInstallerError error 0.)

$ accio install # succeeds
✨  Found all required build products specified in resolved manifest in cache – skipping checkout & integration process ...
Jeehut commented 4 years ago

@dexvoul I think we haven't thought about the usage of xcodegen before. You seem to have already found more or less why it's failing. Feel free to send a PR which fixes the issue for xcodegen users and we will happily review and merge that! :)

fredpi commented 4 years ago

Closing this, as Accio is now deprecated.