bazelbuild / tulsi

An Xcode Project Generator For Bazel
http://tulsi.bazel.build
Apache License 2.0
548 stars 123 forks source link

Document the hermetic way to use Tulsi #353

Closed kkpattern closed 2 years ago

kkpattern commented 2 years ago

Tulsi actually can be easily integrated into a project and makes the use of Tulsi much more hermetic. Currently, we add the following lines to our WORKSPACE:

http_archive(
    name = "tulsi",
    url = "https://github.com/bazelbuild/tulsi/archive/518f18da4948192c72074e07fa1dfe15858d40f4.tar.gz",
    strip_prefix = "tulsi-518f18da4948192c72074e07fa1dfe15858d40f4",
    sha256 = "92c89fcabfefc313dafea1cbc96c9f68d6f2025f2436ee11f7a4e4eb640fa151",
)

Then we can run Tulsi in our project by calling bazel run @tulsi//:tulsi. If we want to generate a xcode project from config we just need to call:

bazel run  -- @tulsi//:tulsi -- --genconfig "/path/to/tulsiproj" --outputfolder="/path/to/output/folder"

In this way, it's much easier to update Tulsi across the whole team and CI/CD environment.

If this way of using Tulsi is intended to be supported by Tulsi team in the future, I'd like to create a PR to document it.

thii commented 2 years ago

We do the same. This makes more sense since Tulsi already depends on rules_apple and rules_swift; building it in a separate workspace means it would need to pull (potentially different versions of) rules_apple and rules_swift twice. It would be nice to document this in the README.