private static Map<ModuleBuildTarget, String> getStubGenerationOutputs(
     ModuleChunk chunk, CompileContext context) throws IOException {
   Map<ModuleBuildTarget, String> generationOutputs = new HashMap<ModuleBuildTarget, String>();
   File commonRoot = getStubRoot(context);
   for (ModuleBuildTarget target : chunk.getTargets()) {
     File targetRoot =
         new File(
             commonRoot,
             target.getModule().getName() + File.separator + target.getTargetType().getTypeId());
     if (targetRoot.exists() && !FileUtil.deleteWithRenaming(targetRoot)) {
       throw new IOException("External make cannot clean " + targetRoot.getPath());
     }
     if (!targetRoot.mkdirs()) {
       throw new IOException("External make cannot create " + targetRoot.getPath());
     }
     generationOutputs.put(target, targetRoot.getPath());
   }
   return generationOutputs;
 }