code: private void preprocess(File input, File output) throws Exception {
          if (input == null)
              throw new BuildException("Input not specified");
          if (output == null)
              throw new BuildException("Output not specified");
  
          Preprocessor cpp = new Preprocessor();
          cpp.setListener(listener);
          for (Macro macro : macros)
              cpp.addMacro(macro.getName(), macro.getValue());
          if (systemincludepath != null)
              cpp.setSystemIncludePath(Arrays.asList(systemincludepath.list()));
          if (localincludepath != null)
              cpp.setQuoteIncludePath(Arrays.asList(localincludepath.list()));
  
          File dir = output.getParentFile();
          if (!dir.exists()) {
              if (!dir.mkdirs())
                  throw new BuildException("Failed to make parent directory " + dir);
          } else if (!dir.isDirectory()) {
              throw new BuildException("Parent directory of output file " + output + " exists, but is not a directory.");
          }
          FileWriter writer = null;
          try {
              cpp.addInput(input);
              writer = new FileWriter(output);
              for (;;) {
                  Token tok = cpp.token();
                  if (tok == null)
                      break;
                  if (tok.getType() == Token.EOF)
                      break;
                  writer.write(tok.getText());
              }
          } finally {
              if (writer != null) {
                  try {
                      writer.close();
                  } catch (IOException e) {
                  }
              }
          }
      }
docs: /*
  public void execute() {
  FileWriter writer = null;
  try {
  if (input == null)
  throw new BuildException("Input not specified");
  if (output == null)
  throw new BuildException("Output not specified");
  cpp.addInput(this.input);
  writer = new FileWriter(this.output);
  for (;;) {
  Token	tok = cpp.token();
  if (tok != null && tok.getType() == Token.EOF)
  break;
  writer.write(tok.getText());
  }
  }
  catch (Exception e) {
  throw new BuildException(e);
  }
  finally {
  if (writer != null) {
  try {
  writer.close();
  }
  catch (IOException e) {
  }
  }
  }
  }