bin/briar_xtc.rb in briar-1.0.0 vs bin/briar_xtc.rb in briar-1.0.1

- old
+ new

@@ -39,10 +39,11 @@ default_opts = {:build_script => ENV['IPA_BUILD_SCRIPT'], :ipa => ENV['IPA'], :profiles => ENV['XTC_PROFILES'], :account => expect_xtc_account(), :other_gems => ENV['XTC_OTHER_GEMS_FILE'], + :xtc_staging_dir => expect_xtc_staging_dir(), :briar_dev => ENV['XTC_BRIAR_GEM_DEV'] == '1', :calabash_dev => ENV['XTC_CALABASH_GEM_DEV'] == '1', :rebuild => true} @@ -91,35 +92,31 @@ next if line.strip.length == 0 or line.chars.to_a.first.eql?('#') other_gems << line.strip end end - if opts[:briar_dev] or opts[:calabash_dev] + xtc_gemfile = "#{opts[:xtc_staging_dir]}/Gemfile" - xtc_gemfile = './xamarin/Gemfile' + File.open(xtc_gemfile, 'w') do |file| + file.write("source 'https://rubygems.org'\n") + if opts[:briar_dev] + briar_version = `bundle exec briar version`.strip + file.write("gem 'briar', '#{briar_version}'\n") + else + file.write("gem 'briar'\n") + end - File.open(xtc_gemfile, 'w') do |file| - file.write("source 'https://rubygems.org'\n") - if opts[:calabash_dev] - calabash_version = `bundle exec calabash-ios version`.strip - file.write("gem 'calabash-cucumber', '#{calabash_version}'\n") - else - file.write("gem 'calabash-cucumber'\n") - end - - if opts[:briar_dev] - briar_version = `bundle exec briar version`.strip - file.write("gem 'briar', '#{briar_version}'\n") - else - file.write("gem 'briar'\n") - end - - other_gems.each do |gem| - file.write("#{gem}\n") - end + if opts[:calabash_dev] + calabash_version = `bundle exec calabash-ios version`.strip + file.write("gem 'calabash-cucumber', '#{calabash_version}'\n") + elsif not opts[:briar_dev] + file.write("gem 'calabash-cucumber'\n") end + other_gems.each do |gem| + file.write("#{gem}\n") + end end sets = read_device_sets if sets[device_set] device_set = sets[device_set] @@ -129,11 +126,11 @@ ipa = File.basename(File.expand_path(expect_ipa(opts[:ipa]))) cmd = "DEBUG=0 test-cloud submit #{ipa} #{api_key} -d #{device_set} -c cucumber.yml -p #{profile}" puts Rainbow("cd xamarin; #{cmd}").green - Dir.chdir('./xamarin') do + Dir.chdir(opts[:xtc_staging_dir]) do exec cmd end end @@ -163,6 +160,5 @@ @log.warn{ "expected at most 3 args by found '#{args}' - ignoring extra input" } end briar_xtc_submit(device_set, profile, opts) end -