Skip to main content
Glama
jar_genrule.bzl1.29 kB
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under both the MIT license found in the # LICENSE-MIT file in the root directory of this source tree and the Apache # License, Version 2.0 found in the LICENSE-APACHE file in the root directory # of this source tree. load("@prelude//:genrule.bzl", "process_genrule") load("@prelude//java:java_toolchain.bzl", "JavaToolchainInfo") load("@prelude//utils:expect.bzl", "expect") def jar_genrule_impl(ctx: AnalysisContext) -> list[Provider]: output_name = "{}.jar".format(ctx.label.name) providers = process_genrule(ctx, output_name, None) expect( len(providers) == 1, "expected exactly one provider of type DefaultInfo from {} ({})" .format(ctx.label.name, providers), ) default_info = providers[0] # DefaultInfo type outputs = default_info.default_outputs expect( len(outputs) == 1, "expected exactly one output from {} ({})" .format(ctx.label.name, outputs), ) output_jar = outputs[0] java_toolchain = ctx.attrs._java_toolchain[JavaToolchainInfo] java_cmd = cmd_args(java_toolchain.java[RunInfo]) java_cmd.add("-jar", output_jar) providers.append(RunInfo(args = java_cmd)) return providers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server