Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

PostProcess Build Scripts / Adding files to the Xcode Project

Discussion in 'Unity Cloud Build' started by BigToe, Sep 2, 2014.

  1. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    172
    I have a Python Post Processing build script that modifies the Xcode Project for adding in system libraries, setting flags as well adding in directly some third party sdks. (I am assuming these work fine with cloud build)

    The the third part sdks are located elsewhere on my drive, outside of the Assets folder. They live there mainly because some of them produce errors when they are in Unity, and a couple of them are shared by multiple projects.

    My main question is where is the best location location for additional files that I may be adding with a PostProcessor script, that can still be accessed in the CloudBuild? Would it be the project root that contains the Assets and Library folder?
     
  2. hypeNate

    hypeNate

    Joined:
    Apr 4, 2014
    Posts:
    258
    @BigToe - when you set up your project, you can specify a subfolder where your Unity-specific project files are located. So your repo might be organized like this:

    - root/
    - - - /myUnityProject
    - - - /otherSDKs

    You would need to set the subfolder to be "/myUnityProject/" and then in your Python script, you can look for "/otherSDKs/" outside the Unity folder.

    Hope this helps!
     
  3. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    172
    That does help. Of course I didn't set up my repo with subfolders :) so I'm going to try adding the an SDK folder to the root of the project and see if I can get it working.

    Thank you.

     
  4. hypeNate

    hypeNate

    Joined:
    Apr 4, 2014
    Posts:
    258
  5. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    172
    Wow. Thank you. I think that was a really huge move and people are going to be pretty excited about it. I will try to give it a look in the next day or so.

     
    hypeNate likes this.
  6. BigToe

    BigToe

    Joined:
    Nov 1, 2010
    Posts:
    172
    I have started using the Xcode Manipulation API and overall it is great. I do have a question regarding adding in a dynamic library. I am trying to add in "libz.1.2.5.dylib" or maybe just "libz.1.dylib".

    If I add them in through Xcode, I do it through the "Link Binary with Libraries" from Build Phases. If I try to add in the "lib.1.2.5.dylib" or "libz.1.dylib"using the PBXProject.addFrameworkToProject(), it adds the file, but it is in red in Xcode which would mean that it is missing.

    proj.AddFrameworkToProject(target, "libz.1.dylib", false);

    I can copy it our of its location in the iOS SDK and add it to my Unity project, copy it to my BuildProject directory, then add it to the Frameworks, but this seems really ineloquent.

    Any advise for the best way to add in the dynamic libraries to Xcode?

    Thanks
     
  7. David-Berger

    David-Berger

    Unity Technologies

    Joined:
    Jul 16, 2014
    Posts:
    646
    I see you already got answer here. You might continue the discussion there, as the iOS forum has specialists for the XCode manipulation API monitoring the posts. :)

    Btw. there is a collection of different XCode Manipulation API topics and samples here.
     
  8. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    401
    Unity dudes, could you please address this simple question ..

    @David-Berger

    How to simply "copy one file" (say, an audio file or image) from the Unity folder to the built Xcode folder ..

    https://stackoverflow.com/questions...-how-exactly-do-you-simply-copy-over-one-file



    result in Xcode ...





    Code (CSharp):
    1.  
    2.         project.AddFileToBuild(g, something something something);
    It's totally unclear and undocumented how AddFileToBuild works .. thanks

    Again, simply add one file to the target Bundle in Xcode ... (imagine a .txt data file, an audio file or whatever).