Coder Social home page Coder Social logo

xcodeproj-bazel's Introduction

xcodeproj-bazel

Minimal setup for .xcodeproj with the bazel build system. Xcode project is generated using rules_xcodeproj

Prerequisites

$ git clone --recursive https://github.com/pepeunlimited/xcodeproj-bazel.git

Install bazelisk via homebrew

$ brew install bazelisk

Check that you have installed and configured xcodebuild. If you're not download Xcode

Install the Command Line Tools

$ xcode-select --install

Open the Xcode after installation at least once because it executes configures for macOS and licence agreements during first launch.

$ /usr/bin/xcodebuild -version

(OPTIONAL)

$ sudo xcode-select -s /Applications/Xcode.app

If you still get error, try to agree license.

$ sudo xcodebuild -license

Test that bazel should be able to build iOS project with the Bazel

$ bazel build //HelloWorld/iOS:HelloWorld

Getting started

$ which bazel

Since Homebrew v3.0.0, the default prefix is different depending on the chip architecture. The defaults are the following:

on Apple silicon

/opt/homebrew

on Intel

/usr/local

iOS

LaunchScreen.storyboard is required to be configured, otherwise UIScreen.main.bounds and windowScene.coordinateSpace.bounds causes misbehavior for application.

rules_xcodeproj

Generate .xcodeproj using the buildbuddy-io/rules_xcodeproj

$ bazel run //HelloWorld/iOS:xcodeproj

Open the Xcode

$ open $SRCROOT/HelloWorld/iOS/helloworld-ios.xcodeproj

Build the iOS application

$ bazel build //HelloWorld/iOS:HelloWorld

Run the iOS application

$ bazel run //HelloWorld/iOS:HelloWorld

macOS

TODO

submodules

Build the SharedKit swift_test

$ bazel build //submodules/SharedKit:SwiftXCTest

Run the SharedKit swift_test

$ bazel test //submodules/SharedKit:SwiftXCTest --macos_minimum_os=13.5.2

Build OSExtension

$ bazel build //submodules/OSExtension:OSExtension

Build the HelloWorldUI ios_unit_test

$ bazel build //submodules/HelloWorldUI:XCUnitTestSuite

Run the HelloWorldUI ios_unit_test

$ bazel test //submodules/HelloWorldUI:XCUnitTestSuite

Bazel

Clean

$ bazel clean --expunge

Simulator

Boot

$ xcrun simctl boot "iPhone 14"

Open Simulator.app

$ open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

Failed to start launchd_sim: could not bind to session

oslog

See the list of running simulators

$ xcrun simctl list

View the log stream on console

$ xcrun simctl spawn '5A709945-ED74-45F3-A248-AA289FE92497' log stream --debug --predicate 'subsystem == "com.pepeunlimited.helloworld"'

SourceKit-LSP

xcrun --toolchain swift sourcekit-lsp --help

how-coupled-is-sourcekit-lsp-to-spm
export-compile-commands.json
vscode-env

swiftlint

$ brew install swiftlint
¢ swiftlint lint submodules/HelloWorldUI/Sources/FeedViewController.swift --no-cache --fix --format

Swift

api-design-guidelines
.swiftlint.yml

Documentation & Links

This documentation is collected from rulesets in the bazelbuild GitHub org
bazelbuild/rules_apple
bazelbuild/rules_swift
bazelbuild/apple_support
bazelbuild/bazel-skylib
bazel.build/command-line-reference
buildbuddy-io/rules_xcodeproj
Bazel Tutorial: Build an iOS App
Migrating from Xcode to Bazel
Building with Bazel
ios_and_bazel_at_reddit_a_journey
migrating-ios-project-to-bazel-a-real-world-experience

google-mediapipe-examples-ios
Telegram-iOS
liuliu/dflat
wendyliga/simple_bazel
TulsiGeneratorIntegrationTests
iOS Dynamic vs. Static Library / Framework

.imageset

License

xcodeproj-bazel is released under the MIT license. See LICENSE for details.

xcodeproj-bazel's People

Contributors

siimooo avatar

Stargazers

Emilio P Egido avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.