Giter Site home page Giter Site logo

rules_apple_extras's Introduction

Extra Apple Rules for Bazel

This repository contains additional rules for Bazel that can be used to build libraries for Apple platforms.

Reference documentation

objc_library

Produces a static library from the given Objective-C source files, with support for header maps.

In iOS development, conventionally, when depending on an Objective-C library, you can import its public headers using the system include syntax (#import <MyLibrary/MyLibrary.h>) regardless of their location on the file sytem. However, in Bazel, you have to explicitly specify the location of the imported headers from the relatively from the included directories (#import "external/MyLibrary/MyLibrary.h"). This rule wraps the native objc_library rule to add support for the conventional import syntax, so that you won't have to patch your libraries to support building with Bazel.

apple_resource_bundle

Encapsulates a target which is provided to dependers as a bundle.

apple_resource_bundle rules coming from rules_apple doesn't have a bundle_id attribute, and doesn't support substitution of DEVELOPMENT_LANGUAGE and PRODUCT_BUNDLE_IDENTIFIER variables which by default exist in a resource bundle target generated by Xcode. This macro wraps rules_apple's apple_resource_bundle rule to modify the Info.plist files under the hood before giving them to the original rule, so that users don't have to manually hard code their plists in order to make their resource bundle targets work with Bazel.

Reference

Quick setup

Add the following to your WORKSPACE file to add the external repositories, replacing the commit hash in the commit attribute with the version of the rules you wish to depend on:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "com_github_thii_rules_apple_extras",
    remote = "https://github.com/thii/rules_apple_extras.git",
    commit = "<latest commit hash here>",
)

Examples

With a load statement at the top of your BUILD file, you can use this rule as you would with the native objc_library rule.

load("@com_github_thii_rules_apple_extras//apple:objc_library.bzl", "objc_library")

objc_library(
    name = "Lib",
    hdrs = [
        "Lib.h",
    ],
    srcs = glob([
        "**/*.m",
    ]),
)

Any target that depends on Lib will be able to import Lib's public header using #import <Lib/Lib.h> syntax.

License

MIT

rules_apple_extras's People

Contributors

thii avatar

Stargazers

linpeng.dev avatar Lie Albert Januar Linarco avatar Tim Kersey avatar Indragie Karunaratne avatar Enrique W. avatar Sergii D avatar  avatar

Watchers

Keith Smiley avatar James Cloos avatar  avatar  avatar

Forkers

mstoreytr

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.