Permalink
Browse files

add bundle identifier string per dj2

  • Loading branch information...
1 parent 0325412 commit 415c9b9016843a8299337e8c2fb896e1097d591c @richkilmer committed Jan 26, 2010
Showing with 6 additions and 3 deletions.
  1. +5 −3 lib/hotcocoa/application_builder.rb
  2. +1 −0 template/config/build.yml
@@ -8,12 +8,13 @@ class ApplicationBuilder
class Configuration
- attr_reader :name, :version, :icon, :resources, :sources, :info_string, :load
+ attr_reader :name, :identifier, :version, :icon, :resources, :sources, :info_string, :load
def initialize(file)
require 'yaml'
yml = YAML.load(File.read(file))
@name = yml["name"]
+ @identifier = yml["identifier"]
@load = yml["load"]
@version = yml["version"] || "1.0"
@icon = yml["icon"]
@@ -35,7 +36,7 @@ def icon_exist?
ApplicationBundlePackage = "APPL????"
- attr_accessor :name, :load_file, :sources, :overwrite, :icon, :version, :info_string, :resources, :deploy
+ attr_accessor :name, :identifier, :load_file, :sources, :overwrite, :icon, :version, :info_string, :resources, :deploy
def self.build(config, options={:deploy => false})
if !config.kind_of?(Configuration) || !$LOADED_FEATURES.detect {|f| f.include?("standard_rake_tasks")}
@@ -47,6 +48,7 @@ def self.build(config, options={:deploy => false})
builder = new
builder.deploy = options[:deploy] == true ? true : false
builder.name = config.name
+ builder.identifier = config.identifier
builder.load_file = config.load
builder.icon = config.icon if config.icon_exist?
builder.version = config.version
@@ -182,7 +184,7 @@ def write_info_plist_file
f.puts %{ <key>CFBundleExecutable</key>}
f.puts %{ <string>#{name.gsub(/ /, '')}</string>}
f.puts %{ <key>CFBundleIdentifier</key>}
- f.puts %{ <string>com.yourcompany.#{name}</string>}
+ f.puts %{ <string>#{identifier}</string>}
f.puts %{ <key>CFBundleInfoDictionaryVersion</key>}
f.puts %{ <string>6.0</string>}
f.puts %{ <key>CFBundleName</key>}
@@ -1,5 +1,6 @@
name: __APPLICATION_NAME__
load: lib/application.rb
+identifier: com.yourcompany.__APPLICATION_NAME__
version: "1.0"
icon: resources/HotCocoa.icns
resources:

0 comments on commit 415c9b9

Please sign in to comment.