Commit b4fc97e32eabdc2cc397834162c148947351411e

Info.plist skeleton is generated in the application root if it doesn't exist. File is now copied to the mac package.

Commit diff

lib/app_bundler.rb

 
2121 copy_deployment_to @java_app_deploy_path
2222 generate_info_plist
2323 generate_pkg_info
24 deploy_info_plist
2425 deploy_artwork
2526 deploy_app_stub
2627 end
5656 end
5757 end
5858
59 def deploy_info_plist
60 cp "Info.plist", "#{@mac_app_path}/Contents/"
61 end
62
5963 def generate_info_plist
60 File.open "#{@mac_app_path}/Contents/Info.plist", 'w' do |file|
61 file << <<-INFO_ENDL
64 unless File.exists? "Info.plist"
65 File.open "Info.plist", 'w' do |file|
66 file << <<-INFO_ENDL
6267<?xml version="1.0" encoding="UTF-8"?>
6368<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
6469<plist version="0.9">
108108</dict>
109109</plist>
110110INFO_ENDL
111 end
111112 end
112113 end
113114 end
toggle raw diff

test/unit/app_bundler_spec.rb

 
44describe Rawr::AppBundler do
55 include CustomFileMatchers
66
7 it "creates the proper directory structure" do
7 it "creates the proper directory structure for a .app" do
88 begin
99 Rawr::AppBundler.new.create_clean_deployment_directory_structure("spec-temp", "spec-temp/native_deploy/mac", "spec-temp/native_deploy/mac/RawrSpec.app")
1010
1414 "spec-temp/native_deploy/mac/RawrSpec.app/Contents/Resources".should be_existing_file
1515 ensure
1616 FileUtils.rm_rf "spec-temp"
17 FileUtils.rm_f "Info.plist"
18 end
19 end
20
21 it "creates an Info.plist file if it didn't exist before in the application root" do
22 begin
23 "Info.plist".should_not be_existing_file
24
25 app_bundler = Rawr::AppBundler.new
26 app_bundler.generate_info_plist
27
28 "Info.plist".should be_existing_file
29 ensure
30 FileUtils.rm_f "Info.plist"
31 end
32 end
33
34 it "copies the Info.plist file to .app/Contents directory during packaging" do
35 begin
36 FileUtils.mkdir_p "spec-temp/native_deploy/mac/RawrSpec.app/Contents/"
37 File.open("Info.plist", File::CREAT) do |file|
38 file << ""
39 end
40
41 "spec-temp/native_deploy/mac/RawrSpec.app/Contents/Info.plist".should_not be_existing_file
42
43 app_bundler = Rawr::AppBundler.new
44 app_bundler.instance_variable_set(:@mac_app_path, "spec-temp/native_deploy/mac/RawrSpec.app")
45 app_bundler.deploy_info_plist
46
47 "spec-temp/native_deploy/mac/RawrSpec.app/Contents/Info.plist".should be_existing_file
48 ensure
49 FileUtils.rm_rf "spec-temp"
50 FileUtils.rm_f "Info.plist"
1751 end
1852 end
1953end
toggle raw diff