rules_scala
rules_scala copied to clipboard
Automatically detect main methods
This issue is part of a broader proposal to merge some of the features in lucidsoftware/rules_scala into this ruleset.
The tracking issue for this effort
The relevant proposal section.
If we compiled with Zinc, we could make the main_class attribute on scala_binary optional. From the proposal:
Zinc’s analysis file contains a list of "main classes"—classes and objects identified as candidates for a main class (i.e. the class containing the
mainmethod). In our non-bootstrapped compilation worker, we access that list and write it to a file. If a main class hasn’t been manually set, we read the previously mentioned file, select one, and use that.
Doing something similar in bazelbuild/rules_scala could make scala_binary targets easier to declare.