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

Add to homebrew #35

Closed
hyzyla opened this issue Feb 11, 2024 · 6 comments
Closed

Add to homebrew #35

hyzyla opened this issue Feb 11, 2024 · 6 comments

Comments

@hyzyla
Copy link
Contributor

hyzyla commented Feb 11, 2024

I find that the current method of installing xcode-build-server via git can be challenging for new users compared to using homebrew. Also, regular users must manually check and pull changes for new updates. It would be great to have a Homebrew formula for your project to address those issues. I don't have much experience with creating Homebrew formulas, but I can try to prepare a pull request for homebrew-core. But before I start, I would like to know what you think about it?

@SolaWing
Copy link
Owner

SolaWing commented Feb 12, 2024

It sounds great. I don't have any exprience with creating formulas too.
I also hope the user can follow the newest head.
After you create the formula, I will put it into the Readme.

Thank you for help!

@hyzyla
Copy link
Contributor Author

hyzyla commented Feb 13, 2024

Here is a draft for homebrew formula:

class XcodeBuildServer < Formula
  desc "Build server protocol implementation for integrate xcode with sourcekit-lsp"
  homepage "https://github.com/SolaWing/xcode-build-server"
  url "https://github.com/SolaWing/xcode-build-server/archive/refs/tags/v0.0.1.zip"
  # sha256 ""
  license "MIT"

  depends_on "python@3"
  depends_on :macos
  depends_on "xcodebuild"
  depends_on "gunzip"

  def install
      # Install all files and directories under libexec
      libexec.install Dir["*"]

      # Create a wrapper script in the bin directory for the xcode-build-server script
      bin.write_exec_script libexec/"xcode-build-server"
    end

  test do
    # Test the xcode-build-server script
    system "#{bin}/xcode-build-server", "--help"
  end
end

@SolaWing
Copy link
Owner

thank you for your help. can you also provide head version so user can follow newest head? also did you test installing from brew, server function correctly? xcode-build-server use relative path to load other modules, so it must be soft link to original script in download dir

@SolaWing
Copy link
Owner

I just push a release tag so you can submit PR to brew.

@hyzyla
Copy link
Contributor Author

hyzyla commented Feb 15, 2024

~ brew install xcode-build-server
==> Downloading https://ghcr.io/v2/homebrew/core/xcode-build-server/manifests/1.0.0
########################################################################################################################################################################### 100.0%
==> Fetching xcode-build-server
==> Downloading https://ghcr.io/v2/homebrew/core/xcode-build-server/blobs/sha256:acb6a9442ac88d56faef8f0ee71f9f0939125e07157070994f0fd8db077757e5
########################################################################################################################################################################### 100.0%
==> Pouring xcode-build-server--1.0.0.all.bottle.tar.gz
🍺  /opt/homebrew/Cellar/xcode-build-server/1.0.0: 13 files, 63.4KB
==> Running `brew cleanup xcode-build-server`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

➜  ~ xcode-build-server --help
usage:
          /opt/homebrew/bin/xcode-build-server: start a build server
          /opt/homebrew/bin/xcode-build-server config: bind xcworkspace and generate a buildServer.json to current dir
          /opt/homebrew/bin/xcode-build-server parse: xcode log subcommand. call parse -h to see more help
          /opt/homebrew/bin/xcode-build-server postaction: dump a xcode post build bash script to sync flags to .compile(usage: `/opt/homebrew/bin/xcode-build-server postaction | bash &` in xcode post build bash script)
          /opt/homebrew/bin/xcode-build-server [-h|--help]: show help

@SolaWing
Copy link
Owner

Thank you for your help, I have pushed brew install xcode-build-server to Readme.

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

No branches or pull requests

2 participants