Java compile rules for rules_elide.
elide_java_library / _binary / _test drive elide javac to compile
.java sources. Every rule returns JavaInfo (with an ijar-derived
compile_jar and a packed source_jar) so downstream java_* / kt_*
rules consume the outputs without any adapter, plus ElideInfo for
Elide-specific metadata propagation.
load("@rules_elide//elide/rules:java.bzl", "elide_java_binary")
elide_java_binary(name, deps, srcs, data, resources, exported_compiler_plugins, exports, javac_opts,
jvm_flags, main_class, neverlink, plugins, resource_jars, resource_strip_prefix,
runtime_deps)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Compile-time dependencies. Targets must provide JavaInfo. | List of labels | optional | [] |
| srcs | Java source files to compile. | List of labels | optional | [] |
| data | Files made available to this target's runfiles at action time. | List of labels | optional | [] |
| resources | Resource files packaged into the output JAR alongside compiled classes. | List of labels | optional | [] |
| exported_compiler_plugins | Compiler plugins propagated to direct rdeps via ElideInfo (mirrors java_plugin.exported_plugins). | List of labels | optional | [] |
| exports | Targets re-exported to direct rdeps (transitive compile classpath). | List of labels | optional | [] |
| javac_opts | Flags appended to the elide javac -- invocation. |
List of strings | optional | [] |
| jvm_flags | Flags passed to the JVM when running the binary. | List of strings | optional | [] |
| main_class | Fully qualified main class. | String | required | |
| neverlink | If true, outputs are used only for compilation, not packaged into binaries. | Boolean | optional | False |
| plugins | Compiler plugins for this compilation (only). Targets must provide JavaInfo. | List of labels | optional | [] |
| resource_jars | Pre-built JARs whose contents are merged into the output JAR. | List of labels | optional | [] |
| resource_strip_prefix | Workspace-root-relative path prefix stripped from each resources entry when computing its in-JAR location (mirrors java_library.resource_strip_prefix). Empty -> use the full short_path. |
String | optional | "" |
| runtime_deps | Runtime-only dependencies (excluded from compile classpath). | List of labels | optional | [] |
load("@rules_elide//elide/rules:java.bzl", "elide_java_library")
elide_java_library(name, deps, srcs, data, resources, exported_compiler_plugins, exports,
javac_opts, neverlink, plugins, resource_jars, resource_strip_prefix, runtime_deps)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Compile-time dependencies. Targets must provide JavaInfo. | List of labels | optional | [] |
| srcs | Java source files to compile. | List of labels | optional | [] |
| data | Files made available to this target's runfiles at action time. | List of labels | optional | [] |
| resources | Resource files packaged into the output JAR alongside compiled classes. | List of labels | optional | [] |
| exported_compiler_plugins | Compiler plugins propagated to direct rdeps via ElideInfo (mirrors java_plugin.exported_plugins). | List of labels | optional | [] |
| exports | Targets re-exported to direct rdeps (transitive compile classpath). | List of labels | optional | [] |
| javac_opts | Flags appended to the elide javac -- invocation. |
List of strings | optional | [] |
| neverlink | If true, outputs are used only for compilation, not packaged into binaries. | Boolean | optional | False |
| plugins | Compiler plugins for this compilation (only). Targets must provide JavaInfo. | List of labels | optional | [] |
| resource_jars | Pre-built JARs whose contents are merged into the output JAR. | List of labels | optional | [] |
| resource_strip_prefix | Workspace-root-relative path prefix stripped from each resources entry when computing its in-JAR location (mirrors java_library.resource_strip_prefix). Empty -> use the full short_path. |
String | optional | "" |
| runtime_deps | Runtime-only dependencies (excluded from compile classpath). | List of labels | optional | [] |
load("@rules_elide//elide/rules:java.bzl", "elide_java_test")
elide_java_test(name, deps, srcs, data, resources, exported_compiler_plugins, exports, javac_opts,
jvm_flags, neverlink, plugins, resource_jars, resource_strip_prefix, runtime_deps,
test_class)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Compile-time dependencies. Targets must provide JavaInfo. | List of labels | optional | [] |
| srcs | Java source files to compile. | List of labels | optional | [] |
| data | Files made available to this target's runfiles at action time. | List of labels | optional | [] |
| resources | Resource files packaged into the output JAR alongside compiled classes. | List of labels | optional | [] |
| exported_compiler_plugins | Compiler plugins propagated to direct rdeps via ElideInfo (mirrors java_plugin.exported_plugins). | List of labels | optional | [] |
| exports | Targets re-exported to direct rdeps (transitive compile classpath). | List of labels | optional | [] |
| javac_opts | Flags appended to the elide javac -- invocation. |
List of strings | optional | [] |
| jvm_flags | Flags passed to the JVM when running the test. | List of strings | optional | [] |
| neverlink | If true, outputs are used only for compilation, not packaged into binaries. | Boolean | optional | False |
| plugins | Compiler plugins for this compilation (only). Targets must provide JavaInfo. | List of labels | optional | [] |
| resource_jars | Pre-built JARs whose contents are merged into the output JAR. | List of labels | optional | [] |
| resource_strip_prefix | Workspace-root-relative path prefix stripped from each resources entry when computing its in-JAR location (mirrors java_library.resource_strip_prefix). Empty -> use the full short_path. |
String | optional | "" |
| runtime_deps | Runtime-only dependencies (excluded from compile classpath). | List of labels | optional | [] |
| test_class | Single JUnit Platform test class to select. Empty -> --scan-classpath. | String | optional | "" |