public static void generateCompileTimeGlobalsFile(
      Map<String, ?> compileTimeGlobalsMap, Appendable output) throws IOException {

    Map<String, PrimitiveData> compileTimeGlobals =
        InternalValueUtils.convertCompileTimeGlobalsMap(compileTimeGlobalsMap);

    for (Map.Entry<String, PrimitiveData> entry : compileTimeGlobals.entrySet()) {
      String valueSrcStr =
          InternalValueUtils.convertPrimitiveDataToExpr(entry.getValue(), SourceLocation.UNKNOWN)
              .toSourceString();
      output.append(entry.getKey()).append(" = ").append(valueSrcStr).append("\n");
    }
  }
public static void generateCompileTimeGlobalsFile ( Map < String , ? > compileTimeGlobalsMap , Appendable output ) throws IOException { Map < String , PrimitiveData > compileTimeGlobals = InternalValueUtils . convertCompileTimeGlobalsMap ( compileTimeGlobalsMap ) ; for ( Map . Entry < String , PrimitiveData > entry : compileTimeGlobals . entrySet ( ) ) { String valueSrcStr = InternalValueUtils . convertPrimitiveDataToExpr ( entry . getValue ( ) , SourceLocation . UNKNOWN ) . toSourceString ( ) ; output . append ( entry . getKey ( ) ) . append ( " = " ) . append ( valueSrcStr ) . append ( "\n" ) ; } }
Generates the text for a compile-time globals file in the format expected by the Soy compiler
and appends the generated text to the given {@code Appendable}.

<p>The generated lines will follow the iteration order of the provided map.

<p>Important: When you write the output to a file, be sure to use UTF-8 encoding.

@param compileTimeGlobalsMap Map from compile-time global name to value. The values can be any
of the Soy primitive types: null, boolean, integer, float (Java double), or string.
@param output The object to append the generated text to.
@throws IllegalArgumentException If one of the values is not a valid Soy primitive type.
@throws IOException If there is an error appending to the given {@code Appendable}.