src/com/facebook/buck/features/apple/projectV2/ProjectGenerator.java
/** Create the project bundle structure and write {@code project.pbxproj}. */
Create the project bundle structure and write  project.pbxproj.
Create the project bundle structure and write project . pbxproj .
private void writeProjectFile() throws IOException {
    PBXProject project = xcodeProjectWriteOptions.project();
    XcodeprojSerializer serializer = new XcodeprojSerializer(gidGenerator, project);
    NSDictionary rootObject = serializer.toPlist();
    projectFilesystem.mkdirs(xcodeProjectWriteOptions.xcodeProjPath());
    Path serializedProject = xcodeProjectWriteOptions.projectFilePath();
    String contentsToWrite = rootObject.toXMLPropertyList();
    if (MoreProjectFilesystems.fileContentsDiffer(
        new ByteArrayInputStream(contentsToWrite.getBytes(Charsets.UTF_8)),
        serializedProject,
        projectFilesystem)) {
      LOG.debug("Regenerating project at %s", serializedProject);
      if (options.shouldGenerateReadOnlyFiles()) {
        projectFilesystem.writeContentsToPath(
            contentsToWrite, serializedProject, ProjectGenerator.READ_ONLY_FILE_ATTRIBUTE);
      } else {
        projectFilesystem.writeContentsToPath(contentsToWrite, serializedProject);
      }
    } else {
      LOG.debug("Not regenerating project at %s (contents have not changed)", serializedProject);
    }
  }
private void writeProjectFile ( ) throws IOException { PBXProject project = xcodeProjectWriteOptions . project ( ) ; XcodeprojSerializer serializer = new XcodeprojSerializer ( gidGenerator , project ) ; NSDictionary rootObject = serializer . toPlist ( ) ; projectFilesystem . mkdirs ( xcodeProjectWriteOptions . xcodeProjPath ( ) ) ; Path serializedProject = xcodeProjectWriteOptions . projectFilePath ( ) ; String contentsToWrite = rootObject . toXMLPropertyList ( ) ; if ( MoreProjectFilesystems . fileContentsDiffer ( new ByteArrayInputStream ( contentsToWrite . getBytes ( Charsets . UTF_8 ) ) , serializedProject , projectFilesystem ) ) { LOG . debug ( "Regenerating project at %s" , serializedProject ) ; if ( options . shouldGenerateReadOnlyFiles ( ) ) { projectFilesystem . writeContentsToPath ( contentsToWrite , serializedProject , ProjectGenerator . READ_ONLY_FILE_ATTRIBUTE ) ; } else { projectFilesystem . writeContentsToPath ( contentsToWrite , serializedProject ) ; } } else { LOG . debug ( "Not regenerating project at %s (contents have not changed)" , serializedProject ) ; } }
Create the project bundle structure and write {@code project.pbxproj}.
Create the project bundle structure and write { @code project . pbxproj } .
// Before we write any files, check if the file contents have changed.