Skip to content

Instantly share code, notes, and snippets.

@holgersindbaek
Created May 21, 2014 15:29
Show Gist options
  • Save holgersindbaek/e575699a4d8dce61b98a to your computer and use it in GitHub Desktop.
Save holgersindbaek/e575699a4d8dce61b98a to your computer and use it in GitHub Desktop.
Rakefile for failing Game Center application
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'
begin
require 'bundler'
Bundler.require
rescue LoadError
end
require 'awesome_print_motion'
require 'sugarcube-uikit'
require 'sugarcube-color'
require 'sugarcube-attributedstring'
require 'sugarcube-nsuserdefaults'
require 'sugarcube-nsdate'
require 'sugarcube-animations'
require 'bubble-wrap/core'
require 'bubble-wrap/reactor'
require 'teacup'
require 'vendor'
Motion::Project::App.setup do |app|
# Standard settings
app.name = '2048 • Free'
app.version = '1.0'
app.short_version = '1.0'
app.frameworks += [ 'ServiceManagement', 'CFNetwork', 'SystemConfiguration', 'QuartzCore', 'GameKit', 'Security']
app.resources_dirs = ['resources/Images/Icons_PNG', 'resources/Images/Status_Bar_Icons_PNG', 'resources/Images/Assets_PNG', 'resources/Fonts', 'resources/Sounds']
app.deployment_target = '10.8'
app.sdk_version = '10.8'
app.identifier = 'com.holgersindbaek.2048.free'
app.vendor_project('vendor/Static', :static, :cflags => '-fobjc-arc')
# Add dependencies
app.detect_dependencies = true
app.files_dependencies 'app/controllers/root_controller.rb' => 'app/controllers/constants_helper.rb'
app.files_dependencies 'app/controllers/root_controller.rb' => 'app/controllers/method_helper.rb'
app.files_dependencies 'app/controllers/root_controller.rb' => 'app/controllers/root_helper.rb'
# Sandbox app
app.codesign_for_development = true
app.entitlements['com.apple.security.app-sandbox'] = true
app.entitlements['com.apple.security.network.client'] = true
app.entitlements['com.apple.developer.game-center'] = true
# To allow gamecenter to authenticate user when app is sandboxed
app.entitlements['com.apple.security.temporary-exception.mach-lookup.global-name'] = ["com.apple.gamed.osx"]
# Hide dock icon
app.info_plist['ATSApplicationFontsPath'] = "Fonts"
# Include icons
app.info_plist["CFBundleIconFile"] = "Icons.icns"
# Add cocoapods
app.pods do
pod 'RHAdditions', '~> 1.3.0'
pod 'ANSegmentedControl', :path => '~/Projects/*Defaults/Misc/Cocoapods/ANSegmentedControl'
pod "Mixpanel-OSX-Community", :git => "https://github.com/orta/mixpanel-osx-unofficial.git"
pod 'INAppStoreWindow', '~> 1.4'
end
# Codesign certificate
app.development do
app.codesign_certificate = "Mac Developer: Something somehting"
end
app.release do
app.codesign_certificate = "3rd Party Mac Developer Application: Something somehting"
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 = {}
# 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.dirname(__FILE__)+'/2048-free-app-launcher/build/MacOSX-10.8-Release/2048-free-app-launcher.app'
info 'Copy', helper_path
FileUtils.cp_r helper_path, destination
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment