Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/perl


# Searches for other PostprocessBuildPlayer scripts and executes them. Make sure the other script
# have a name suffix with an underscore "_" like "PostprocessBuildPlayer_AnotherBuild" or whatever.
#
# Based on script by Rob Terrell, [email protected]
#

use File::Glob ':glob';


# Dont run on any builds that are not iPhone builds
if( $ARGV[1] ne "iPhone" )
{
exit;
}



# Grab all the PostprocessBuildPlayer files
@files = bsd_glob( "Assets/Editor/postprocessbuildplayer_*", GLOB_NOCASE );

foreach $file( @files )
{
if( !( $file =~ m/\./ ) )
{
system( "chmod", "755", $file );
print "PostProcessBuildPlayer: calling " . $file . "\n";
system( $file, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3], $ARGV[4], $ARGV[5], $ARGV[6] );
}
}

# now we run the runner.py directly
$installPath = $ARGV[0];
$currDir = `pwd`;
chomp $currDir;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/perl

import sys
import os.path
import os.listdir
import copytree.shutil
import mod_pbxproj

if sys.argv[2] != "iPhone": sys.exit()

pbx_object_path = os.path.join(sys.argv[1], 'Unity-iPhone.xcodeproj/project.pbxproj')
pbx_object = XcodeProject.Load(pbx_file_path)

pbx_object.add_file('System/Library/Frameworks/StoreKit.framework', tree='SDKROOT')

pbx_object.add_other_ldflags('-ObjC')

pbx_object.save()