Sha256: 4bce254e0ef420e438fb41db2f6a5f23350180e6ddb3f8cb8ef7408ea51e541c
Contents?: true
Size: 1.36 KB
Versions: 2
Compression:
Stored size: 1.36 KB
Contents
require "rubygems" require "rake" require "rake/testtask" task :default => :test Rake::TestTask.new do |t| t.libs << "test" << "test/bundles" t.test_files = FileList['test/test*.rb'] t.verbose = true end namespace :objc do desc "Compiles all Objective-C bundles for testing" task :compile end task :compile => "objc:compile" task :test => :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" 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 & 1 rubygems
Version | Path |
---|---|
iphoneruby-0.1.0 | app_generators/iphoneruby/templates/Rakefile |
iphoneruby-0.1.1 | app_generators/iphoneruby/templates/Rakefile |