1

我有一个依赖复杂的项目,我想让其他开发人员更容易抓住它们。我有一个Capfile, Gemfile, Guardfile, Procfile, 和Rakefile,所以我想......为什么不Brewfile为克隆项目的 mac 开发人员管理系统级包依赖项呢?

我希望制作一个本地公式,它只是一个依赖项列表,例如:

# Brewfile
require 'formula'

class DeveloperProject < Formula
  depends_on 'mongodb'
  depends_on 'postgresql'
  depends_on 'solr'
  depends_on 'phantomjs'
end

第一次检查 repo 的开发人员可以brew install developer_project,并且随着依赖项的变化,他们可以brew update developer_project.

问题是,我的 brew-fu 不够好,无法弄清楚如何让 brew 识别这个公式,而不需要在某个地方为它创建一个完整的存储库。

起初我以为我可以尝试以某种方式传入文件路径:

brew install /Users/me/Projects/DeveloperProject/Brewfile

然后我想我可能能够模拟一个水龙头,而不必托管一个实际的仓库,以进行适当的备用公式源管理:

mkdir -c /usr/local/Library/Taps/local-tap/Formula/
ln -s \
  /Users/me/Projects/DeveloperProject/Brewfile \
  /usr/local/Library/Taps/local-tap/Formula/developer_project.rb
brew install developer_project

然后我想我可以将它符号链接到我的公式中,尽管它会导致脆性brew update

ln -s \
  /Users/me/Projects/DeveloperProject/Brewfile \
  /usr/local/Library/Formula/developer_project.rb
brew install developer_project

我找不到一种方法来完成这些工作,而且每种方法都感觉越来越老套。有没有办法用 brew 做到这一点而不会像存储库一样嘎嘎作响?否则,有没有办法像远程公式源一样成功嘎嘎?我是否错过了为项目制作 brew manifest 的现有方法?

4

2 回答 2

2

您可以使用 URL 安装任意公式,但不能使用文件名。因此,如果您将该brew install /Users/me/...命令中的路径转换为file://​​URL,您可能可以简单地使其工作,而无需维护 repo 或 tap 或类似的东西。

请注意,要让它自动更新内容,您需要在公式中明确输入版本号,并在每次依赖项更改时对其进行修改。

于 2013-04-25T08:01:47.217 回答
0

看来我不是第一个有这个想法的人!Brewdler 不支持特定的水龙头或任何东西,但它对我有用。

于 2013-03-31T18:18:51.790 回答