Class BuildModeOf

java.lang.Object
org.ek9lang.compiler.BuildModeOf
All Implemented Interfaces:
Function<CompilerFlags, BuildMode>

public final class BuildModeOf extends Object implements Function<CompilerFlags, BuildMode>
THE rule mapping a build's CompilerFlags to the BuildMode folder its output belongs in (plan docs/implementation/EK9_P1_I1_PLAN.md ยง2.2). In order:
  1. coverage or profiling enabled -> BuildMode.TEST (the -t family, and the test gate applied by packaging/install/install-check);
  2. optimisation level O3 -> BuildMode.RELEASE (-O3; packaging builds through its test gate, the row above);
  3. debugging instrumentation, or O0 -> BuildMode.DEBUG (-cg, -cd, -Cg, -Cd, -cdh, -Cdh, -O0, -d port, the IDE's and debugger's debug jars);
  4. otherwise -> BuildMode.NORMAL (-c, -C, -ch, -Ch, running a program).
Never a static method; hold one instance.