mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-22 03:44:03 +08:00
add device deployment support
This commit is contained in:
@@ -27,8 +27,9 @@ end
|
||||
|
||||
desc "Run the simulator"
|
||||
task :simulator => ['build:simulator'] do
|
||||
app = Rubixir::CONFIG.app_bundle('iPhoneSimulator', true)
|
||||
sim = File.join(Rubixir::CONFIG.platform_dir('iPhoneSimulator'), '/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator')
|
||||
sh "\"#{sim}\" -SimulateApplication \"#{Rubixir::CONFIG.app_bundle('iPhoneSimulator', true)}\""
|
||||
sh "\"#{sim}\" -SimulateApplication \"#{app}\""
|
||||
end
|
||||
|
||||
desc "Create an .ipa package"
|
||||
@@ -45,8 +46,9 @@ task :package => ['build:ios'] do
|
||||
end
|
||||
|
||||
desc "Deploy on the device"
|
||||
task :deploy do
|
||||
# TODO
|
||||
task :deploy => :package do
|
||||
deploy = File.join(Rubixir::CONFIG.datadir, 'deploy')
|
||||
sh "#{deploy} #{Rubixir::CONFIG.archive}"
|
||||
end
|
||||
|
||||
desc "Clear build objects"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Rubixir
|
||||
class Builder
|
||||
def build(config, platform)
|
||||
datadir = File.join(File.dirname(__FILE__), '../../../data')
|
||||
datadir = config.datadir
|
||||
libstatic = File.join(datadir, 'libmacruby-static.a')
|
||||
archs = Dir.glob(File.join(datadir, platform, '*.bc')).map do |path|
|
||||
path.scan(/kernel-(.+).bc$/)[0][0]
|
||||
|
||||
@@ -16,6 +16,10 @@ module Rubixir
|
||||
@bundle_signature = '????'
|
||||
end
|
||||
|
||||
def datadir
|
||||
File.expand_path(File.join(File.dirname(__FILE__), '../../../data'))
|
||||
end
|
||||
|
||||
def platform_dir(platform)
|
||||
File.join(@platforms_dir, platform + '.platform')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user