Author: matt
Date: 2011-08-06 23:44:38 -0700 (Sat, 06 Aug 2011)
New Revision: 8924
Log:
Fluid3: filling in more Xcode4 pieces

Modified:
   branches/branch-3.0/fltk.flw
   branches/branch-3.0/fluid/Fl_Type.h
   branches/branch-3.0/fluid/file_xcode.cxx
   branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj
   branches/branch-3.0/ide/templates/Xcode4.tmpl

Modified: branches/branch-3.0/fltk.flw
===================================================================
--- branches/branch-3.0/fltk.flw        2011-08-06 22:21:35 UTC (rev 8923)
+++ branches/branch-3.0/fltk.flw        2011-08-07 06:44:38 UTC (rev 8924)
@@ -5,7 +5,9 @@
 wks_name FLTK
 folder Applications {open
 } {
-  app_target Fluid {} {
+  app_target Fluid {
+    uuid_Xcode4_ProductReference {FD9750B2-CA9C-4856-A516-E56BD9B2E805}
+  } {
     folder Headers {open
     } {
       file_ref {CodeEditor.h} {
@@ -209,6 +211,8 @@
     uuid_Xcode4_ResourcesBuildPhase {1DAA0C25-90AF-445C-A814-DB4C66428D29}
     uuid_Xcode4_HeadersBuildPhase {0A872A2E-9DB3-42CD-A238-D38635FEFE8E}
     uuid_Xcode4_FluidBuildRule {21280AFA-1D23-477C-9F1C-641693104B3F}
+    uuid_Xcode4_SourcesBuildPhase {ABBF042C-9682-43C8-A51D-9D39F354B9DB}
+    uuid_Xcode4_ProductReference {FEB0F8FE-0000-6383-0000-384180570D94}
   } {
     folder Headers {open
     } {

Modified: branches/branch-3.0/fluid/Fl_Type.h
===================================================================
--- branches/branch-3.0/fluid/Fl_Type.h 2011-08-06 22:21:35 UTC (rev 8923)
+++ branches/branch-3.0/fluid/Fl_Type.h 2011-08-07 06:44:38 UTC (rev 8924)
@@ -183,6 +183,8 @@
   virtual int is_class() const;
   virtual int is_public() const;
   virtual int is_target() const { return 0; }
+  virtual int is_lib_target() const { return 0; }
+  virtual int is_app_target() const { return 0; }
   virtual int is_file() const { return 0; }
   virtual int is_fluid_file() const { return 0; }
   virtual int is_folder() const { return 0; }
@@ -255,6 +257,7 @@
   }
   const char *type_name() { return "app_target"; }
   Fl_Type *make();
+  virtual int is_app_target() const { return 1; }
   virtual int pixmapID() { return 52; }
   virtual void open();
 };
@@ -269,6 +272,7 @@
   }
   const char *type_name() { return "lib_target"; }
   Fl_Type *make();
+  virtual int is_lib_target() const { return 1; }
   virtual int pixmapID() { return 57; } // FIXME: new icon
   virtual void open();
 };

Modified: branches/branch-3.0/fluid/file_xcode.cxx
===================================================================
--- branches/branch-3.0/fluid/file_xcode.cxx    2011-08-06 22:21:35 UTC (rev 
8923)
+++ branches/branch-3.0/fluid/file_xcode.cxx    2011-08-07 06:44:38 UTC (rev 
8924)
@@ -90,6 +90,37 @@
 }
 
 
+static int writeFileReferences(FILE *out, Fl_Target_Type *tgt) {
+
+  char ProductReference[32]; strcpy(ProductReference, 
tgt->get_UUID_Xcode("Xcode4_ProductReference"));
+
+  Fl_File_Type *f;
+  for (f = Fl_File_Type::first_file(tgt); f; f = f->next_file(tgt)) {
+    // FIXME: write a file type converter!
+    if (f->lists_in(FL_ENV_XC4)) {
+      char PBXFileRef[32]; strcpy(PBXFileRef, 
f->get_UUID_Xcode("Xcode4_PBXFileRef"));
+      fprintf(out, "\t\t%s /* %s */ = {isa = PBXFileReference; fileEncoding = 
4; %s; name = %s; path = ../../%s; sourceTree = SOURCE_ROOT; };\n", 
+              PBXFileRef,
+              f->filename_name(), 
+              xcode4_type(f->filetype()),
+              f->filename_name(), 
+              f->filename());
+    }
+  }
+  if (tgt->is_lib_target()) {
+    fprintf(out, "\t\t%s /* %s.framework */ = {isa = PBXFileReference; 
explicitFileType = wrapper.framework; includeInIndex = 0; path = %s.framework; 
sourceTree = BUILT_PRODUCTS_DIR; };\n", ProductReference, tgt->name(), 
tgt->name());
+  } else if (tgt->is_app_target()) {
+    // TODO: B2F3E15BD31ADBA58ECD50C4 /* Fluid.app */ = {isa = 
PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; 
path = Fluid.app; sourceTree = BUILT_PRODUCTS_DIR; };
+  }
+  // we also need a file reference for the end produkt, for example:
+  // B2F3E15BD31ADBA58ECD50C4 /* Fluid.app */ = {isa = PBXFileReference; 
explicitFileType = wrapper.application; includeInIndex = 0; path = Fluid.app; 
sourceTree = BUILT_PRODUCTS_DIR; };
+  // or:
+  // FEB0F8FE6383384180570D94 /* fltk.framework */ = {isa = PBXFileReference; 
explicitFileType = wrapper.framework; includeInIndex = 0; path = 
fltk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+  // but be careful: these are referenced very often in the BuildFile section 
for CopyFiles phases, and in the group "products"
+  return 0;
+}
+
+
 static int writeHeadersBuildPhase(FILE *out, Fl_Target_Type *tgt) {
   
   char HeadersBuildPhase[32]; strcpy(HeadersBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_HeadersBuildPhase"));
@@ -115,6 +146,31 @@
 }
 
 
+static int writeSourcesBuildPhase(FILE *out, Fl_Target_Type *tgt) {
+  
+  char SourcesBuildPhase[32]; strcpy(SourcesBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_SourcesBuildPhase"));
+  
+  fprintf(out, "\t\t%s /* Sources */ = {\n", SourcesBuildPhase);
+  fprintf(out, "\t\t\tisa = PBXSourcesBuildPhase;\n");
+  fprintf(out, "\t\t\tbuildActionMask = 2147483647;\n");
+  fprintf(out, "\t\t\tfiles = (\n");
+  Fl_File_Type *f;
+  for (f = Fl_File_Type::first_file(tgt); f; f = f->next_file(tgt)) {
+    if (f->builds_in(FL_ENV_XC4) && f->is_code()) {
+      char PBXBuildFile[32]; strcpy(PBXBuildFile, 
f->get_UUID_Xcode("Xcode4_PBXBuildFile"));
+      fprintf(out, "\t\t\t\t%s /* %s in %s */,\n", 
+              PBXBuildFile, 
+              f->filename_name(), 
+              "Sources");
+    }
+  }
+  fprintf(out, "\t\t\t);\n");
+  fprintf(out, "\t\t\trunOnlyForDeploymentPostprocessing = 0;\n");
+  fprintf(out, "\t\t};\n");
+  return 0;
+}
+
+
 static int writeBuildConfigurations(FILE *out, const char *debugKey, const 
char *releaseKey, const char *productName) {
   // Write the Debug Build Configuration
   fprintf(out, "\t\t%s /* Debug */ = {\n", debugKey);
@@ -226,7 +282,9 @@
   char buildConfigurationList[32]; strcpy(buildConfigurationList, 
tgt->get_UUID_Xcode("Xcode4_BuildConfigurationList"));
   char ResourcesBuildPhase[32]; strcpy(ResourcesBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_ResourcesBuildPhase"));
   char HeadersBuildPhase[32]; strcpy(HeadersBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_HeadersBuildPhase"));
+  char SourcesBuildPhase[32]; strcpy(SourcesBuildPhase, 
tgt->get_UUID_Xcode("Xcode4_SourcesBuildPhase"));
   char FluidBuildRule[32]; strcpy(FluidBuildRule, 
tgt->get_UUID_Xcode("Xcode4_FluidBuildRule"));
+  char ProductReference[32]; strcpy(ProductReference, 
tgt->get_UUID_Xcode("Xcode4_ProductReference"));
 
   fprintf(out, "\t\tA57FDE871C99A52BEEDEE68C /* %s */ = {\n", tgt->name());    
 // FIXME: use generated key
   fprintf(out, "\t\t\tisa = PBXNativeTarget;\n");
@@ -234,9 +292,7 @@
   fprintf(out, "\t\t\tbuildPhases = (\n");
   fprintf(out, "\t\t\t\t%s /* Resources */,\n", ResourcesBuildPhase);
   fprintf(out, "\t\t\t\t%s /* Headers */,\n", HeadersBuildPhase);
-  //fprintf(out, "\t\t\t\tC9EDD42D1274B84100ADB21C /* CopyFiles */,\n");       
   // FIXME: this build phase is nonsense (this includes outdated FLTK1 headers)
-  //fprintf(out, "\t\t\t\tC9EDD4DD1274BB4100ADB21C /* CopyFiles */,\n");       
   // FIXME: this build phase is nonsense (this includes jpg and png headers)
-  fprintf(out, "\t\t\t\t4DA82C38AA0403E56A1E3545 /* Sources */,\n");           
 // FIXME: use generated key
+  fprintf(out, "\t\t\t\t%s /* Sources */,\n", SourcesBuildPhase);
   fprintf(out, "\t\t\t\tD2A1AD2D93B0EED43F624520 /* Frameworks */,\n");        
 // FIXME: use generated key
   fprintf(out, "\t\t\t);\n");
   fprintf(out, "\t\tbuildRules = (\n");
@@ -246,7 +302,7 @@
   fprintf(out, "\t\t\t);\n");
   fprintf(out, "\t\t\tname = %s;\n", tgt->name());
   fprintf(out, "\t\t\tproductName = %s;\n", tgt->name());
-  fprintf(out, "\t\t\tproductReference = FEB0F8FE6383384180570D94 /* 
%s.framework */;\n", tgt->name()); // FIXME: use generated key
+  fprintf(out, "\t\t\tproductReference = %s /* %s.framework */;\n", 
ProductReference, tgt->name()); // FIXME: .framework or .app
   fprintf(out, "\t\t\tproductType = \"com.apple.product-type.framework\";\n");
   fprintf(out, "\t\t};\n");
   
@@ -332,27 +388,15 @@
               fprintf(out, "\t\t%s /* %s in %s */ = {isa = PBXBuildFile; 
fileRef = %s /* %s */; };\n", 
                       PBXBuildFile, 
                       f->filename_name(), 
-                      "Sources", 
+                      "Sources",  // FIXME: use group name!
                       PBXFileRef, 
                       f->filename_name());
             }
           }
           hash = strchr(hash, ';')+1;
         } else if (strncmp(hash, "#FileReferences(", 16)==0) {
-          Fl_Type *tgt = Fl_Target_Type::find(hash+16, ')');
-          Fl_File_Type *f;
-          for (f = Fl_File_Type::first_file(tgt); f; f = f->next_file(tgt)) {
-            // FIXME: write a file type converter!
-            if (f->lists_in(FL_ENV_XC4)) {
-              char PBXFileRef[32]; strcpy(PBXFileRef, 
f->get_UUID_Xcode("Xcode4_PBXFileRef"));
-              fprintf(out, "\t\t%s /* %s */ = {isa = PBXFileReference; 
fileEncoding = 4; %s; name = %s; path = ../../%s; sourceTree = SOURCE_ROOT; 
};\n", 
-                      PBXFileRef,
-                      f->filename_name(), 
-                      xcode4_type(f->filetype()),
-                      f->filename_name(), 
-                      f->filename());
-            }
-          }
+          Fl_Target_Type *tgt = Fl_Target_Type::find(hash+16, ')');
+          writeFileReferences(out, tgt);
           hash = strchr(hash, ';')+1;
         } else if (strncmp(hash, "#HeadersGroup(", 14)==0) {
           Fl_Type *tgt = Fl_Target_Type::find(hash+14, ')');
@@ -383,7 +427,11 @@
           writeHeadersBuildPhase(out, tgt);
           hash = strchr(hash, ';')+1;
         } else if (strncmp(hash, "#SourcesBuildPhase(", 19)==0) {
-          Fl_Type *tgt = Fl_Target_Type::find(hash+19, ')');
+          Fl_Target_Type *tgt = Fl_Target_Type::find(hash+19, ')');
+          writeSourcesBuildPhase(out, tgt);
+          hash = strchr(hash, ';')+1;
+        } else if (strncmp(hash, "#OldSourcesBuildPhase(", 22)==0) {
+          Fl_Type *tgt = Fl_Target_Type::find(hash+22, ')');
           Fl_File_Type *f;
           for (f = Fl_File_Type::first_file(tgt); f; f = f->next_file(tgt)) {
             if (f->builds_in(FL_ENV_XC4) && f->is_code()) {
@@ -430,15 +478,17 @@
               -buildConfigurationList (ConfigurationList) = 
3BD5FFB6FCC8F21A23C23DF4 /* Build configuration list for PBXNativeTarget "fltk" 
*/;
                 -Debug (BuildConfiguration) = 78446623B2E9921ED6B05986
                 -Release (BuildConfiguration) = BFEB622BA8B40E851AF0E91F
-              Resources build phase (ResourcesBuildPhase) = 
6715D162BEFF87372B2A31E0 (can reference files (BuildFile))
-              Headers build phase (HeadersBuildPhas) = 
C9EDD5C81274C6BA00ADB21C (can reference files (BuildFile))
-              CopyFilesBuildPhase = C9EDD42D1274B84100ADB21C /* CopyFiles */, 
(copying header files around that shouldn`t)
-              CopyFilesBuildPhase = C9EDD4DD1274BB4100ADB21C /* CopyFiles */, 
(copying header files around that shouldn`t)
-              SourcesBuildPhase = 4DA82C38AA0403E56A1E3545 /* Sources */,
+              -Resources build phase (ResourcesBuildPhase) = 
6715D162BEFF87372B2A31E0 (can reference files (BuildFile))
+              -Headers build phase (HeadersBuildPhas) = 
C9EDD5C81274C6BA00ADB21C (can reference files (BuildFile))
+              -CopyFilesBuildPhase = C9EDD42D1274B84100ADB21C /* CopyFiles */, 
(copying header files around that shouldn`t)
+              -CopyFilesBuildPhase = C9EDD4DD1274BB4100ADB21C /* CopyFiles */, 
(copying header files around that shouldn`t)
+              -SourcesBuildPhase = 4DA82C38AA0403E56A1E3545 /* Sources */,
               FrameworksBuildPhase = D2A1AD2D93B0EED43F624520
                 Cocoa.framework = C96290C21274D0CF007D3CFE (BuildFile -> 
FileReference)
-              buildRules (BuildRule) = EFFAAB905A54B0BFE13CB56C (Fluid build 
rule, no more references)
+              -buildRules (BuildRule) = EFFAAB905A54B0BFE13CB56C (Fluid build 
rule, no more references)
               productReference = FEB0F8FE6383384180570D94 (-> FileReference, 
is also referenced in "Products")
+          
+          Also still missing are dependencies, like this one: 
A8AB7DEC3970D5A693D2BC84 and dependency proxies (uuuaaaahh!)
 #endif
           printf("Unknown command in template: <<%s>>\n", hash);
           copyLine = 1;

Modified: branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj
===================================================================
--- branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj       
2011-08-06 22:21:35 UTC (rev 8923)
+++ branches/branch-3.0/ide/Xcode4/FLTK.xcodeproj/project.pbxproj       
2011-08-07 06:44:38 UTC (rev 8924)
@@ -4353,6 +4353,7 @@
                6A8D02403C9D3B785B0D8F30 /* case.c */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = 
case.c; path = ../../src/xutf8/case.c; sourceTree = SOURCE_ROOT; };
                15064F3F45361B071125C187 /* is_right2left.c */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = 
is_right2left.c; path = ../../src/xutf8/is_right2left.c; sourceTree = 
SOURCE_ROOT; };
                35196210FA39F50016C06ED2 /* is_spacing.c */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = 
is_spacing.c; path = ../../src/xutf8/is_spacing.c; sourceTree = SOURCE_ROOT; };
+               FEB0F8FE6383384180570D94 /* fltk.framework */ = {isa = 
PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; 
path = fltk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                1BCEDC8AA971784435AC3119 /* adjuster.cxx */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
lineEnding = 0; name = adjuster.cxx; path = ../../test/adjuster.cxx; sourceTree 
= SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                1C17C98660CE64B98C8E2DFB /* fonts.cxx */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
lineEnding = 0; name = fonts.cxx; path = ../../test/fonts.cxx; sourceTree = 
SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
                1CFFC165E8EE6C1AD9CFD33C /* Fl_Int_Input.H */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name 
= Fl_Int_Input.H; path = ../../FL/Fl_Int_Input.H; sourceTree = SOURCE_ROOT; };
@@ -4814,7 +4815,6 @@
                FE29497A25C52BC2F7D5A9D4 /* inactive.fl */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; 
name = inactive.fl; path = ../../test/inactive.fl; sourceTree = SOURCE_ROOT; };
                FE466F26BF6C316E5A1770E6 /* jccolor.c */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = 
jccolor.c; path = ../../jpeg/jccolor.c; sourceTree = SOURCE_ROOT; };
                FE90AA3BB40510FA45E0C27B /* Fl_Bitmap.H */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name 
= Fl_Bitmap.H; path = ../../FL/Fl_Bitmap.H; sourceTree = SOURCE_ROOT; };
-               FEB0F8FE6383384180570D94 /* fltk.framework */ = {isa = 
PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; 
path = fltk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                FF88A1DACCAFA2D143A7F234 /* Fl_Value_Input.H */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name 
= Fl_Value_Input.H; path = ../../FL/Fl_Value_Input.H; sourceTree = SOURCE_ROOT; 
};
 /* End PBXFileReference section */
 
@@ -8337,7 +8337,7 @@
                        buildConfigurationList = F8A317C2491750F8DEF118E2 /* 
Build configuration list for PBXNativeTarget "fltk" */;                    
buildPhases = (
                                1DAA0C25D4F3735866428D29 /* Resources */,
                                0A872A2EDF7E71BE35FEFE8E /* Headers */,
-                               4DA82C38AA0403E56A1E3545 /* Sources */,
+                               ABBF042CD54A3824F354B9DB /* Sources */,
                                D2A1AD2D93B0EED43F624520 /* Frameworks */,
                        );
                buildRules = (
@@ -9927,7 +9927,7 @@
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
-               4DA82C38AA0403E56A1E3545 /* Sources */ = {
+               ABBF042CD54A3824F354B9DB /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (

Modified: branches/branch-3.0/ide/templates/Xcode4.tmpl
===================================================================
--- branches/branch-3.0/ide/templates/Xcode4.tmpl       2011-08-06 22:21:35 UTC 
(rev 8923)
+++ branches/branch-3.0/ide/templates/Xcode4.tmpl       2011-08-07 06:44:38 UTC 
(rev 8924)
@@ -4155,7 +4155,6 @@
                FE29497A25C52BC2F7D5A9D4 /* inactive.fl */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; 
name = inactive.fl; path = ../../test/inactive.fl; sourceTree = SOURCE_ROOT; };
                FE466F26BF6C316E5A1770E6 /* jccolor.c */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = 
jccolor.c; path = ../../jpeg/jccolor.c; sourceTree = SOURCE_ROOT; };
                FE90AA3BB40510FA45E0C27B /* Fl_Bitmap.H */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name 
= Fl_Bitmap.H; path = ../../FL/Fl_Bitmap.H; sourceTree = SOURCE_ROOT; };
-               FEB0F8FE6383384180570D94 /* fltk.framework */ = {isa = 
PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; 
path = fltk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                FF88A1DACCAFA2D143A7F234 /* Fl_Value_Input.H */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name 
= Fl_Value_Input.H; path = ../../FL/Fl_Value_Input.H; sourceTree = SOURCE_ROOT; 
};
 /* End PBXFileReference section */
 
@@ -8766,14 +8765,7 @@
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
-               4DA82C38AA0403E56A1E3545 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
 #SourcesBuildPhase(fltk);
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
                4DAA5BB519E04EF5DA60207E /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
@@ -9112,7 +9104,7 @@
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
-#SourcesBuildPhase(Fluid);
+#OldSourcesBuildPhase(Fluid);
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to