private void generateConfigFiles() {
    Filer filer = processingEnv.getFiler();

    for (String providerInterface : providers.keySet()) {
      String resourceFile = "META-INF/services/" + providerInterface;
      log("Working on resource file: " + resourceFile);
      try {
        SortedSet<String> newServices = providers.get(providerInterface);

        log("New service file contents: " + newServices);
        FileObject fileObject =
            filer.createResource(StandardLocation.CLASS_OUTPUT, "", resourceFile);
        try (OutputStream out = fileObject.openOutputStream()) {
          ServicesFiles.writeServiceFile(newServices, out);
        }
        log("Wrote to: " + resourceFile);
      } catch (IOException e) {
        fatalError("Unable to create " + resourceFile + ", " + getStackTraceAsString(e));
        return;
      }
    }
  }
<ol>
  <li>For each class annotated with {@link AutoService}
      <ul>
        <li>Verify the {@link AutoService} interface value is correct
        <li>Categorize the class by its service interface
      </ul>
  <li>For each {@link AutoService} interface
      <ul>
        <li>Create a file named {@code META-INF/services/<interface>}
        <li>For each {@link AutoService} annotated class for this interface
            <ul>
              <li>Create an entry in the file
            </ul>
      </ul>
</ol>
service/processor/src/main/java/com/google/auto/service/processor/AutoServiceProcessor.java