bin/calabash-android-build.rb in calabash-android-0.4.10.pre2 vs bin/calabash-android-build.rb in calabash-android-0.4.10.pre3

- old
+ new

@@ -24,13 +24,12 @@ test_server_file_name = test_server_path(app) FileUtils.mkdir_p File.dirname(test_server_file_name) unless File.exist? File.dirname(test_server_file_name) unsigned_test_apk = File.join(File.dirname(__FILE__), '..', 'lib/calabash-android/lib/TestServer.apk') - platforms = Dir["#{android_home_path}/platforms/android-*"].sort_by { |item| '%08s' % item.split('-').last } - android_platform = platforms.last - raise "No Android SDK found in #{ENV["ANDROID_HOME"].gsub("\\", "/")}/platforms/" unless android_platform + + android_platform = Env.android_platform_path Dir.mktmpdir do |workspace_dir| Dir.chdir(workspace_dir) do FileUtils.cp(unsigned_test_apk, "TestServer.apk") FileUtils.cp(File.join(File.dirname(__FILE__), '..', 'test-server/AndroidManifest.xml'), "AndroidManifest.xml") @@ -40,10 +39,10 @@ unless system %Q{"#{RbConfig.ruby}" -pi.bak -e "gsub(/#testPackage#/, '#{package_name(app)}.test')" AndroidManifest.xml} raise "Could not replace test package name in manifest" end - unless system %Q{"#{tools_dir}/aapt" package -M AndroidManifest.xml -I "#{android_platform}/android.jar" -F dummy.apk} + unless system %Q{"#{Env.tools_dir}/aapt" package -M AndroidManifest.xml -I "#{android_platform}/android.jar" -F dummy.apk} raise "Could not create dummy.apk" end Zip::ZipFile.new("dummy.apk").extract("AndroidManifest.xml","customAndroidManifest.xml") Zip::ZipFile.open("TestServer.apk") do |zip_file|