Skip to content
New issue

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

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

Already on GitHub? # to your account

Distribution through Cocoapods #390

Closed
nmccann opened this issue Jan 20, 2016 · 14 comments
Closed

Distribution through Cocoapods #390

nmccann opened this issue Jan 20, 2016 · 14 comments
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@nmccann
Copy link
Contributor

nmccann commented Jan 20, 2016

Hi,

I've been using SwiftLint for a few days now but found a few problems with how it is installed. A few of the problems (from my perspective):

  • Requires action from new developers (either brew install or manually installing package)
  • Difficult to specify a version that should be used
  • Installed globally, which isn't good for shared environments like self-hosted CI (Bamboo). Particularly if you don't have permissions to do such an installation.

I have two suggestions:

  • Provide a zipped copy of the binary and framework along with the package, source etc. that is currently included in each release.
  • Provide a pod spec that would download the binary, similar to what is used by R.swift

Users who aren't interested in using Cocoapods could just directly download the zipped binary for the version they want.

I've got this working with a podspec in a private repo and a zipped binary/framework that I manually generated using make prefix-install. Having to do all of that manually isn't ideal though because it makes it harder to maintain. And I feel like other people could benefit from this functionality.

I think this would also partially solve #302

Please let me know if there are any issues/concerns with this approach. If there aren't any, I could try to make a PR that handles automatic creation of the zipped binary during the release process.

Thanks,
Noah

@jpsim
Copy link
Collaborator

jpsim commented Jan 20, 2016

Requires action from new developers (either brew install or manually installing package)
Difficult to specify a version that should be used
Installed globally, which isn't good for shared environments like self-hosted CI (Bamboo). Particularly if you don't have permissions to do such an installation.

All of these can be addressed for your use case (and #302) by bundling a pre-built version of SwiftLint with your project, similar to what Jazzy does with SourceKitten.

If you keep this directory structure, swiftlint will always link the framework in ../Frameworks:

├── Frameworks
│   └── SwiftLintFramework.framework
└── bin
    └── swiftlint

Provide a zipped copy of the binary and framework along with the package, source etc. that is currently included in each release.
Provide a pod spec that would download the binary, similar to what is used by R.swift

I have a hard time seeing us adding a third or fourth installation method for SwiftLint (the existing two being brew and .pkg).

A Podspec might make sense if anyone wants to use SwiftLintFramework in a CocoaPods project, however, so I'd merge a PR adding that.

@nmccann
Copy link
Contributor Author

nmccann commented Jan 20, 2016

The downside I see with the Jazzy approach is that it involves committing a potentially large binary and framework in the repo. It also makes it more difficult to update, or to know when it should be updated. It becomes one more thing to check, in addition to things like pod outdated or bundle outdated that developers may already be doing.

@jpsim
Copy link
Collaborator

jpsim commented Jan 20, 2016

I'm sorry, this is just not something I want to support.

The downside I see with the Jazzy approach is that it involves committing a potentially large binary and framework in the repo. It also makes it more difficult to update, or to know when it should be updated. It becomes one more thing to check, in addition to things like pod outdated or bundle outdated that developers may already be doing.

You could make a simple Xcode build phase script for your project that downloads a zip of the Frameworks & bin directory structure mentioned above to a git ignored .swiftlint directory in your project's root.

@jpsim jpsim closed this as completed Jan 20, 2016
@nmccann
Copy link
Contributor Author

nmccann commented Jan 20, 2016

That's understandable, thank you for your time.

@samskiter
Copy link

+1 for this if you did reconsider. We're going to start distributing swiftgen the same as we have issues setting up and keeping the CI machines up to date (setting up homebrew non-interactively is basically impossible).

@jpsim jpsim reopened this Dec 2, 2016
@jpsim
Copy link
Collaborator

jpsim commented Dec 2, 2016

@samskiter making a pod for SwiftLintFramework is definitely doable, so I've reopened this issue.

Making the swiftlint CLI executable would be a bit more difficult.

@marcelofabri
Copy link
Collaborator

@jpsim Couldn't we just publish the portable binary zip on releases and create a podspec? See #221 (comment)

@jpsim
Copy link
Collaborator

jpsim commented Dec 2, 2016

I might be missing something, but the portable zip thing was done really strangely, and should be entirely unnecessary. The resulting products from make installables should already be "portable".

And wouldn't it be preferable to use a from-source SwiftLintFramework podspec rather than binaries?

@samskiter
Copy link

samskiter commented Dec 2, 2016 via email

@jpsim
Copy link
Collaborator

jpsim commented Dec 3, 2016

How many CLI executables have you installed with CocoaPods before? Why would I add a fifth way to install the SwiftLint CLI using a tool that isn't designed for that at all?

@samskiter
Copy link

samskiter commented Dec 3, 2016 via email

@marcelofabri
Copy link
Collaborator

The main advantage IMO of distributing the binary with CocoaPods is that homebrew doesn't have a way to enforce a certain version. Checking in the binary is an option, but I'd find it much easier to use CocoaPods as SwiftGen does.

@samskiter
Copy link

samskiter commented Dec 3, 2016 via email

@jpsim jpsim mentioned this issue Dec 4, 2016
@jpsim jpsim added the enhancement Ideas for improvements of existing features and rules. label Dec 7, 2016
@jpsim
Copy link
Collaborator

jpsim commented Dec 7, 2016

Hopefully #936 addresses this.

@jpsim jpsim closed this as completed Dec 7, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

4 participants