Skip to content

Commit ae23c0e

Browse files
committed
Add readme and licence files
1 parent 08d6253 commit ae23c0e

File tree

6 files changed

+98
-11
lines changed

6 files changed

+98
-11
lines changed

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2012 Daniele Cariola
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

LICENSE.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Readme.mdown

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# XCode Editor for Unity
2+
3+
## OVERVIEW
4+
5+
The purpose of this project is to allow editing an XCode 4 project.
6+
7+
This project is based upon the python project **Mod PBXProj** by Calvin Rien (http://the.darktable.com/). Due to the recent addiction of PostProcessBuild attribute to Unity, I found much useful having a C# version of the library.
8+
9+
10+
## INSTALLATION
11+
12+
Clone this repo somewhere under Assets/Editor in your project. If your project is not yet checked into git, then you'll need to do the appropriate setup and add this as a submodule (google: git-submodule).
13+
14+
If you already use git for your project, then just add this as a submodule.
15+
16+
17+
## LICENSE
18+
19+
This code is distributed under the terms and conditions of the MIT license.
20+
21+
Copyright (c) 2012 Daniele Cariola
22+
23+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
24+
25+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
26+
27+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Readme.mdown.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

XCMod.cs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class XCMod
1616
// private ArrayList folders;
1717
// private ArrayList excludes;
1818
private Hashtable _datastore;
19+
private ArrayList _libs;
1920

2021
public string name { get; private set; }
2122
public string path { get; private set; }
@@ -34,7 +35,13 @@ public ArrayList patches {
3435

3536
public ArrayList libs {
3637
get {
37-
return (ArrayList)_datastore["libs"];
38+
if( _libs == null ) {
39+
_libs = new ArrayList( ((ArrayList)_datastore["libs"]).Count );
40+
foreach( string fileRef in (ArrayList)_datastore["libs"] ) {
41+
_libs.Add( new XCModFile( fileRef ) );
42+
}
43+
}
44+
return _libs;
3845
}
3946
}
4047

@@ -90,7 +97,7 @@ public XCMod( string filename )
9097
// folders = (ArrayList)_datastore["folders"];
9198
// excludes = (ArrayList)_datastore["excludes"];
9299
}
93-
100+
94101

95102
// "group": "GameCenter",
96103
// "patches": [],
@@ -106,4 +113,24 @@ public XCMod( string filename )
106113
// "excludes": ["^.*\\.meta$", "^.*\\.mdown^", "^.*\\.pdf$"]
107114

108115
}
116+
117+
public class XCModFile
118+
{
119+
public string filePath { get; private set; }
120+
public bool isWeak { get; private set; }
121+
122+
public XCModFile( string inputString )
123+
{
124+
isWeak = false;
125+
126+
if( inputString.Contains( ":" ) ) {
127+
string[] parts = inputString.Split( ':' );
128+
filePath = parts[0];
129+
isWeak = ( parts[1].CompareTo( "weak" ) == 0 );
130+
}
131+
else {
132+
filePath = inputString;
133+
}
134+
}
135+
}
109136
}

XCProject.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,22 @@ public void ApplyMod( XCMod mod )
863863
{
864864
PBXGroup modGroup = this.GetGroup( mod.group );
865865

866+
Debug.Log( "Adding libraries..." );
867+
PBXGroup librariesGroup = this.GetGroup( "Libraries" );
868+
foreach( XCModFile libRef in mod.libs ) {
869+
string completeLibPath = System.IO.Path.Combine( "usr/lib", libRef.filePath );
870+
this.AddFile( completeLibPath, modGroup, "SDKROOT", true, libRef.isWeak );
871+
}
872+
873+
Debug.Log( "Adding frameworks..." );
874+
PBXGroup frameworkGroup = this.GetGroup( "Frameworks" );
875+
foreach( string framework in mod.frameworks ) {
876+
string[] filename = framework.Split( ':' );
877+
bool isWeak = ( filename.Length > 1 ) ? true : false;
878+
string completePath = System.IO.Path.Combine( "System/Library/Frameworks", filename[0] );
879+
this.AddFile( completePath, frameworkGroup, "SDKROOT", true, isWeak );
880+
}
881+
866882
Debug.Log( "Adding files..." );
867883
foreach( string filePath in mod.files ) {
868884
string absoluteFilePath = System.IO.Path.Combine( mod.path, filePath );
@@ -875,15 +891,6 @@ public void ApplyMod( XCMod mod )
875891
this.AddFolder( absoluteFolderPath, modGroup, (string[])mod.excludes.ToArray( typeof(string) ) );
876892
}
877893

878-
Debug.Log( "Adding frameworks..." );
879-
PBXGroup frameworkGroup = this.GetGroup( "Frameworks" );
880-
foreach( string framework in mod.frameworks ) {
881-
string[] filename = framework.Split( ':' );
882-
bool isWeak = ( filename.Length > 1 ) ? true : false;
883-
string completePath = System.IO.Path.Combine( "System/Library/Frameworks", filename[0] );
884-
this.AddFile( completePath, frameworkGroup, "SDKROOT", true, isWeak );
885-
}
886-
887894
Debug.Log( "Adding headerpaths..." );
888895
foreach( string headerpath in mod.headerpaths ) {
889896
string absoluteHeaderPath = System.IO.Path.Combine( mod.path, headerpath );

0 commit comments

Comments
 (0)