woproject/projects/woenvironment/src/java/org/objectstyle/woenvironment/pb XcodeProjProject.java,1.5,1.6 PBXProject.java,1.3,1.4

[email protected] Fri, 24 Mar 2006 17:15:18 -0800 (PST)
Newsgroups gmane.comp.web.webobjects.woproject.cvs
Message-ID <[email protected]>
Update of /cvsroot/woproject/woproject/projects/woenvironment/src/java/org/objectstyle/woenvironment/pb
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31853/woenvironment/src/java/org/objectstyle/woenvironment/pb

Modified Files:
	XcodeProjProject.java PBXProject.java 
Log Message:
Make the generation for *.xcodeproj to use ant build.xml (when available) so that XCode (2.1 and up ) projects can be used out of the box for building

Index: XcodeProjProject.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/woenvironment/src/java/org/objectstyle/woenvironment/pb/XcodeProjProject.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- XcodeProjProject.java	29 Sep 2005 01:06:38 -0000	1.5
+++ XcodeProjProject.java	25 Mar 2006 01:14:19 -0000	1.6
@@ -61,6 +61,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.objectstyle.woenvironment.pb.PBXProject.ObjectsTable;
 import org.objectstyle.woenvironment.pb.PBXProject.ObjectsTable.ID;
 
 /**
@@ -101,42 +102,37 @@
   }
 
   protected Map newAppServerTarget(List _buildPhaseIDs, ObjectsTable _objectsTable) {
-    Map result = super.newAppServerTarget(_buildPhaseIDs, _objectsTable);
+    Map result = map( new Object[] {
+			"isa",				"PBXLegacyTarget",
+			"buildArgumentsString", "-emacs $(ACTION)",
+			"buildSettings",	new HashMap(),
+			"buildToolPath", "/Developer/Java/Ant/bin/ant",
+			"passBuildSettingsInEnvironment", "1",
+			"name",				"Ant",
+			"buildPhases",		_buildPhaseIDs });
     List buildConfigurations = new LinkedList();
-    buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(map(new Object[] { "COPY_PHASE_STRIP", "NO" }), "Development")));
-    buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(map(new Object[] { "COPY_PHASE_STRIP", "YES" }), "Deployment")));
+    buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(map(new Object[] { "COPY_PHASE_STRIP", "NO" }), "Debug")));
+    buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(map(new Object[] { "COPY_PHASE_STRIP", "YES" }), "Release")));
     buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(new HashMap(), "Default")));
     result.put("buildConfigurationList", _objectsTable.insert(newBuildConfigurationList(buildConfigurations, false, "Default")));
-    result.put("productName", "Application Server");
+    result.put("productName", "Ant");
     return result;
   }
 
-  protected Map newSourcesBuildPhase(List _buildFileIDs) {
-    return map(new Object[] { "isa", "PBXSourcesBuildPhase", "files", _buildFileIDs, "buildActionMask", "2147483647", "runOnlyForDeploymentPostprocessing", "0" });
-  }
-
-  protected Map newResourcesBuildPhase(List _buildFileIDs) {
-    return map(new Object[] { "isa", "PBXResourcesBuildPhase", "files", _buildFileIDs, "buildActionMask", "2147483647", "runOnlyForDeploymentPostprocessing", "0" });
-  }
-
-  protected Map newFrameworkBuildPhase(List _buildFileIDs) {
-    return map(new Object[] { "isa", "PBXFrameworksBuildPhase", "files", _buildFileIDs, "buildActionMask", "2147483647", "runOnlyForDeploymentPostprocessing", "0" });
-  }
-
   protected Map newProject(ID _groupID, List _targetIDs, ObjectsTable _objectsTable) {
     Map project = super.newProject(_groupID, _targetIDs, _objectsTable);
 
     List buildConfigurations = new LinkedList();
-    buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(new HashMap(), "Development")));
-    buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(new HashMap(), "Deployment")));
+    buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(new HashMap(), "Debug")));
+    buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(new HashMap(), "Release")));
     buildConfigurations.add(_objectsTable.insert(newBuildConfiguration(new HashMap(), "Default")));
     project.put("buildConfigurationList", _objectsTable.insert(newBuildConfigurationList(buildConfigurations, false, "Default")));
 
     project.put("buildSettings", new HashMap());
 
     List buildStyles = new LinkedList();
-    buildStyles.add(_objectsTable.insert(newBuildStyle(map(new Object[] { "COPY_PHASE_STRIP", "NO" }), "Development")));
-    buildStyles.add(_objectsTable.insert(newBuildStyle(map(new Object[] { "COPY_PHASE_STRIP", "YES" }), "Deployment")));
+    buildStyles.add(_objectsTable.insert(newBuildStyle(map(new Object[] { "COPY_PHASE_STRIP", "NO" }), "Debug")));
+    buildStyles.add(_objectsTable.insert(newBuildStyle(map(new Object[] { "COPY_PHASE_STRIP", "YES" }), "Release")));
     project.put("buildStyles", buildStyles);
 
     return project;
@@ -162,4 +158,9 @@
   protected Map newPBXProj(Map objectsTable, ObjectsTable.ID rootObject) {
     return map(new Object[] { "archiveVersion", "1", "classes", new HashMap(), "objectVersion", "42", "rootObject", rootObject, "objects", objectsTable });
   }
+  
+  protected boolean hasBuildPhases() {
+	  return false;
+  }
+  
 }
\ No newline at end of file

Index: PBXProject.java
===================================================================
RCS file: /cvsroot/woproject/woproject/projects/woenvironment/src/java/org/objectstyle/woenvironment/pb/PBXProject.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- PBXProject.java	18 Sep 2005 17:27:00 -0000	1.3
+++ PBXProject.java	25 Mar 2006 01:14:19 -0000	1.4
@@ -179,9 +179,11 @@
 		
 		//	Create the PBXBuildPhase and add it to the objects table.
 		ArrayList buildPhaseIDs = new ArrayList( 1 );
-		buildPhaseIDs.add( objectsTable.insert( newSourcesBuildPhase( sourceBuildFileIDs)));
-		buildPhaseIDs.add( objectsTable.insert( newResourcesBuildPhase( resourceBuildFileIDs)));
-		buildPhaseIDs.add( objectsTable.insert( newFrameworkBuildPhase( frameworkBuildFileIDs)));
+		if (hasBuildPhases()) {
+			buildPhaseIDs.add( objectsTable.insert( newSourcesBuildPhase( sourceBuildFileIDs)));
+			buildPhaseIDs.add( objectsTable.insert( newResourcesBuildPhase( resourceBuildFileIDs)));
+			buildPhaseIDs.add( objectsTable.insert( newFrameworkBuildPhase( frameworkBuildFileIDs)));
+		}
 		
 		//	Create the PBXToolTarget and add it to the objects table and
 		//	the targets list.
@@ -294,6 +296,10 @@
 			"objects",			objectsTable });
 	}
 	
+	protected boolean hasBuildPhases() {
+		return true;
+	}
+	
 	protected static class ObjectsTable extends TreeMap {
 		public static class ID extends Number {
 			int _value;



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642