Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update dependencies stored in the repository. #27

Merged
merged 3 commits into from
Mar 16, 2016
Merged

Update dependencies stored in the repository. #27

merged 3 commits into from
Mar 16, 2016

Conversation

mitsuse
Copy link
Contributor

@mitsuse mitsuse commented Mar 15, 2016

Modifications

  • Remove files Carthage/Checkouts.
  • Manage dependencies as git-submodules with Carthage
    • Use the versions recorded in Cartfile.resolved by carthage checkout --use-submodules.

Purposes

This pull-request cleans up dependencies for two purposes:

  • Avoid confusing users who want to build SourceKittenDaemon from source.
  • Create the formula for Homebrew to makes it easy to use SourceKittenDaemon in plugins.

Avoid confusing

Currently, the repository stores old versions of dependencies. For example, antitypical/Result v0.6.0-beta.5 is different from Carthage/Checkouts/Result/ at master branch. They will be updated with carthage bootstrap in build step, but it would be simpler to just store the correct versions recorded in Cartfile.resolved.

Formula for Homebrew

The formula of SourceKittenDaemon makes it easy to use pluings which depend on this project.

I tried writing formula, but Homebrew cannot build the lastest version (v0.1.2) of SourceKittenDaemon. This failure was caused by Homebrew because carthage bootstrap didn't update dependencies correctly, but it is avoidable by updating them in advance. In addition, dependencies should not be checked out with carthage in formula (please see this).

The formula of the version 0.1.2 is below one:

class Sourcekittendaemon < Formula
  desc "Swift Auto Completions for any Text Editor"
  homepage "https://github.com/terhechte/SourceKittenDaemon"
  url "https://github.com/terhechte/SourceKittenDaemon.git",
    :tag => "0.1.2",
    :revision => "f38248b909979865e6963196d62e460f0657b32a",
    :shallow => false
  head "https://github.com/terhechte/SourceKittenDaemon.git"

  depends_on :xcode => ["7.1", :build]
  depends_on "carthage" => :build

  def install
    system "git", "submodule", "update", "--init", "--recursive"
    ### Workaround: Remove old dependenices before bootstrapping.
    # system "rm", "-r", "Carthage/Checkouts/" 
    system "carthage", "bootstrap", "--no-use-binaries", "--platform", "Mac"
    system "make", "install", "PREFIX=#{prefix}"
  end
end

And the version of this pull-request:

class Sourcekittendaemon < Formula
  desc "Swift Auto Completions for any Text Editor"
  homepage "https://github.com/mitsuse/SourceKittenDaemon"
  url "https://github.com/mitsuse/SourceKittenDaemon.git",
    :tag => "0.1.3",
    :revision => "120e8174177db2940967e395063e2d9e9af2c9dc",
    :shallow => false
  head "https://github.com/mitsuse/SourceKittenDaemon.git"

  depends_on :xcode => ["7.1", :build]
  depends_on "carthage" => :build

  def install
    system "git", "submodule", "update", "--init", "--recursive"
    system "carthage", "build", "--platform", "Mac"
    system "make", "install", "PREFIX=#{prefix}"
  end
end

@terhechte
Copy link
Owner

Awesome thanks! This looks really good. I'll try it out and will then probably merge it in.

terhechte added a commit that referenced this pull request Mar 16, 2016
 Update dependencies stored in the repository.
@terhechte terhechte merged commit d828238 into terhechte:master Mar 16, 2016
@terhechte
Copy link
Owner

Also, awesome that you added homebrew support! Now that your changes have been merged in and 0.1.3 has been released, do you want to submit a PR for inclusion of the brew formula? Or should I do that?

Cheers & Thanks!
Benedikt

@mitsuse
Copy link
Contributor Author

mitsuse commented Mar 16, 2016

@terhechte Thanks for merging and releasing! I will submit the formula and let you know when the PR is merged.

@mitsuse mitsuse deleted the cleanup-dependencies branch March 16, 2016 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants