Sha256: 29abb5d8678ad538922bfd6dd1e86f13030879c81c7e91f313c9025f42736446
Contents?: true
Size: 1.24 KB
Versions: 2
Compression:
Stored size: 1.24 KB
Contents
require "rubygems" require "rake" Dir['tasks/**/*.rake'].each { |rake| load rake } namespace :objc do desc "Compiles all Objective-C bundles for testing" task :compile end task :compile => "objc:compile" namespace :objc do # look for Classes/*.m files containing a line "void Init_ClassName" # These are the primary classes for bundles; make a bundle for each model_file_paths = `find Classes/*.m -exec grep -l "^void Init_" {} \\;`.split("\n") model_file_paths.each do |path| path =~ /Classes\/(.*)\.m/ model_name = $1 task :compile => model_name do if Dir.glob("**/#{model_name}.bundle").length == 0 STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" STDERR.puts "Bundle actually failed to build." STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" exit(1) end end task model_name.to_sym => "build/bundles/#{model_name}.bundle" file "build/bundles/#{model_name}.bundle" => ["Classes/#{model_name}.m", "Classes/#{model_name}.h"] do |t| FileUtils.mkdir_p "build/bundles" FileUtils.rm Dir["build/bundles/#{model_name}.bundle"] sh "gcc -o build/bundles/#{model_name}.bundle -bundle -framework Foundation Classes/#{model_name}.m" end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
Empact-rbiphonetest-0.3.0 | app_generators/rbiphonetest/templates/Rakefile |
rbiphonetest-0.3.0 | app_generators/rbiphonetest/templates/Rakefile |