vaticle / bazel-distribution

Bazel rules for assembling and deploying software distributions (see @vaticle for usage example)
https://bazel.build
Apache License 2.0
155 stars 53 forks source link

Update Maven rules to support platform profiles and Windows deployment #384

Closed dmitrii-ubskii closed 10 months ago

dmitrii-ubskii commented 10 months ago

What is the goal of this PR?

We update deployment and assembly rules to be invokable on Windows, and to support per-platform profiles in pom.xml.

Per-platform overrides expects a dict of bazel labels to a JSON-encoded dictionary of platform to maven coordinates. Supported OS: windows, linux, mac Supported architectures: x86_64, aarch64 Ex.:

assemble_maven(
    ...
    profile_overrides = {
        ":bazel-dependency": json.encode({
            "windows-x86_64": "org.company:dependency-windows-x86_64:{pom_version}",
            "linux-aarch64": "org.company:dependency-linux-aarch64:{pom_version}",
            "linux-x86_64": "org.company:dependency-linux-x86_64:{pom_version}",
            "mac-aarch64": "org.company:dependency-macosx-aarch64:{pom_version}",
            "mac-x86_64": "org.company:dependency-macosx-x86_64:{pom_version}",
        })
    }
)

What are the changes implemented in this PR?

vaticle-bot commented 10 months ago

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

Code

Architecture