From fa63a4190cf96ad6aeb3945303bb481e1a72d052 Mon Sep 17 00:00:00 2001 From: William Manning Date: Fri, 27 Mar 2015 10:54:53 -0400 Subject: [PATCH 1/6] Remove meta files --- LICENSE.meta | 2 -- PBXBuildFile.cs.meta | 7 ------- PBXBuildPhase.cs.meta | 7 ------- PBXDictionary.cs.meta | 7 ------- PBXFileReference.cs.meta | 7 ------- PBXGroup.cs.meta | 7 ------- PBXList.cs.meta | 7 ------- PBXObject.cs.meta | 7 ------- PBXParser.cs.meta | 7 ------- PBXProject.cs.meta | 7 ------- Readme.mdown.meta | 2 -- XCBuildConfiguration.cs.meta | 7 ------- XCConfigurationList.cs.meta | 7 ------- XCFileOperationQueue.cs.meta | 7 ------- XCMod.cs.meta | 7 ------- XCProject.cs.meta | 7 ------- XCSourceFile.cs.meta | 7 ------- XCTarget.cs.meta | 7 ------- XCodeEditorMenu.cs.meta | 7 ------- XMiniJSON.cs.meta | 8 -------- 20 files changed, 131 deletions(-) delete mode 100644 LICENSE.meta delete mode 100644 PBXBuildFile.cs.meta delete mode 100644 PBXBuildPhase.cs.meta delete mode 100644 PBXDictionary.cs.meta delete mode 100644 PBXFileReference.cs.meta delete mode 100644 PBXGroup.cs.meta delete mode 100644 PBXList.cs.meta delete mode 100644 PBXObject.cs.meta delete mode 100644 PBXParser.cs.meta delete mode 100644 PBXProject.cs.meta delete mode 100644 Readme.mdown.meta delete mode 100644 XCBuildConfiguration.cs.meta delete mode 100644 XCConfigurationList.cs.meta delete mode 100644 XCFileOperationQueue.cs.meta delete mode 100644 XCMod.cs.meta delete mode 100644 XCProject.cs.meta delete mode 100644 XCSourceFile.cs.meta delete mode 100644 XCTarget.cs.meta delete mode 100644 XCodeEditorMenu.cs.meta delete mode 100644 XMiniJSON.cs.meta diff --git a/LICENSE.meta b/LICENSE.meta deleted file mode 100644 index fe9f28b..0000000 --- a/LICENSE.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: efd071e8beb084c7dbc945f03e3e9f6c diff --git a/PBXBuildFile.cs.meta b/PBXBuildFile.cs.meta deleted file mode 100644 index 4b5171b..0000000 --- a/PBXBuildFile.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: ffd51577e814940a8a93200cde422eb0 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/PBXBuildPhase.cs.meta b/PBXBuildPhase.cs.meta deleted file mode 100644 index e20c630..0000000 --- a/PBXBuildPhase.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 45e20ea7193b74e02b784077e774b23f -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/PBXDictionary.cs.meta b/PBXDictionary.cs.meta deleted file mode 100644 index 041587d..0000000 --- a/PBXDictionary.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: e2d23f084277542dbbe7a017cb9799ce -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/PBXFileReference.cs.meta b/PBXFileReference.cs.meta deleted file mode 100644 index 2f0ef40..0000000 --- a/PBXFileReference.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 2792ed7b2a30d40c199e8e27ebf39ccf -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/PBXGroup.cs.meta b/PBXGroup.cs.meta deleted file mode 100644 index 2a3114a..0000000 --- a/PBXGroup.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 1af26133e9aa04b77bd12d21d94f118e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/PBXList.cs.meta b/PBXList.cs.meta deleted file mode 100644 index 7e9a949..0000000 --- a/PBXList.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 5dab64c67c818480d9451129a0e67e80 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/PBXObject.cs.meta b/PBXObject.cs.meta deleted file mode 100644 index 9a36d90..0000000 --- a/PBXObject.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 32f133b9e55274ea89cb600dce102228 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/PBXParser.cs.meta b/PBXParser.cs.meta deleted file mode 100644 index 75b3231..0000000 --- a/PBXParser.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f4318f22732c14aeeaa07d76a3c78a3c -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/PBXProject.cs.meta b/PBXProject.cs.meta deleted file mode 100644 index 8e66df9..0000000 --- a/PBXProject.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8e2ac3a1ba3f94cb8bce3080b392f77c -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/Readme.mdown.meta b/Readme.mdown.meta deleted file mode 100644 index 581bbf3..0000000 --- a/Readme.mdown.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 5a8213bf10e38424b81ce56f7700deba diff --git a/XCBuildConfiguration.cs.meta b/XCBuildConfiguration.cs.meta deleted file mode 100644 index a744a6e..0000000 --- a/XCBuildConfiguration.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6072c24958d074bbba00b6654dea8a07 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/XCConfigurationList.cs.meta b/XCConfigurationList.cs.meta deleted file mode 100644 index e9ffa56..0000000 --- a/XCConfigurationList.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 186b7292bd62b4867bff9c84f77ba73e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/XCFileOperationQueue.cs.meta b/XCFileOperationQueue.cs.meta deleted file mode 100644 index 6e842c7..0000000 --- a/XCFileOperationQueue.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8a20716d12def417c9d0a303293098ac -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/XCMod.cs.meta b/XCMod.cs.meta deleted file mode 100644 index 9d6f8f2..0000000 --- a/XCMod.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9cf4113445351432eaf07fcc51ce34dc -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/XCProject.cs.meta b/XCProject.cs.meta deleted file mode 100644 index cab4502..0000000 --- a/XCProject.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 99d07ffc2f1ec4dd2a3d4c80a5b81e51 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/XCSourceFile.cs.meta b/XCSourceFile.cs.meta deleted file mode 100644 index a7d8ef7..0000000 --- a/XCSourceFile.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 88d0290a28a6c4c339fa14fef6465310 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/XCTarget.cs.meta b/XCTarget.cs.meta deleted file mode 100644 index 0ffd3e0..0000000 --- a/XCTarget.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 69423e6564ea64fc3b96ea9a712863e6 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/XCodeEditorMenu.cs.meta b/XCodeEditorMenu.cs.meta deleted file mode 100644 index 26018a7..0000000 --- a/XCodeEditorMenu.cs.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: e4ad4476f7c2c4dbd9441d710894cdc4 -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} diff --git a/XMiniJSON.cs.meta b/XMiniJSON.cs.meta deleted file mode 100644 index 385f865..0000000 --- a/XMiniJSON.cs.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 468eda41212fa224d814bff6fa19fd0e -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: From d0156451cd12f421ae8907c9c541c1dbe35460d1 Mon Sep 17 00:00:00 2001 From: William Manning Date: Fri, 27 Mar 2015 11:07:58 -0400 Subject: [PATCH 2/6] Remove commented code/excessive whitespace --- PBXBuildFile.cs | 35 ---- PBXBuildPhase.cs | 49 ----- PBXDictionary.cs | 1 - PBXFileReference.cs | 61 ------ PBXGroup.cs | 55 ------ PBXList.cs | 7 - PBXObject.cs | 28 --- PBXParser.cs | 37 ---- XCBuildConfiguration.cs | 55 ------ XCConfigurationList.cs | 3 - XCMod.cs | 29 --- XCProject.cs | 405 ---------------------------------------- 12 files changed, 765 deletions(-) diff --git a/PBXBuildFile.cs b/PBXBuildFile.cs index c9c29dd..529647d 100644 --- a/PBXBuildFile.cs +++ b/PBXBuildFile.cs @@ -14,27 +14,12 @@ public class PBXBuildFile : PBXObject public PBXBuildFile( PBXFileReference fileRef, bool weak = false ) : base() { - this.Add( FILE_REF_KEY, fileRef.guid ); SetWeakLink( weak ); - -// def Create(cls, file_ref, weak=False): -// if isinstance(file_ref, PBXFileReference): -// file_ref = file_ref.id -// -// bf = cls() -// bf.id = cls.GenerateId() -// bf['fileRef'] = file_ref -// -// if weak: -// bf.set_weak_link(True) -// -// return bf } public PBXBuildFile( string guid, PBXDictionary dictionary ) : base ( guid, dictionary ) { -// Debug.Log( "constructor child" ); } public bool SetWeakLink( bool weak = false ) @@ -101,26 +86,6 @@ public bool AddCompilerFlag( string flag ) ((PBXDictionary)_data[ SETTINGS_KEY ])[ COMPILER_FLAGS_KEY ] = ( string.Join( " ", flags ) + " " + flag ); return true; - -// def add_compiler_flag(self, flag): -// k_settings = 'settings' -// k_attributes = 'COMPILER_FLAGS' -// -// if not self.has_key(k_settings): -// self[k_settings] = PBXDict() -// -// if not self[k_settings].has_key(k_attributes): -// self[k_settings][k_attributes] = flag -// return True -// -// flags = self[k_settings][k_attributes].split(' ') -// -// if flag in flags: -// return False -// -// flags.append(flag) -// -// self[k_settings][k_attributes] = ' '.join(flags) } } diff --git a/PBXBuildPhase.cs b/PBXBuildPhase.cs index 9a96d20..f246fce 100644 --- a/PBXBuildPhase.cs +++ b/PBXBuildPhase.cs @@ -10,34 +10,18 @@ public class PBXBuildPhase : PBXObject public PBXBuildPhase() :base() { -// Debug.Log( "base" ); } public PBXBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary ) { -// Debug.Log( "constructor " + GetType().Name ); } public bool AddBuildFile( PBXBuildFile file ) { -// if( ((string)file[ ISA_KEY ]).CompareTo( "PBXBuildFile" ) != 0 ) -// return false; -// Debug.Log( "--> buildphase " + (string)_data[ ISA_KEY ] ); - - if( !ContainsKey( FILES_KEY ) ){ -// Debug.Log( "key not present" ); this.Add( FILES_KEY, new PBXList() ); } -// Debug.Log( "key: " + _data[ FILES_KEY ] ); -// Debug.Log( "Adding: " + file.guid ); ((PBXList)_data[ FILES_KEY ]).Add( file.guid ); -// if( ((PBXList)_data[ FILES_KEY ]).Contains( file.guid ) ) { -// Debug.Log( "AGGIUNTO" ); -// } -// else { -// Debug.Log( "MANCA" ); -// } return true; } @@ -65,41 +49,12 @@ public bool HasBuildFile( string id ) return ((PBXList)_data[ FILES_KEY ]).Contains( id ); } -// class PBXBuildPhase(PBXObject): -// def add_build_file(self, bf): -// if bf.get('isa') != 'PBXBuildFile': -// return False -// -// if not self.has_key('files'): -// self['files'] = PBXList() -// -// self['files'].add(bf.id) -// -// return True -// -// def remove_build_file(self, id): -// if not self.has_key('files'): -// self['files'] = PBXList() -// return -// -// self['files'].remove(id) -// -// def has_build_file(self, id): -// if not self.has_key('files'): -// self['files'] = PBXList() -// return False -// -// if not PBXObject.IsGuid(id): -// id = id.id -// -// return id in self['files'] } public class PBXFrameworksBuildPhase : PBXBuildPhase { public PBXFrameworksBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary ) { -// Debug.Log( "constructor child" + GetType().Name ); } } @@ -107,7 +62,6 @@ public class PBXResourcesBuildPhase : PBXBuildPhase { public PBXResourcesBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary ) { -// Debug.Log( "constructor child" + GetType().Name ); } } @@ -115,7 +69,6 @@ public class PBXShellScriptBuildPhase : PBXBuildPhase { public PBXShellScriptBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary ) { -// Debug.Log( "constructor child" + GetType().Name ); } } @@ -123,7 +76,6 @@ public class PBXSourcesBuildPhase : PBXBuildPhase { public PBXSourcesBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary ) { -// Debug.Log( "constructor child" + GetType().Name ); } } @@ -131,7 +83,6 @@ public class PBXCopyFilesBuildPhase : PBXBuildPhase { public PBXCopyFilesBuildPhase( string guid, PBXDictionary dictionary ) : base ( guid, dictionary ) { -// Debug.Log( "constructor child" + GetType().Name ); } } } diff --git a/PBXDictionary.cs b/PBXDictionary.cs index a0c753a..39f231c 100644 --- a/PBXDictionary.cs +++ b/PBXDictionary.cs @@ -6,7 +6,6 @@ namespace UnityEditor.XCodeEditor { public class PBXDictionary : Dictionary { - public void Append( PBXDictionary dictionary ) { foreach( var item in dictionary) { diff --git a/PBXFileReference.cs b/PBXFileReference.cs index a074905..208151a 100644 --- a/PBXFileReference.cs +++ b/PBXFileReference.cs @@ -116,79 +116,18 @@ private void SetFileType( string fileType ) } // class PBXFileReference(PBXType): -// def __init__(self, d=None): -// PBXType.__init__(self, d) -// self.build_phase = None // -// types = { -// '.a':('archive.ar', 'PBXFrameworksBuildPhase'), -// '.app': ('wrapper.application', None), -// '.s': ('sourcecode.asm', 'PBXSourcesBuildPhase'), -// '.c': ('sourcecode.c.c', 'PBXSourcesBuildPhase'), -// '.cpp': ('sourcecode.cpp.cpp', 'PBXSourcesBuildPhase'), -// '.framework': ('wrapper.framework','PBXFrameworksBuildPhase'), -// '.h': ('sourcecode.c.h', None), -// '.icns': ('image.icns','PBXResourcesBuildPhase'), -// '.m': ('sourcecode.c.objc', 'PBXSourcesBuildPhase'), -// '.mm': ('sourcecode.cpp.objcpp', 'PBXSourcesBuildPhase'), -// '.nib': ('wrapper.nib', 'PBXResourcesBuildPhase'), -// '.plist': ('text.plist.xml', 'PBXResourcesBuildPhase'), -// '.png': ('image.png', 'PBXResourcesBuildPhase'), -// '.rtf': ('text.rtf', 'PBXResourcesBuildPhase'), -// '.tiff': ('image.tiff', 'PBXResourcesBuildPhase'), -// '.txt': ('text', 'PBXResourcesBuildPhase'), -// '.xcodeproj': ('wrapper.pb-project', None), -// '.xib': ('file.xib', 'PBXResourcesBuildPhase'), -// '.strings': ('text.plist.strings', 'PBXResourcesBuildPhase'), -// '.bundle': ('wrapper.plug-in', 'PBXResourcesBuildPhase'), -// '.dylib': ('compiled.mach-o.dylib', 'PBXFrameworksBuildPhase') -// } // -// trees = [ -// '', -// '', -// 'BUILT_PRODUCTS_DIR', -// 'DEVELOPER_DIR', -// 'SDKROOT', -// 'SOURCE_ROOT', -// ] // -// def guess_file_type(self): -// self.remove('explicitFileType') -// self.remove('lastKnownFileType') -// ext = os.path.splitext(self.get('name', ''))[1] // -// f_type, build_phase = PBXFileReference.types.get(ext, ('?', None)) // -// self['lastKnownFileType'] = f_type -// self.build_phase = build_phase // -// if f_type == '?': -// print 'unknown file extension: %s' % ext -// print 'please add extension and Xcode type to PBXFileReference.types' // -// return f_type // -// def set_file_type(self, ft): -// self.remove('explicitFileType') -// self.remove('lastKnownFileType') // -// self['explicitFileType'] = ft // -// @classmethod -// def Create(cls, os_path, tree='SOURCE_ROOT'): -// if tree not in cls.trees: -// print 'Not a valid sourceTree type: %s' % tree -// return None // -// fr = cls() -// fr.id = cls.GenerateId() -// fr['path'] = os_path -// fr['name'] = os.path.split(os_path)[1] -// fr['sourceTree'] = '' if os.path.isabs(os_path) else tree -// fr.guess_file_type() // -// return fr } public enum TreeEnum { diff --git a/PBXGroup.cs b/PBXGroup.cs index 9a22c7c..d6d7312 100644 --- a/PBXGroup.cs +++ b/PBXGroup.cs @@ -107,60 +107,5 @@ public string GetName() return (string)_data[ NAME_KEY ]; } -// class PBXGroup(PBXObject): -// def add_child(self, ref): -// if not isinstance(ref, PBXDict): -// return None -// -// isa = ref.get('isa') -// -// if isa != 'PBXFileReference' and isa != 'PBXGroup': -// return None -// -// if not self.has_key('children'): -// self['children'] = PBXList() -// -// self['children'].add(ref.id) -// -// return ref.id -// -// def remove_child(self, id): -// if not self.has_key('children'): -// self['children'] = PBXList() -// return -// -// if not PBXObject.IsGuid(id): -// id = id.id -// -// self['children'].remove(id) -// -// def has_child(self, id): -// if not self.has_key('children'): -// self['children'] = PBXList() -// return False -// -// if not PBXObject.IsGuid(id): -// id = id.id -// -// return id in self['children'] -// -// def get_name(self): -// path_name = os.path.split(self.get('path',''))[1] -// return self.get('name', path_name) -// -// @classmethod -// def Create(cls, name, path=None, tree='SOURCE_ROOT'): -// grp = cls() -// grp.id = cls.GenerateId() -// grp['name'] = name -// grp['children'] = PBXList() -// -// if path: -// grp['path'] = path -// grp['sourceTree'] = tree -// else: -// grp['sourceTree'] = '' -// -// return grp } } diff --git a/PBXList.cs b/PBXList.cs index 92c81ef..dd92afe 100644 --- a/PBXList.cs +++ b/PBXList.cs @@ -17,11 +17,4 @@ public PBXList( object firstValue ) } } -// public class PBXList : ArrayList -// { -// public int Add( T value ) -// { -// return (ArrayList)this.Add( value ); -// } -// } } diff --git a/PBXObject.cs b/PBXObject.cs index 0430b46..bf31aec 100644 --- a/PBXObject.cs +++ b/PBXObject.cs @@ -50,7 +50,6 @@ public PBXObject( string guid ) : this() public PBXObject( string guid, PBXDictionary dictionary ) : this( guid ) { -// Debug.Log( "constructor parent " + this.GetType().Name ); if( !dictionary.ContainsKey( ISA_KEY ) || ((string)dictionary[ ISA_KEY ]).CompareTo( this.GetType().Name ) != 0 ) Debug.LogError( "PBXDictionary is not a valid ISA object" ); @@ -93,33 +92,6 @@ public bool ContainsKey( string key ) } #endregion -// class PBXObject(PBXDict): -// def __init__(self, d=None): -// PBXDict.__init__(self, d) -// -// if not self.has_key('isa'): -// self['isa'] = self.__class__.__name__ -// self.id = None -// -// @staticmethod -// def Convert(o): -// if isinstance(o, list): -// return PBXList(o) -// elif isinstance(o, dict): -// isa = o.get('isa') -// -// if not isa: -// return PBXDict(o) -// -// cls = globals().get(isa) -// -// if cls and issubclass(cls, PBXObject): -// return cls(o) -// -// print 'warning: unknown PBX type: %s' % isa -// return PBXDict(o) -// else: -// return o } public class PBXNativeTarget : PBXObject diff --git a/PBXParser.cs b/PBXParser.cs index f285922..a291b01 100644 --- a/PBXParser.cs +++ b/PBXParser.cs @@ -31,15 +31,11 @@ public class PBXParser public const string COMMENT_LINE_TOKEN = "//"; private const int BUILDER_CAPACITY = 20000; - // private char[] data; private int index; -// public bool success; -// private int indent; public PBXDictionary Decode( string data ) { -// success = true; if( !data.StartsWith( PBX_HEADER_TOKEN ) ) { Debug.Log( "Wrong file format." ); return null; @@ -54,8 +50,6 @@ public PBXDictionary Decode( string data ) public string Encode( PBXDictionary pbxData, bool readable = false ) { -// indent = 0; - StringBuilder builder = new StringBuilder( PBX_HEADER_TOKEN, BUILDER_CAPACITY ); bool success = SerializeValue( pbxData, builder, readable ); @@ -155,25 +149,6 @@ private object ParseValue() } } -// private T Convert( PBXDictionary dictionary ) -// { -// if( dictionary.ContainsKey( "isa" ) ){ -//// ((string)dictionary["isa"]).CompareTo( -// Type targetType = Type.GetType( (string)dictionary["isa"] ); -// if( targetType.IsSubclassOf( typeof(PBXObject) ) ) { -// Debug.Log( "ok" ); -// T converted = (T)Activator.CreateInstance( targetType ); -// return converted; -// } -// else { -// Debug.Log( "Warning: unknown PBX type: " + targetType.Name ); -// return default(T); -// } -// -// } -// return default(T); -// -// } private PBXDictionary ParseDictionary() { @@ -302,18 +277,6 @@ private bool SerializeValue( object value, StringBuilder builder, bool readable else if( value.GetType().IsPrimitive ) { builder.Append( Convert.ToString( value ) ); } -// else if( value is Hashtable ) -// { -// serializeObject( (Hashtable)value, builder ); -// } -// else if( ( value is Boolean ) && ( (Boolean)value == true ) ) -// { -// builder.Append( "NO" ); -// } -// else if( ( value is Boolean ) && ( (Boolean)value == false ) ) -// { -// builder.Append( "YES" ); -// } else { Debug.LogWarning( "Error: unknown object of type " + value.GetType().Name ); return false; diff --git a/XCBuildConfiguration.cs b/XCBuildConfiguration.cs index a64c25c..b3366fe 100644 --- a/XCBuildConfiguration.cs +++ b/XCBuildConfiguration.cs @@ -47,7 +47,6 @@ protected bool AddSearchPaths( PBXList paths, string key, bool recursive = true if( recursive && !path.EndsWith( "/**" ) ) currentPath += "/**"; -// Debug.Log( "adding: " + currentPath ); if( !((PBXDictionary)_data[BUILDSETTINGS_KEY]).ContainsKey( key ) ) { ((PBXDictionary)_data[BUILDSETTINGS_KEY]).Add( key, new PBXList() ); } @@ -175,59 +174,5 @@ public bool GccEnableObjCExceptions (string value) return true; } -// class XCBuildConfiguration(PBXType): -// def add_search_paths(self, paths, base, key, recursive=True): -// modified = False -// -// if not isinstance(paths, list): -// paths = [paths] -// -// if not self.has_key(base): -// self[base] = PBXDict() -// -// for path in paths: -// if recursive and not path.endswith('/**'): -// path = os.path.join(path, '**') -// -// if not self[base].has_key(key): -// self[base][key] = PBXList() -// elif isinstance(self[base][key], basestring): -// self[base][key] = PBXList(self[base][key]) -// -// if self[base][key].add('\\"%s\\"' % path): -// modified = True -// -// return modified -// -// def add_header_search_paths(self, paths, recursive=True): -// return self.add_search_paths(paths, 'buildSettings', 'HEADER_SEARCH_PATHS', recursive=recursive) -// -// def add_library_search_paths(self, paths, recursive=True): -// return self.add_search_paths(paths, 'buildSettings', 'LIBRARY_SEARCH_PATHS', recursive=recursive) -// -// def add_other_cflags(self, flags): -// modified = False -// -// base = 'buildSettings' -// key = 'OTHER_CFLAGS' -// -// if isinstance(flags, basestring): -// flags = PBXList(flags) -// -// if not self.has_key(base): -// self[base] = PBXDict() -// -// for flag in flags: -// -// if not self[base].has_key(key): -// self[base][key] = PBXList() -// elif isinstance(self[base][key], basestring): -// self[base][key] = PBXList(self[base][key]) -// -// if self[base][key].add(flag): -// self[base][key] = [e for e in self[base][key] if e] -// modified = True -// -// return modified } } \ No newline at end of file diff --git a/XCConfigurationList.cs b/XCConfigurationList.cs index 557656b..d8f83ad 100644 --- a/XCConfigurationList.cs +++ b/XCConfigurationList.cs @@ -6,9 +6,6 @@ namespace UnityEditor.XCodeEditor { public class XCConfigurationList : PBXObject { -// XCBuildConfigurationList buildConfigurations; -// bool defaultConfigurationIsVisible = false; -// string defaultConfigurationName; public XCConfigurationList( string guid, PBXDictionary dictionary ) : base( guid, dictionary ) { } diff --git a/XCMod.cs b/XCMod.cs index 356d516..20346ba 100644 --- a/XCMod.cs +++ b/XCMod.cs @@ -7,14 +7,6 @@ namespace UnityEditor.XCodeEditor { public class XCMod { -// private string group; -// private ArrayList patches; -// private ArrayList libs; -// private ArrayList frameworks; -// private ArrayList headerpaths; -// private ArrayList files; -// private ArrayList folders; -// private ArrayList excludes; private Hashtable _datastore; private ArrayList _libs; @@ -94,29 +86,8 @@ public XCMod( string filename ) string contents = projectFileInfo.OpenText().ReadToEnd(); _datastore = (Hashtable)XMiniJSON.jsonDecode( contents ); -// group = (string)_datastore["group"]; -// patches = (ArrayList)_datastore["patches"]; -// libs = (ArrayList)_datastore["libs"]; -// frameworks = (ArrayList)_datastore["frameworks"]; -// headerpaths = (ArrayList)_datastore["headerpaths"]; -// files = (ArrayList)_datastore["files"]; -// folders = (ArrayList)_datastore["folders"]; -// excludes = (ArrayList)_datastore["excludes"]; } - -// "group": "GameCenter", -// "patches": [], -// "libs": [], -// "frameworks": ["GameKit.framework"], -// "headerpaths": ["Editor/iOS/GameCenter/**"], -// "files": ["Editor/iOS/GameCenter/GameCenterBinding.m", -// "Editor/iOS/GameCenter/GameCenterController.h", -// "Editor/iOS/GameCenter/GameCenterController.mm", -// "Editor/iOS/GameCenter/GameCenterManager.h", -// "Editor/iOS/GameCenter/GameCenterManager.m"], -// "folders": [], -// "excludes": ["^.*\\.meta$", "^.*\\.mdown^", "^.*\\.pdf$"] } diff --git a/XCProject.cs b/XCProject.cs index 823daaa..86f24b0 100644 --- a/XCProject.cs +++ b/XCProject.cs @@ -10,7 +10,6 @@ namespace UnityEditor.XCodeEditor public partial class XCProject : System.IDisposable { -// private string _filePath; private PBXDictionary _datastore; public PBXDictionary _objects; private PBXDictionary _configurations; @@ -100,9 +99,7 @@ public XCProject( string filePath ) : this() _rootObjectKey = (string)_datastore["rootObject"]; if( !string.IsNullOrEmpty( _rootObjectKey ) ) { -// _rootObject = (PBXDictionary)_objects[ _rootObjectKey ]; _project = new PBXProject( _rootObjectKey, (PBXDictionary)_objects[ _rootObjectKey ] ); -// _rootGroup = (PBXDictionary)_objects[ (string)_rootObject[ "mainGroup" ] ]; _rootGroup = new PBXGroup( _rootObjectKey, (PBXDictionary)_objects[ _project.mainGroupID ] ); } else { @@ -285,7 +282,6 @@ public bool AddHeaderSearchPaths( string path ) public bool AddHeaderSearchPaths( PBXList paths ) { foreach( KeyValuePair buildConfig in buildConfigurations ) { -// Debug.Log( "ADDING HEADER PATH: " + paths + " to " + buildConfig.Key ); buildConfig.Value.AddHeaderSearchPaths( paths ); } modified = true; @@ -321,47 +317,10 @@ public bool AddFrameworkSearchPaths(PBXList paths) return modified; } - //FRAMEWORK_SEARCH_PATHS = ( - // "$(inherited)", - // "\"$(SRCROOT)/../../../../../../../Documents/FacebookSDK\"", - //); - - -// public PBXList GetObjectOfType( string type ) -// { -// PBXList result = new PBXList(); -// foreach( KeyValuePair current in _objects ) { -// //Debug.Log( "object: " + ((PBXDictionary)current.Value)["isa"] ); -// if( string.Compare( (string)((PBXDictionary)current.Value)["isa"], type ) == 0 ) -// result.Add( current.Value ); -// } -// return result; -// } - public object GetObject( string guid ) { return _objects[guid]; } - - -// public PBXDictionary GetBuildPhase( string buildPhase ) -// { -// switch( buildPhase ) { -// case "PBXFrameworksBuildPhase": -// return (PBXDictionary)frameworkBuildPhases; -// case "PBXResourcesBuildPhase": -// return (PBXDictionary)resourcesBuildPhases; -// case "PBXShellScriptBuildPhase": -// return (PBXDictionary)shellScriptBuildPhases; -// case "PBXSourcesBuildPhase": -// return (PBXDictionary)sourcesBuildPhases; -// case "PBXCopyFilesBuildPhase": -// return (PBXDictionary)copyBuildPhases; -// default: -// return default(T); -// } -// } - public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tree = "SOURCE_ROOT", bool createBuildFiles = true, bool weak = false ) { PBXDictionary results = new PBXDictionary(); @@ -369,11 +328,9 @@ public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tr if( Path.IsPathRooted( filePath ) ) { absPath = filePath; -// Debug.Log( "Is rooted: " + absPath ); } else if( tree.CompareTo( "SDKROOT" ) != 0) { absPath = Path.Combine( Application.dataPath.Replace("Assets", ""), filePath ); -// Debug.Log( "RElative: " + absPath ); } if( !( File.Exists( absPath ) || Directory.Exists( absPath ) ) && tree.CompareTo( "SDKROOT" ) != 0 ) { @@ -385,11 +342,6 @@ public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tr System.Uri rootURI = new System.Uri( ( projectRootPath + "/." ) ); filePath = rootURI.MakeRelativeUri( fileURI ).ToString(); } -// else { -// tree = ""; -// Debug.Log( "3: " + filePath ); -// } -// Debug.Log( "Add file result path: " + filePath ); if( parent == null ) { parent = _rootGroup; @@ -398,7 +350,6 @@ public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tr // TODO: Aggiungere controllo se file già presente PBXFileReference fileReference = GetFile( System.IO.Path.GetFileName( filePath ) ); if( fileReference != null ) { -// Debug.Log( "File già presente." ); return null; } @@ -409,7 +360,6 @@ public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tr //Create a build file for reference if( !string.IsNullOrEmpty( fileReference.buildPhase ) && createBuildFiles ) { -// PBXDictionary currentPhase = GetBuildPhase( fileReference.buildPhase ); PBXBuildFile buildFile; switch( fileReference.buildPhase ) { case "PBXFrameworksBuildPhase": @@ -465,61 +415,7 @@ public PBXDictionary AddFile( string filePath, PBXGroup parent = null, string tr return null; } } - -// Debug.Log( "Results " + results.Count + " - " ); -// foreach( KeyValuePair obj in results ){ -// Debug.Log( obj.Key + " - " + obj.Value.GetType().Name ); -// } return results; - -// def add_file(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False): -// results = [] -// -// abs_path = '' -// -// if os.path.isabs(f_path): -// abs_path = f_path -// -// if not os.path.exists(f_path): -// return results -// elif tree == 'SOURCE_ROOT': -// f_path = os.path.relpath(f_path, self.source_root) -// else: -// tree = '' -// -// if not parent: -// parent = self.root_group -// elif not isinstance(parent, PBXGroup): -// # assume it's an id -// parent = self.objects.get(parent, self.root_group) -// -// file_ref = PBXFileReference.Create(f_path, tree) -// parent.add_child(file_ref) -// results.append(file_ref) -// # create a build file for the file ref -// if file_ref.build_phase and create_build_files: -// phases = self.get_build_phases(file_ref.build_phase) -// -// for phase in phases: -// build_file = PBXBuildFile.Create(file_ref, weak=weak) -// -// phase.add_build_file(build_file) -// results.append(build_file) -// -// if abs_path and tree == 'SOURCE_ROOT' and os.path.isfile(abs_path)\ -// and file_ref.build_phase == 'PBXFrameworksBuildPhase': -// -// library_path = os.path.join('$(SRCROOT)', os.path.split(f_path)[0]) -// -// self.add_library_search_paths([library_path], recursive=False) -// -// for r in results: -// self.objects[r.id] = r -// -// if results: -// self.modified = True -// -// return results } public bool AddFolder( string folderPath, PBXGroup parent = null, string[] exclude = null, bool recursive = true, bool createBuildFile = true ) @@ -539,7 +435,6 @@ public bool AddFolder( string folderPath, PBXGroup parent = null, string[] exclu // Create group PBXGroup newGroup = GetGroup( sourceDirectoryInfo.Name, null /*relative path*/, parent ); -// groups.Add( newGroup ); foreach( string directory in Directory.GetDirectories( folderPath ) ) { @@ -547,7 +442,6 @@ public bool AddFolder( string folderPath, PBXGroup parent = null, string[] exclu continue; } -// special_folders = ['.bundle', '.framework', '.xcodeproj'] Debug.Log( "DIR: " + directory ); if( directory.EndsWith( ".bundle" ) ) { // Treath it like a file and copy even if not recursive @@ -567,90 +461,11 @@ public bool AddFolder( string folderPath, PBXGroup parent = null, string[] exclu if( Regex.IsMatch( file, regexExclude ) ) { continue; } - //Debug.Log( "--> " + file + ", " + newGroup ); AddFile( file, newGroup, "SOURCE_ROOT", createBuildFile ); } modified = true; return modified; -// def add_folder(self, os_path, parent=None, excludes=None, recursive=True, create_build_files=True): -// if not os.path.isdir(os_path): -// return [] -// -// if not excludes: -// excludes = [] -// -// results = [] -// -// if not parent: -// parent = self.root_group -// elif not isinstance(parent, PBXGroup): -// # assume it's an id -// parent = self.objects.get(parent, self.root_group) -// -// path_dict = {os.path.split(os_path)[0]:parent} -// special_list = [] -// -// for (grp_path, subdirs, files) in os.walk(os_path): -// parent_folder, folder_name = os.path.split(grp_path) -// parent = path_dict.get(parent_folder, parent) -// -// if [sp for sp in special_list if parent_folder.startswith(sp)]: -// continue -// -// if folder_name.startswith('.'): -// special_list.append(grp_path) -// continue -// -// if os.path.splitext(grp_path)[1] in XcodeProject.special_folders: -// # if this file has a special extension (bundle or framework mainly) treat it as a file -// special_list.append(grp_path) -// -// new_files = self.verify_files([folder_name], parent=parent) -// -// if new_files: -// results.extend(self.add_file(grp_path, parent, create_build_files=create_build_files)) -// -// continue -// -// # create group -// grp = self.get_or_create_group(folder_name, path=self.get_relative_path(grp_path) , parent=parent) -// path_dict[grp_path] = grp -// -// results.append(grp) -// -// file_dict = {} -// -// for f in files: -// if f[0] == '.' or [m for m in excludes if re.match(m,f)]: -// continue -// -// kwds = { -// 'create_build_files': create_build_files, -// 'parent': grp, -// 'name': f -// } -// -// f_path = os.path.join(grp_path, f) -// -// file_dict[f_path] = kwds -// -// new_files = self.verify_files([n.get('name') for n in file_dict.values()], parent=grp) -// -// add_files = [(k,v) for k,v in file_dict.items() if v.get('name') in new_files] -// -// for path, kwds in add_files: -// kwds.pop('name', None) -// -// self.add_file(path, **kwds) -// -// if not recursive: -// break -// -// for r in results: -// self.objects[r.id] = r -// -// return results } #endregion @@ -673,7 +488,6 @@ public PBXFileReference GetFile( string name ) public PBXGroup GetGroup( string name, string path = null, PBXGroup parent = null ) { -// Debug.Log( "GetGroup: " + name + ", " + path + ", " + parent ); if( string.IsNullOrEmpty( name ) ) return null; @@ -682,7 +496,6 @@ public PBXGroup GetGroup( string name, string path = null, PBXGroup parent = nul foreach( KeyValuePair current in groups ) { -// Debug.Log( "current: " + current.Value.guid + ", " + current.Value.name + ", " + current.Value.path + " - " + parent.HasChild( current.Key ) ); if( string.IsNullOrEmpty( current.Value.name ) ) { if( current.Value.path.CompareTo( name ) == 0 && parent.HasChild( current.Key ) ) { return current.Value; @@ -699,223 +512,9 @@ public PBXGroup GetGroup( string name, string path = null, PBXGroup parent = nul modified = true; return result; - -// def get_or_create_group(self, name, path=None, parent=None): -// if not name: -// return None -// -// if not parent: -// parent = self.root_group -// elif not isinstance(parent, PBXGroup): -// # assume it's an id -// parent = self.objects.get(parent, self.root_group) -// -// groups = self.get_groups_by_name(name) -// -// for grp in groups: -// if parent.has_child(grp.id): -// return grp -// -// grp = PBXGroup.Create(name, path) -// parent.add_child(grp) -// -// self.objects[grp.id] = grp -// -// self.modified = True -// -// return grp } #endregion -// #region Files -// -// -// /// -// /// Returns all file resources in the project, as an array of `XCSourceFile` objects. -// /// -// /// -// /// The files. -// /// -// public ArrayList GetFiles() -// { -// return null; -// } -// -// /// -// /// Returns the project file with the specified key, or nil. -// /// -// /// -// /// The file with key. -// /// -// /// -// /// Key. -// /// -// public XCSourceFile GetFileWithKey( string key ) -// { -// return null; -// } -// -// /// -// /// Returns the project file with the specified name, or nil. If more than one project file matches the specified name, -// /// which one is returned is undefined. -// /// -// /// -// /// The file with name. -// /// -// /// -// /// Name. -// /// -// public XCSourceFile GetFileWithName( string name ) -// { -// return null; -// } -// -// /// -// /// Returns all header files in the project, as an array of `XCSourceFile` objects. -// /// -// /// -// /// The header files. -// /// -// public ArrayList GetHeaderFiles() -// { -// return null; -// } -// -// /** -// * Returns all implementation obj-c implementation files in the project, as an array of `XCSourceFile` objects. -// */ -// public ArrayList GetObjectiveCFiles() -// { -// return null; -// } -// -// /** -// * Returns all implementation obj-c++ implementation files in the project, as an array of `XCSourceFile` objects. -// */ -// public ArrayList GetObjectiveCPlusPlusFiles() -// { -// return null; -// } -// -// /** -// * Returns all the xib files in the project, as an array of `XCSourceFile` objects. -// */ -// public ArrayList GetXibFiles() -// { -// return null; -// -// } -// -// public ArrayList getImagePNGFiles() -// { -// return null; -// } -// -// #endregion -// #region Groups -// /** -// * Lists the groups in an xcode project, returning an array of `PBXGroup` objects. -// */ -// public PBXList groups { -// get { -// return null; -// } -// } -// -// /** -// * Returns the root (top-level) group. -// */ -// public PBXGroup rootGroup { -// get { -// return null; -// } -// } -// -// /** -// * Returns the root (top-level) groups, if there are multiple. An array of rootGroup if there is only one. -// */ -// public ArrayList rootGroups { -// get { -// return null; -// } -// } -// -// /** -// * Returns the group with the given key, or nil. -// */ -// public PBXGroup GetGroupWithKey( string key ) -// { -// return null; -// } -// -// /** -// * Returns the group with the specified display name path - the directory relative to the root group. Eg Source/Main -// */ -// public PBXGroup GetGroupWithPathFromRoot( string path ) -// { -// return null; -// } -// -// /** -// * Returns the parent group for the group or file with the given key; -// */ -// public PBXGroup GetGroupForGroupMemberWithKey( string key ) -// { -// return null; -// } -// -// /** -// * Returns the parent group for the group or file with the source file -// */ -// public PBXGroup GetGroupWithSourceFile( XCSourceFile sourceFile ) -// { -// return null; -// } -// -// #endregion -// #region Target -// -// /** -// * Lists the targets in an xcode project, returning an array of `XCTarget` objects. -// */ -// public ArrayList targets { -// get { -// return null; -// } -// } -// -// /** -// * Returns the target with the specified name, or nil. -// */ -// public XCTarget GetTargetWithName( string name ) -// { -// return null; -// } -// -// #endregion -// #region Configurations -// -// /** -// * Returns the target with the specified name, or nil. -// */ -// public Dictionary configurations { -// get { -// return null; -// } -// } -// -// public Dictionary GetConfigurationWithName( string name ) -// { -// return null; -// } -// -// public XCBuildConfigurationList defaultConfiguration { -// get { -// return null; -// } -// } -// -// #endregion #region Mods public void ApplyMod( string pbxmod ) @@ -1006,7 +605,6 @@ public void Consolidate() consolidated.Append( this.buildFiles ); consolidated.Append( this.groups ); consolidated.Append( this.fileReferences ); -// consolidated.Append( this.project ); consolidated.Append( this.nativeTargets ); consolidated.Append( this.frameworkBuildPhases ); consolidated.Append( this.resourcesBuildPhases ); @@ -1055,9 +653,6 @@ public void Save() StreamWriter saveFile = File.CreateText( System.IO.Path.Combine( this.filePath, "project.pbxproj" ) ); saveFile.Write( parser.Encode( result, false ) ); saveFile.Close(); - -// Xcode4Controller.Connect(); -// Xcode4Controller.OpenProject(filePath); } /** From 7803961bef89883475024e2e7994c73bd8fdeea2 Mon Sep 17 00:00:00 2001 From: William Manning Date: Fri, 27 Mar 2015 11:17:46 -0400 Subject: [PATCH 3/6] Remove more commented code --- PBXFileReference.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/PBXFileReference.cs b/PBXFileReference.cs index 208151a..8999a67 100644 --- a/PBXFileReference.cs +++ b/PBXFileReference.cs @@ -114,20 +114,6 @@ private void SetFileType( string fileType ) this.Add( EXPLICIT_FILE_TYPE_KEY, fileType ); } - -// class PBXFileReference(PBXType): -// -// -// -// -// -// -// -// -// -// -// -// } public enum TreeEnum { From 78c08990bd69b1ae41e62d4b09505eee438bc180 Mon Sep 17 00:00:00 2001 From: William Manning Date: Fri, 27 Mar 2015 11:22:40 -0400 Subject: [PATCH 4/6] Add ".sample" to end of sample .projmods In order to prevent accidental usage of the file when applying projmods to your project. --- sample_config.projmods => sample_config.projmods.sample | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sample_config.projmods => sample_config.projmods.sample (100%) diff --git a/sample_config.projmods b/sample_config.projmods.sample similarity index 100% rename from sample_config.projmods rename to sample_config.projmods.sample From a8ef80cc6391a4b20ea0f51b0dbfff4177e0b904 Mon Sep 17 00:00:00 2001 From: William Manning Date: Fri, 27 Mar 2015 11:44:57 -0400 Subject: [PATCH 5/6] Removed unused files --- XCSourceFile.cs | 15 ------- XCTarget.cs | 15 ------- XCodeEditorMenu.cs | 97 ---------------------------------------------- 3 files changed, 127 deletions(-) delete mode 100644 XCSourceFile.cs delete mode 100644 XCTarget.cs delete mode 100644 XCodeEditorMenu.cs diff --git a/XCSourceFile.cs b/XCSourceFile.cs deleted file mode 100644 index aad45fe..0000000 --- a/XCSourceFile.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UnityEngine; -using System.Collections; - -namespace UnityEditor.XCodeEditor -{ - public class XCSourceFile : System.IDisposable - { - - public void Dispose() - { - - } - - } -} \ No newline at end of file diff --git a/XCTarget.cs b/XCTarget.cs deleted file mode 100644 index edc1f60..0000000 --- a/XCTarget.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UnityEngine; -using System.Collections; - -namespace UnityEditor.XCodeEditor -{ - public class XCTarget : System.IDisposable - { - - public void Dispose() - { - - } - - } -} \ No newline at end of file diff --git a/XCodeEditorMenu.cs b/XCodeEditorMenu.cs deleted file mode 100644 index 89a70b5..0000000 --- a/XCodeEditorMenu.cs +++ /dev/null @@ -1,97 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Collections; -using System.Collections.Generic; -using System.IO; - -namespace UnityEditor.XCodeEditor -{ - public class XCodeEditorMenu - { - - //[MenuItem ("Build Tools/XCode Editor/DebugTest %t")] - static void DebugTest() - { - string projectPath = Path.Combine( Directory.GetParent( Application.dataPath ).ToString(), "XCode" ); -// Debug.Log( "XcodePath: " + projectPath ); - -// XCProject currentProject = new XCProject( projectPath ); - //XCProject.ApplyMod( projectPath, "/Users/Elyn/Projects/UnityPlugins/Unity Sandbox Project/Assets/Modules/GameCenter/Editor/iOS/GameCenter.projmods" ); - - //Debug.Log( -// PBXDictionary test = new PBXDictionary(); -// bool result = false; -// if( test is Dictionary ) -// result = true; -// -// Debug.Log( result ); - -// PBXType type = new PBXType(); -// Debug.Log( "TYPE: " + type["isa"] ); -// -// PBXBuildFile build = new PBXBuildFile( "" ); -// Debug.Log( "BUILDFILE: " + build["isa"] ); - -// Debug.Log( PBXObject.GenerateGuid().ToUpper() ); -// PBXList testList = currentProject.GetObjectOfType( "XCBuildConfiguration" ); -// Debug.Log( testList.Count ); -// Debug.Log( currentProject.rootGroup.guid + " " + currentProject.rootGroup.name + " " + currentProject.rootGroup.path); -// string path1 = "Data/mainData"; - -// string path2 = "/Users/Elyn/Projects/UnityPlugins/Modules/GameCenter/Editor/iOS/"; -// Debug.Log( "Objects: " + currentProject._objects.Count ); -// Debug.Log( "Files: " + currentProject.buildFiles.Count ); -// Debug.Log( "Groups: " + currentProject.groups.Count ); -// string[] excludes = new string[] {"^.*\\.meta$", "^.*\\.mdown^", "^.*\\.pdf$"}; -// currentProject.AddFolder( path2, null, excludes ); -// currentProject.Consolidate(); -// Debug.Log( "Objects: " + currentProject._objects.Count ); -// currentProject.Save(); - - //ALTRO -// currentProject.AddOtherCFlags( "TEST_FLAG" ); -// -// foreach( KeyValuePair config in currentProject.buildConfigurations ) { -// Debug.Log( "C: " + config.Value.buildSettings["OTHER_CFLAGS"] ); -// foreach( string keys in (PBXList)config.Value.buildSettings["OTHER_CFLAGS"] ) -// Debug.Log( keys ); -// } - -// currentProject.Save(); - - } - - - //[MenuItem ("Build Tools/XCode Editor/DebugTest2 %y")] - static void DebugTest2() - { - string path1 = "/Users/Elyn/Projects/UnityPlugins/Unity Sandbox Project/Assets/Modules/GameCenter/Editor/iOS/GameCenterManager.m"; - string path2 = "/Users/Elyn/Projects/UnityPlugins/Unity Sandbox Project/XCode/."; - - System.Uri fileURI = new System.Uri( path1 ); - System.Uri rootURI = new System.Uri( path2 ); - Debug.Log( fileURI.MakeRelativeUri( rootURI ).ToString() ); - Debug.Log( rootURI.MakeRelativeUri( fileURI ).ToString() ); - -// string projectPath = Path.Combine( Directory.GetParent( Application.dataPath ).ToString(), "XCode" ); - -// string[] files = System.IO.Directory.GetFiles( projectPath, "Info.plist" ); -// string contents = System.IO.File.OpenText( files[0] ).ReadToEnd(); - -// string[] projects = System.IO.Directory.GetDirectories( projectPath, "*.xcodeproj" ); -// string projPath = System.IO.Path.Combine( projects[0], "project.pbxproj" ); -// string contents = System.IO.File.OpenText( projPath ).ReadToEnd(); -// Debug.Log( System.IO.File.OpenText( projPath ).ReadToEnd ); - -// PBXParser parser = new PBXParser(); -// Hashtable test = (Hashtable)parser.Decode( contents ); -// PBXDictionary test = parser.Decode( contents ); -// Debug.Log( MiniJSON.jsonEncode( test ) ); -// Debug.Log( test + " - " + test.Count ); -// Debug.Log( parser.Encode( test ) ); - - - } - - } -} \ No newline at end of file From 6d64c10320a7ee36e8d0e1933db9877f7a10f205 Mon Sep 17 00:00:00 2001 From: William Manning Date: Fri, 27 Mar 2015 13:30:56 -0400 Subject: [PATCH 6/6] Remove unused code --- XCProject.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/XCProject.cs b/XCProject.cs index 86f24b0..f536c0f 100644 --- a/XCProject.cs +++ b/XCProject.cs @@ -428,8 +428,6 @@ public bool AddFolder( string folderPath, PBXGroup parent = null, string[] exclu exclude = new string[] {}; string regexExclude = string.Format( @"{0}", string.Join( "|", exclude ) ); - PBXDictionary results = new PBXDictionary(); - if( parent == null ) parent = rootGroup; @@ -528,7 +526,6 @@ public void ApplyMod( XCMod mod ) PBXGroup modGroup = this.GetGroup( mod.group ); Debug.Log( "Adding libraries..." ); - PBXGroup librariesGroup = this.GetGroup( "Libraries" ); foreach( XCModFile libRef in mod.libs ) { string completeLibPath = System.IO.Path.Combine( "usr/lib", libRef.filePath ); this.AddFile( completeLibPath, modGroup, "SDKROOT", true, libRef.isWeak );