code: private boolean setDefine(CompilerOptions options,
        String key, Object value) {
      boolean success = false;
  
      if (value instanceof String) {
        final boolean isTrue = "true".equals(value);
        final boolean isFalse = "false".equals(value);
  
        if (isTrue || isFalse) {
          options.setDefineToBooleanLiteral(key, isTrue);
        } else {
          try {
            double dblTemp = Double.parseDouble((String) value);
            options.setDefineToDoubleLiteral(key, dblTemp);
          } catch (NumberFormatException nfe) {
            // Not a number, assume string
            options.setDefineToStringLiteral(key, (String) value);
          }
        }
  
        success = true;
      } else if (value instanceof Boolean) {
        options.setDefineToBooleanLiteral(key, (Boolean) value);
        success = true;
      } else if (value instanceof Integer) {
        options.setDefineToNumberLiteral(key, (Integer) value);
        success = true;
      } else if (value instanceof Double) {
        options.setDefineToDoubleLiteral(key, (Double) value);
        success = true;
      }
  
      return success;
    }
docs: Maps Ant-style values (e.g., from Properties) into expected
  Closure {@code @define} literals
  
  @return True if the {@code @define} replacement succeeded, false if
  the variable's value could not be mapped properly.