Skip to content

Commit

Permalink
Add --compilation_mode support in transitions
Browse files Browse the repository at this point in the history
Add support for converting //command_line_option:compilation_mode from
Java value to Starlark value so that it can be read in a transition.

Fixes --compilation_mode in #10690, but not the general case.
  • Loading branch information
moroten committed May 10, 2020
1 parent f17c403 commit c101423
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
// limitations under the License.
package com.google.devtools.build.lib.analysis.config;

import com.google.devtools.build.lib.syntax.Printer;
import com.google.devtools.build.lib.syntax.StarlarkValue;
import com.google.devtools.common.options.EnumConverter;

/**
* This class represents the debug/optimization mode the binaries will be
* built for.
*/
public enum CompilationMode {
public enum CompilationMode implements StarlarkValue {

// Fast build mode (-g0).
FASTBUILD("fastbuild"),
Expand Down Expand Up @@ -47,4 +49,9 @@ public Converter() {
super(CompilationMode.class, "compilation mode");
}
}

@Override
public void repr(Printer printer) {
printer.append(toString());
}
}

0 comments on commit c101423

Please sign in to comment.