Class: Motion::Project::App

Inherits:
Object
  • Object
show all
Defined in:
lib/acknowledgements/resources.rb

Class Method Summary collapse

Class Method Details

.build(platform, options = {}) ⇒ Object



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
# File 'lib/acknowledgements/resources.rb', line 8

def build platform, options = {}
  acknowledgements = MotionAcknowledgements::Settings.new
  root_path = acknowledgements.plist_file

  unless File.exist? root_path
    warn 'Please run: `rake acknowledgements:generate` in order to create a Settings.bundle or remove the motion-acknowledgements gem from your project.'
    abort
  end

  # Run the normal build process.
  build_before_copy_acknowledgements(platform, options)
  # Now the app is built, but not codesigned yet.

  destination = File.join(config.app_bundle(platform), 'Settings.bundle/Acknowledgements.plist')
  pods_path = 'vendor/Pods/Pods-acknowledgements.plist'
  pods_alt_path = 'vendor/Pods/Target Support Files/Pods-RubyMotion/Pods-RubyMotion-acknowledgements.plist'

  if File.exist? pods_path
    info 'Copy', destination
    FileUtils.cp_r(pods_path, destination, :remove_destination => true)
  else
    if File.exist? pods_alt_path
      info 'Copy', destination
      FileUtils.cp_r(pods_alt_path, destination, :remove_destination => true)
    else
      warn 'Could not find CocoaPods Acknowledgement file.'
    end
  end
end

.build_before_copy_acknowledgementsObject

The original ‘build’ method can be found here: github.com/HipByte/RubyMotion/blob/master/lib/motion/project/app.rb#L75-L77



7
# File 'lib/acknowledgements/resources.rb', line 7

alias_method :build_before_copy_acknowledgements, :build