Created
March 17, 2014 20:50
-
-
Save zdennis/9608082 to your computer and use it in GitHub Desktop.
Add a Rakefile for generating a bridgesupport file whenever the project is built in XCode. This is for RubyMotion when building out a third-party library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIR = File.dirname(__FILE__) | |
BRIDGESUPPORT_FILE = "BridgeSupport.bridgesupport" | |
namespace :gen do | |
desc "Generates the bridgesupport file for RubyMotion" | |
task :bridgesupport do | |
Dir.chdir(DIR) do | |
SHELL_COMMAND=<<-EOS.gsub(/^\s*/, '') | |
#!/bin/sh | |
BRIDGESUPPORT_INCLUDES=`find . -type d | ruby -e "puts '-I' + STDIN.read.split(/\n/).join(' -I')"` | |
BRIDGESUPPORT_FILES=`find . -name "*.h" | ruby -e "puts STDIN.read.split(/\n/).join(' ')"` | |
echo gen_bridge_metadata -F complete --no-64-bit -c \\\"$BRIDGESUPPORT_INCLUDES\\\" $BRIDGESUPPORT_FILES -o #{BRIDGESUPPORT_FILE} | |
EOS | |
command = `#{SHELL_COMMAND}` | |
system command | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inside of Motion::Project::App.setup do/end blocks add | |
app.bridgesupport_files << File.dirname(File.dirname(__FILE__)) + "/YOUR_TARGET_NAME/BridgeSupport.bridgesupport" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $SRCROOT && cd $TARGET_NAME && rake gen:bridgesupport |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment