mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Signed-off-by: Austin Schuh <austin.linux@gmail.com> Co-authored-by: PJ Reiniger <pj.reiniger@gmail.com> Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
27 lines
1.1 KiB
Python
27 lines
1.1 KiB
Python
# Copyright (c) FIRST and other WPILib contributors.
|
|
# Open Source Software; you can modify and/or share it under the terms of
|
|
# the WPILib BSD license file in the root directory of this project.
|
|
|
|
"""Bazel rule definition for publishing maven artifacts."""
|
|
|
|
def _publishing_repo_impl(repository_ctx):
|
|
"""Implementation of the publishing_repo rule."""
|
|
classifier_filter = repository_ctx.os.environ.get("WPI_PUBLISH_CLASSIFIER_FILTER", "")
|
|
|
|
content = """# Generated by publishing_repo rule. DO NOT EDIT.
|
|
|
|
CLASSIFIER_FILTER = "{classifier_filter}"
|
|
""".format(
|
|
classifier_filter = classifier_filter,
|
|
)
|
|
repository_ctx.file("publishing_config.bzl", content)
|
|
repository_ctx.file("BUILD.bazel", content = "# Generated file")
|
|
|
|
publishing_repo = repository_rule(
|
|
implementation = _publishing_repo_impl,
|
|
environ = ["WPI_PUBLISH_CLASSIFIER_FILTER"],
|
|
doc = "Repository rule to determine host OS and classifier filter for publishing. " +
|
|
"This rule must be instantiated in the WORKSPACE file with the name " +
|
|
"'com_wpilib_allwpilib_publishing_config'.",
|
|
)
|