-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dash: Add README.md and move target to docs directory
The README.md provides better insignt how Bazel and Dash (EF License checker) communicate and work in chain. Also the target for checking Python licenses is moved to docs directory.
- Loading branch information
1 parent
88b3909
commit 3713042
Showing
4 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# DASH License Checker Bazel Integration | ||
|
||
This directory provides Bazel build configurations and custom rules to integrate the DASH license checker into projects. The setup includes a macro to define a java_binary target for license validation and a custom rule for converting requirement files into the appropriate DASH format. | ||
|
||
## Directory Structure | ||
|
||
```bash | ||
├── BUILD | ||
├── dash.bzl | ||
├── formatters | ||
│ ├── BUILD | ||
│ ├── dash_format_converter.bzl | ||
│ └── dash_format_converter.py | ||
└── README.md | ||
``` | ||
|
||
### File Descriptions | ||
|
||
**BUILD** | ||
|
||
- This file is empty and serves only to mark this directory as a Bazel package. | ||
|
||
**dash.bzl** | ||
|
||
- Contains the dash_license_checker macro, which defines a `java_binary` target to run the DASH license checker. | ||
- Loads `dash_format_converter.bzl` from the `formatters` package to preprocess requirement files. | ||
- Converts the input `requirements_lock.txt` file into a format compatible with the DASH license tool before invoking the Java-based checker. | ||
|
||
**formatters/BUILD** | ||
|
||
- Empty file indicating that formatters is a Bazel package. | ||
|
||
**formatters/dash_format_converter.bzl** | ||
|
||
- Defines a custom Bazel rule `dash_format_converter`. | ||
- Calls `dash_format_converter.py` to transform `requirements_lock.txt` into a format that the DASH tool can process. | ||
|
||
**formatters/dash_format_converter.py** | ||
|
||
- Implements the logic to convert `requirements_lock.`txt into a format accepted by the DASH license checker. | ||
- This script is executed as part of the `dash_format_converter` Bazel rule. | ||
|
||
## Usage | ||
|
||
To integrate the DASH license checker into your Bazel project, define a target in your `BUILD` file as follows: | ||
|
||
```bash | ||
load("//tools/dash:dash.bzl", "dash_license_checker") | ||
|
||
dash_license_checker( | ||
name = "my_project_license_check", | ||
src = "//path/to/requirements_lock.txt", | ||
visibility = ["//visibility:public"], | ||
) | ||
``` | ||
|
||
This will: | ||
|
||
1. Use dash_format_converter to process requirements_lock.txt. | ||
2. Create a java_binary target that executes the DASH license checker with the converted file. | ||
3. Ensure compliance with dependency licensing requirements in your project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters