diff --git a/README.md b/README.md index 8c10303ae..e35ca409c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ This project defines core build rules for [Scala](https://www.scala-lang.org/) t - [scala_library](./docs/scala_library.md) - [scala_macro_library](./docs/scala_macro_library.md) +- [scala_inlined_library](./docs/scala_inlined_library.md) - [scala_binary](./docs/scala_binary.md) - [scala_test](./docs/scala_test.md) - [scala_repl](./docs/scala_repl.md) diff --git a/docs/customizable_phase.md b/docs/customizable_phase.md index ee9233f53..17e937935 100644 --- a/docs/customizable_phase.md +++ b/docs/customizable_phase.md @@ -146,6 +146,7 @@ Currently phase architecture is used by 7 rules: - scala_library - scala_macro_library +- scala_inlined_library - scala_library_for_plugin_bootstrapping - scala_binary - scala_test diff --git a/docs/scala_inline_library.md b/docs/scala_inline_library.md new file mode 100644 index 000000000..56267b4ff --- /dev/null +++ b/docs/scala_inline_library.md @@ -0,0 +1,177 @@ +# scala_inlined_library + +```py +scala_inlined_library( + name, + srcs, + deps, + runtime_deps, + exports, + data, + main_class, + resources, + resource_strip_prefix, + scalacopts, + jvm_flags, + scalac_jvm_flags, + javac_jvm_flags, + unused_dependency_checker_mode +) +``` + +`scala_inlined_library` generates a `.jar` file from `.scala` source files. This rule +has the interface jar (`ijar`) functionality disabled. +This is to enable inlining the compiled code, when it is given as a dependency for another Scala target (`ijar` +does not contain an implementation, so it cannot be used for inlining). + +In order to have a Java rule use this jar file, use the `java_import` rule. + +
Attributes | +|
---|---|
name |
+
+
A unique name for this target + |
+ srcs |
+
+
List of Scala |
+
+
deps |
+
+
List of other libraries to linked to this library target. + These must be jvm targets (scala_library, java_library, java_import, etc...) + |
+
runtime_deps |
+
+
List of other libraries to put on the classpath only at runtime. This is rarely needed in Scala. + These must be jvm targets (scala_library, java_library, java_import, etc...) + |
+
exports |
+
+
List of targets to add to the dependencies of those that depend on this target. Similar + to the `java_library` parameter of the same name. Use this sparingly as it weakens the + precision of the build graph. + These must be jvm targets (scala_library, java_library, java_import, etc...) + |
+
data |
+
+
List of files needed by this rule at runtime. + |
+
main_class |
+
+
Name of class with main() method to use as an entry point +
+ The value of this attribute is a class name, not a source file. The
+ class must be available at runtime: it may be compiled by this rule
+ (from |
+
resources |
+
+
A list of data files to be included in the JAR. + |
+
resource_strip_prefix |
+
+
+ The path prefix to strip from Java resources. If specified, + this path prefix is stripped from every file in the `resources` attribute. + It is an error for a resource file not to be under this directory. + + |
+
scalacopts |
+
+
+ Extra compiler options for this library to be passed to scalac. Subject to + Make variable + substitution and + Bourne shell tokenization. + + |
+
jvm_flags |
+
+
+ Deprecated, superseded by scalac_jvm_flags and javac_jvm_flags. Is not used and is kept as backwards compatibility for the near future. Effectively jvm_flags is now an executable target attribute only. + + |
+
scalac_jvm_flags |
+
+
+ List of JVM flags to be passed to scalac after the
+ |
+
javac_jvm_flags |
+
+
+ List of JVM flags to be passed to javac after the
+ |
+
unused_dependency_checker_mode |
+
+
+ Enable unused dependency checking (see Unused dependency checking).
+ Possible values are: |
+