SolaWing / xcode-build-server

a build server protocol implementation for integrate xcode with sourcekit-lsp
MIT License
283 stars 16 forks source link

Add to homebrew #35

Closed hyzyla closed 2 months ago

hyzyla commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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

hyzyla commented 2 months ago
➜  ~ 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 commented 2 months ago

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