lib/ruboto/util/build.rb in ruboto-0.9.0.rc.1 vs lib/ruboto/util/build.rb in ruboto-0.9.0

- old
+ new

@@ -35,11 +35,11 @@ abort "ERROR: #{klass} not found" unless element unless force == "include" abort "#{klass} not available in minSdkVersion, added in #{element.attribute('api_added')}; use '--force include' to create it" if element.attribute('api_added') and element.attribute('api_added').to_i > verify_min_sdk.to_i - abort "#{klass} deprecated for targetSdkVersion, deprecatrd in #{element.attribute('deprecated')}; use '--force include' to create it" if + abort "#{klass} deprecated for targetSdkVersion, deprecated in #{element.attribute('deprecated')}; use '--force include' to create it" if element.attribute('deprecated') and element.attribute('deprecated').to_i <= verify_target_sdk.to_i end abort "#{klass} removed for targetSdkVersion, removed in #{element.attribute('api_removed')}" if element.attribute('api_removed') and element.attribute('api_removed').to_i <= verify_target_sdk.to_i @@ -53,12 +53,12 @@ def check_methods(methods, force=nil) min_api = verify_min_sdk.to_i target_api = verify_target_sdk.to_i # Remove methods changed outside of the scope of the sdk versions - methods = methods.select{|i| not i.attribute('api_added') or i.attribute('api_added').to_i <= target_api} - methods = methods.select{|i| not i.attribute('deprecated') or i.attribute('deprecated').to_i > min_api} - methods = methods.select{|i| not i.attribute('api_removed') or i.attribute('api_removed').to_i > min_api} + methods = methods.select{|i| !i.attribute('api_added') || (i.attribute('api_added').to_i <= target_api)} + methods = methods.select{|i| !i.attribute('deprecated') || (i.attribute('deprecated').to_i > min_api)} + methods = methods.select{|i| !i.attribute('api_removed') || (i.attribute('api_removed').to_i > min_api)} # Inform and remove methods that do not exist in one of the sdk versions methods = methods.select do |i| if i.attribute('api_removed') and i.attribute('api_removed').to_i <= target_api puts "Can't create #{i.method_signature} -- removed in #{i.attribute('api_removed')}"