Skip to content

Commit

Permalink
use Rake alá Frank
Browse files Browse the repository at this point in the history
  • Loading branch information
krukow committed Jan 6, 2013
1 parent 0b19193 commit 68a30d8
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#From https://github.com/moredip/Frank
#See LICENSE for licensing information

def discover_latest_sdk_version
latest_iphone_sdk = `xcodebuild -showsdks | grep -o "iphoneos.*$"`.chomp
version_part = latest_iphone_sdk[/iphoneos(.*)/,1]
version_part
end

def build_dir
File.expand_path 'build'
end

def build_cmd(arch)
%Q[xcodebuild -scheme Framework -configuration Debug -sdk #{arch}#{discover_latest_sdk_version} BUILD_DIR=\"#{build_dir}\" GCC_PREPROCESSOR_DEFINITIONS="\\$(inherited) DEBUG=0" clean build]
end

desc "Build the arm library"
task :build_lib do
sh build_cmd(:iphoneos)
end

task :copy_to_dist do
sh "cp #{build_dir}/Debug-iphoneos/libCalabash.a dist/"
end

desc "clean build artifacts"
task :clean do
rm_rf 'dist'
rm_rf "#{build_dir}"
end

desc "create dist directory"
task :prep_dist do
mkdir_p 'dist'
mkdir_p "#{build_dir}"
end

task :build => [:clean, :prep_dist, :build_lib, :copy_to_dist]
task :default => :build

0 comments on commit 68a30d8

Please sign in to comment.