GithubHelp home page GithubHelp logo

bazel-apple-framework-relative-headers's Introduction

Bazel Apple framework relative headers

This repo provides a Bazel build rule for adding framework-style import support to Objective-C libraries. This is most useful if you prefer using objc_library to define your targets, but you also use CocoaPods to import your libraries using framework-style imports.

Note: this repo was forked from the material-foundation/material-internationalization-ios repository.

Usage

First, load the repo in your WORKSPACE:

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

git_repository(
    name = "bazel_apple_framework_relative_headers",
    remote = "https://github.com/material-foundation/bazel-apple-framework-relative-headers.git",
    commit = "<# SHA for a commit #>",
)

You can then add a apple_framework_relative_headers dependency to any objc_library in order to add support for framework-style imports in other Objective-C code:

load("@bazel_apple_framework_relative_headers//:apple_framework_relative_headers.bzl", "apple_framework_relative_headers")

objc_library(
    name = "Library",
    srcs = glob(["src/*.m"]),
    hdrs = glob(["src/*.h"]),
    sdk_frameworks = [
        "UIKit",
        "CoreGraphics",
    ],
    enable_modules = 1,
    module_name = "Library",
    visibility = ["//visibility:public"],
    deps = [
        ":LibraryFrameworkHeaders",
    ],
)

# Adds support for importing Library headers like so: #import <Library/Library.h>
apple_framework_relative_headers(
    name = "LibraryFrameworkHeaders",
    hdrs = glob(["src/*.h"]),
    framework_name = "Library",
)

License

Licensed under the Apache 2.0 license. See LICENSE for details.

bazel-apple-framework-relative-headers's People

Contributors

jverkoey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jverkoey

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.