bin/testautoa in testautoa-0.4.2.pre1 vs bin/testautoa in testautoa-0.4.2

- old
+ new

@@ -232,16 +232,10 @@ # mount smbfs location = location.tr('\\','/') username = username.tr('\\',';').tr('/',';') raise "The build drop location is incorrect" if not location.start_with?("//") - paths = location.split('/') - if paths.size > 4 - location = paths.shift(4).join('/') - @settings["build_drop_branch_dir"] = [paths.join('/'), @settings["build_drop_branch_dir"]].join('/') - @settings["build_drop_trunk_dir"] = [paths.join('/'), @settings["build_drop_trunk_dir"]].join('/') - end cmd = "mount -t smbfs //'#{username}':#{password}@#{location[2..-1]} #{mount_node}" output=`#{cmd}` ; result=$?.success? raise "the command '#{cmd}' failed" if result == false mount_node end @@ -290,13 +284,11 @@ release_path = File.join(mount_node, @settings["build_drop_trunk_dir"]) else # copy the version build release_path = File.join(mount_node, @settings["build_drop_branch_dir"], "Android#{ARGV.first}/Release") end - raise "No builds found in #{release_path}" unless File.directory?(release_path) build_dir = Dir.entries(release_path).reject{|d|d.start_with?('.')}.sort_by{|c| File.stat(File.join(release_path,c)).ctime}.last - raise "No builds found in #{release_path}" if build_dir == nil apk_file = "ConcurMobile.apk" source = File.join(release_path, build_dir, apk_file) raise "the file '#{source}' does not exist" if not File.exists?(source) FileUtils.copy(source, File.join(FileUtils.pwd, apk_file)) puts "Copy the build from #{source}" @@ -317,12 +309,12 @@ else feature = ARGV.first + (ARGV.first.end_with?('/')? '' : '/') uri = URI.join(uri, feature) puts `svn export --force #{uri} features --username #{username} --password #{password}` - uri = URI.join(@settings["svn_location"], "_support/", "support/") - puts `svn export --force #{uri} features/support --username #{username} --password #{password}` + #uri = URI.join(@settings["svn_location"], "_support/", "support/") + #puts `svn export --force #{uri} features/support --username #{username} --password #{password}` uri = URI.join(@settings["svn_location"], "_support/", "step_definition/") puts `svn export --force #{uri} features/step_definitions --username #{username} --password #{password}` end end @@ -332,15 +324,11 @@ end def adb_path_w_sn raise_if_android_home_not_set serial_number = @settings["device_serialno"].to_s.strip - serial_number = " -s #{serial_number}" unless serial_number.empty? - adb_path + serial_number -end - -def adb_shell(command) - system("#{adb_path_w_sn} shell #{command}") + serial_number = "-s #{serial_number}" unless serial_number.empty? + File.join(ENV['ANDROID_HOME'], 'platform-tools', 'adb') + " " + serial_number end def android_path raise_if_android_home_not_set File.join(ENV['ANDROID_HOME'], 'tools', 'android')