liuqilin a276060e72 增加微信支付 il y a 7 ans
..
ICSharpCode.SharpZipLib.dll a276060e72 增加微信支付 il y a 7 ans
ICSharpCode.SharpZipLib.dll.meta a276060e72 增加微信支付 il y a 7 ans
LICENSE a276060e72 增加微信支付 il y a 7 ans
LICENSE.meta a276060e72 增加微信支付 il y a 7 ans
PBXBuildFile.cs a276060e72 增加微信支付 il y a 7 ans
PBXBuildFile.cs.meta a276060e72 增加微信支付 il y a 7 ans
PBXBuildPhase.cs a276060e72 增加微信支付 il y a 7 ans
PBXBuildPhase.cs.meta a276060e72 增加微信支付 il y a 7 ans
PBXDictionary.cs a276060e72 增加微信支付 il y a 7 ans
PBXDictionary.cs.meta a276060e72 增加微信支付 il y a 7 ans
PBXFileReference.cs a276060e72 增加微信支付 il y a 7 ans
PBXFileReference.cs.meta a276060e72 增加微信支付 il y a 7 ans
PBXGroup.cs a276060e72 增加微信支付 il y a 7 ans
PBXGroup.cs.meta a276060e72 增加微信支付 il y a 7 ans
PBXList.cs a276060e72 增加微信支付 il y a 7 ans
PBXList.cs.meta a276060e72 增加微信支付 il y a 7 ans
PBXObject.cs a276060e72 增加微信支付 il y a 7 ans
PBXObject.cs.meta a276060e72 增加微信支付 il y a 7 ans
PBXParser.cs a276060e72 增加微信支付 il y a 7 ans
PBXParser.cs.meta a276060e72 增加微信支付 il y a 7 ans
PBXProject.cs a276060e72 增加微信支付 il y a 7 ans
PBXProject.cs.meta a276060e72 增加微信支付 il y a 7 ans
Readme.mdown a276060e72 增加微信支付 il y a 7 ans
Readme.mdown.meta a276060e72 增加微信支付 il y a 7 ans
XCBuildConfiguration.cs a276060e72 增加微信支付 il y a 7 ans
XCBuildConfiguration.cs.meta a276060e72 增加微信支付 il y a 7 ans
XCConfigurationList.cs a276060e72 增加微信支付 il y a 7 ans
XCConfigurationList.cs.meta a276060e72 增加微信支付 il y a 7 ans
XCFileOperationQueue.cs a276060e72 增加微信支付 il y a 7 ans
XCFileOperationQueue.cs.meta a276060e72 增加微信支付 il y a 7 ans
XCMod.cs a276060e72 增加微信支付 il y a 7 ans
XCMod.cs.meta a276060e72 增加微信支付 il y a 7 ans
XCProject.cs a276060e72 增加微信支付 il y a 7 ans
XCProject.cs.meta a276060e72 增加微信支付 il y a 7 ans
XCSourceFile.cs a276060e72 增加微信支付 il y a 7 ans
XCSourceFile.cs.meta a276060e72 增加微信支付 il y a 7 ans
XCTarget.cs a276060e72 增加微信支付 il y a 7 ans
XCTarget.cs.meta a276060e72 增加微信支付 il y a 7 ans
XCodeEditorMenu.cs a276060e72 增加微信支付 il y a 7 ans
XCodeEditorMenu.cs.meta a276060e72 增加微信支付 il y a 7 ans
ZipHelper.cs a276060e72 增加微信支付 il y a 7 ans
ZipHelper.cs.meta a276060e72 增加微信支付 il y a 7 ans

Readme.mdown

XCode Editor for Unity

OVERVIEW

The purpose of this project is to allow editing an XCode 4 project.

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.

INSTALLATION

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).

If you already use git for your project, then just add this as a submodule.

USAGE

You can use the XCProject class in any part of your editor and postprocess code. Taking advantage of the great powers of the new PostProcessBuild attribute, I suggest to use a small cs static class to run through all the projmods files in your asses folder and simply apply them to the newly created xcode project.

using UnityEditor;

public static class XCodePostProcess
{
    [PostProcessBuild]
    public static void OnPostProcessBuild( BuildTarget target, string path )
    {
        // Create a new project object from build target
        XCodeEditor.XCProject project = new XCodeEditor.XCProject( targetPath );

        // Find and run through all projmods files to patch the project
        var files = System.IO.Directory.GetFiles( Application.dataPath, "*.projmods", SearchOption.AllDirectories );
        foreach( var file in files ) {
            project.ApplyMod( file );
        }

        // Finally save the xcode project
        project.Save();
    }
}

The projmods file is a simple text file containing a JSON object. It will be used to pass the parameters to the ApplyMod method. This is the file I use for the GameCenter plugin as a brief example:

{
    "group":       "GameCenter",
    "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$"]
}
  • group: all files and folders will be parented to this group;
  • libs: add libraries to build phase;
  • frameworks: add frameworks to the project;
  • headerpaths: add header paths to build phase;
  • files: add single files to the project;
  • folders: create a subgroup and add all files to the project (recursive);
  • excludes: file mask to exclude;

Note: all paths are relative to projmods location

LICENSE

This code is distributed under the terms and conditions of the MIT license.

Copyright (c) 2012 Daniele Cariola

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.