Java Code Examples for com.google.devtools.build.lib.syntax.Printer#append()

The following examples show how to use com.google.devtools.build.lib.syntax.Printer#append() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StructImpl.java    From bazel with Apache License 2.0 6 votes vote down vote up
/**
 * Convert the object to string using Starlark syntax. The output tries to be reversible (but
 * there is no guarantee, it depends on the actual values).
 */
@Override
public void repr(Printer printer) {
  boolean first = true;
  printer.append("struct(");
  // Sort by key to ensure deterministic output.
  for (String fieldName : Ordering.natural().sortedCopy(getFieldNames())) {
    if (!first) {
      printer.append(", ");
    }
    first = false;
    printer.append(fieldName);
    printer.append(" = ");
    printer.repr(getValueOrNull(fieldName));
  }
  printer.append(")");
}
 
Example 2
Source File: CcLinkingContext.java    From bazel with Apache License 2.0 5 votes vote down vote up
@Override
public void debugPrint(Printer printer) {
  printer.append("<CcLinkingContext([");
  for (LinkerInput linkerInput : linkerInputs.toList()) {
    linkerInput.debugPrint(printer);
    printer.append(", ");
  }
  printer.append("])>");
}
 
Example 3
Source File: Args.java    From bazel with Apache License 2.0 5 votes vote down vote up
@Override
public void debugPrint(Printer printer) {
  try {
    printer.append(Joiner.on(" ").join(build().arguments()));
  } catch (CommandLineExpansionException e) {
    printer.append("Cannot expand command line: " + e.getMessage());
  }
}
 
Example 4
Source File: ConstraintSettingInfo.java    From bazel with Apache License 2.0 5 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.format("ConstraintSettingInfo(%s", label.toString());
  if (defaultConstraintValueLabel != null) {
    printer.format(", default_constraint_value=%s", defaultConstraintValueLabel.toString());
  }
  printer.append(")");
}
 
Example 5
Source File: StarlarkAttrModule.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append("<attr>");
}
 
Example 6
Source File: CheckoutPath.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(path.toString());
}
 
Example 7
Source File: ConfigFeatureFlagProvider.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append("<function FeatureFlagInfo>");
}
 
Example 8
Source File: AbandonInput.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(toString());
}
 
Example 9
Source File: FeatureConfigurationForStarlark.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public void debugPrint(Printer printer) {
  printer.append("<FeatureConfiguration(");
  printer.append(Joiner.on(", ").join(featureConfiguration.getEnabledFeatureNames()));
  printer.append(")>");
}
 
Example 10
Source File: CommitInfo.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(toString());
}
 
Example 11
Source File: ChangeMessageInfo.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(toString());
}
 
Example 12
Source File: AnalysisFailure.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append("<AnalyisFailure object>");
}
 
Example 13
Source File: StarlarkProvider.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append("<provider>");
}
 
Example 14
Source File: Endpoint.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
default void repr(Printer printer) {
  printer.append(toString());
}
 
Example 15
Source File: License.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(this.toString());
}
 
Example 16
Source File: AbstractConfiguredTarget.java    From bazel with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append("<unknown target " + getLabel() + ">");
}
 
Example 17
Source File: ChangeInfo.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(toString());
}
 
Example 18
Source File: AccountInfo.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(toString());
}
 
Example 19
Source File: LatestVersionSelector.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(toString());
}
 
Example 20
Source File: ActionResult.java    From copybara with Apache License 2.0 4 votes vote down vote up
@Override
public void repr(Printer printer) {
  printer.append(toString());
}