-
Notifications
You must be signed in to change notification settings - Fork 11
/
Rakefile
69 lines (57 loc) · 2.25 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'
begin
require 'bundler'
Bundler.require
rescue LoadError
end
Motion::Project::App.setup do |app|
app.name = 'Hacker Bar'
app.version = "1.2.1"
app.short_version = (`git rev-list HEAD --count`.strip.to_i).to_s
app.icon = 'AppIcon.icns'
app.identifier = "com.mohawkapps.#{app.name.gsub(' ', '-').downcase}"
app.info_plist['LSUIElement'] = true
app.frameworks += ['ServiceManagement', 'IOKit', 'CoreFoundation']
app.copyright = "Copyright © 2014 Off the Grid Apps, LLC.\nAll rights reserved."
app.deployment_target = "10.8"
app.archs['MacOSX'] = ['x86_64']
app.pods do
pod 'Mixpanel-OSX-Community', :git => "https://github.com/orta/mixpanel-osx-unofficial.git"
pod 'Ono'
end
app.vendor_project('vendor/time_ago_in_words', :static, :cflags => '-fobjc-arc')
app.vendor_project('vendor/UniqueIdentifier', :static, :cflags => '-fobjc-arc')
app.entitlements['com.apple.security.app-sandbox'] = true
app.entitlements['com.apple.security.network.client'] = true
app.category = "news"
app.release do
app.info_plist['AppStoreRelease'] = true
# Internet Release
# app.codesign_certificate = "Developer ID Application: Mohawk Apps, LLC (DW9QQZR4ZL)"
# App Store Release
app.codesign_certificate = "3rd Party Mac Developer Application: Mohawk Apps, LLC (DW9QQZR4ZL)"
end
end
class Motion::Project::App
class << self
#
# The original `build' method can be found here:
# https://github.com/HipByte/RubyMotion/blob/master/lib/motion/project/app.rb#L75-L77
#
alias_method :build_before_copy_helper, :build
def build platform, options = {}
helper_name = "HackerBarLauncher"
# First let the normal `build' method perform its work.
build_before_copy_helper(platform, options)
# Now the app is built, but not codesigned yet.
destination = File.join(config.app_bundle(platform), 'Library/LoginItems')
info 'Create', destination
FileUtils.mkdir_p destination
helper_path = File.join("./#{helper_name}", config.versionized_build_dir(platform)[1..-1], "#{helper_name}.app")
info 'Copy', helper_path
FileUtils.cp_r helper_path, destination
end
end
end