Module: AppThwack::Packaging

Defined in:
lib/ruby_appthwack/packaging.rb

Class Method Summary collapse

Class Method Details

.create_calabash_package(proj_id, src, opts = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ruby_appthwack/packaging.rb', line 12

def create_calabash_package proj_id, src, opts = {}
    o = { :include_tests=> ["*.feature"], :exclude_tests=> nil}.merge opts

    # create the archive if it doesn't already exist
    unless File.extname(src) == '.zip'
        # delete any old archives we have laying about
        File.delete(src + '.zip') if File.exists?(src + '.zip')

        included = (o[:include_tests].map { |t| "'#{src}/#{t}'"}).join(' ')
        excluded = if o[:exclude_tests]; "-x #{ (o[:exclude_tests].map { |t| "'#{calabash}/#{t}'"}).join(' ') }" else "" end
 
        `zip #{src}.zip #{src} . -r #{excluded} -i '#{src}/support/*' '#{src}/step_definitions/*' #{included}`
    end

    src << '.zip'

    return src
end

.create_ipa(scheme) ⇒ Object



5
6
7
8
9
10
# File 'lib/ruby_appthwack/packaging.rb', line 5

def create_ipa(scheme)
  #uses Shenzhen gem
  abort unless system "ipa build --scheme #{scheme} --configuration Release --no-archive"

  return Dir.glob('*.ipa').first
end