Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ jobs:
git config --global core.eol lf

- name: Bazel Build app_resource
run: bazel build example:app_resource
run: |
cd example
bazel build --process_headers_in_dependencies app_resource
cd ..

- name: Bazel Build app
run: bazel build example:app
run: |
cd example
bazel build --process_headers_in_dependencies app
cd ..
3 changes: 1 addition & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ module(
)

bazel_dep(name = "rules_cc", version = "0.1.1")

bazel_dep(name = "rules_python", version = "1.4.1", dev_dependency = True)
bazel_dep(name = "rules_python", version = "1.4.1")

# Setup Python toolchain (required by rules_python)
python = use_extension("@rules_python//python:extensions.bzl", "python")
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ The `cc_resources` rule in Bazel is designed for converting binary files into C/

Here is a brief overview of how to use the `cc_resources` rule in your Bazel build files.

```bazel
bazel_dep(name = "rules_cc_resources", version = "0.1.0")
# load("@rules_cc_resources//rules:defs.bzl", "cc_resources")
```

#### Rule Definition

You should define the `cc_resources` rule in your `BUILD.bazel` file with the required attributes:
Expand Down Expand Up @@ -41,7 +46,7 @@ When you invoke the `cc_resources` rule, it generates:
Given the following `BUILD.bazel` setup:

```python
load("//rules:defs.bzl", "cc_resources")
load("@rules_cc_resources//rules:defs.bzl", "cc_resources")

cc_resources(
name = "image_resources",
Expand Down
3 changes: 1 addition & 2 deletions example/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# src/BUILD
load("//rules:defs.bzl", "cc_resources")
load("@rules_cc_resources//rules:defs.bzl", "cc_resources")

# Use the rule to convert my_resource.txt
cc_resources(
Expand All @@ -15,7 +15,6 @@ cc_library(
name = "lib",
srcs = [":app_resource"],
includes = [
".",
],
)

Expand Down
8 changes: 8 additions & 0 deletions example/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# MODULE.bazel
bazel_dep(name = "rules_cc_resources")
local_path_override(
module_name = "rules_cc_resources",
path = "..",
)

bazel_dep(name = "rules_cc", version = "0.1.1")
Loading