Search Unity

.svn files in ipa

Discussion in 'iOS and tvOS' started by bpritchard, Oct 31, 2012.

  1. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    I'm pretty sure this isn't really unity related but i'm posting here as i'm not really able to find anything out in the world of the nets. Basically all of our code for xCode is stored in SVN... and when we build any version of the product (debug or to ipa or whatnot) it always includes the .svn files w/it. Does anyone have any experience with this? And if so.. how can i exclude those from the build project w/o exporting the project from svn and building that way?
     
  2. znoey

    znoey

    Joined:
    Oct 27, 2011
    Posts:
    174
    In XCode, you can add a custom build phase at the end of its compile chain to search the files and remove them based on however you'd like to do so.

    If you've never used bash to write a script for something, you'll wanna research that first as you'll be interacting with the shell to do so.
     
  3. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @znoey

    Well problem is that i can't delete those .svn files as they are needed by svn. Just not sure why xcode thinks those are part of the project and builds them into the device versions.
     
  4. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Think i figured it out for anyone who has this issue in the future. Basically the problem isn't w/xCode and the project but the Data folder that gets copied over after the build is complete.

    in xCode under Build Phases -> Run Script the function currently (default from unity) is

    cp -Rf "$PROJECT_DIR/Data/" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data"

    and i changed it to the following...

    rsync -r --exclude=.svn "$PROJECT_DIR/Data/" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Data"

    since cp doesn't support file exclusion but rsync does (and is part of all osx installs) that seemed to be the safer route to go.
     
  5. znoey

    znoey

    Joined:
    Oct 27, 2011
    Posts:
    174
    kudos for using rsync!

    Prior to doing unity apps, all of our assets were doing a similar method to transfer data to the application. Our script uses rsync too :D
     
  6. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Nice. Moving to SVN 1.7 gets rid of those pesky .svn files. I can't reccomend it enough
     
  7. cookcook

    cookcook

    Joined:
    Apr 16, 2013
    Posts:
    1
    I Change The cp -Rf,but I get an error when build "the assembly mscorlib.dll was not found or could not be loaded";

    What should I do?
     
  8. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    Not entirely sure why your getting that error, but i would make sure that you cut/paste EXACTLY the code from above... it works on all of our projects.

    And yes.. svn 1.7 is a god send.. too bad not everyone has adopted it yet. ;)