From 24e4489f7e615f6d9133fced182636043631babc Mon Sep 17 00:00:00 2001 From: Oleg Orlov Date: Wed, 12 Feb 2014 20:29:55 +0400 Subject: [PATCH] Fix for #92 auto-loaded preprocessed files for OpenIAB.Unity.iOS --- .../Assets/Editor/PostprocessBuildPlayer | 37 +++++++++++++++++++ .../Editor/PostprocessBuildPlayer_OpenIAB | 18 +++++++++ 2 files changed, 55 insertions(+) create mode 100755 unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer create mode 100755 unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer_OpenIAB diff --git a/unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer b/unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer new file mode 100755 index 00000000..6ac7a9c3 --- /dev/null +++ b/unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer @@ -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, rob@stinkbot.com +# + +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; \ No newline at end of file diff --git a/unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer_OpenIAB b/unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer_OpenIAB new file mode 100755 index 00000000..54f9fd08 --- /dev/null +++ b/unity_plugin/unity_src/Assets/Editor/PostprocessBuildPlayer_OpenIAB @@ -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() \ No newline at end of file