示例#1
0
 def resolve_package_from_host(self, context):
     self.logger.debug('Resolving package on host system')
     if self.package_name:
         self.apk_file = context.get_resource(ApkFile(
             self.owner,
             variant=self.variant,
             version=self.version,
             package=self.package_name,
             exact_abi=self.exact_abi,
             supported_abi=self.supported_abi,
             min_version=self.min_version,
             max_version=self.max_version),
                                              strict=self.strict)
     else:
         available_packages = []
         for package in self.owner.package_names:
             apk_file = context.get_resource(ApkFile(
                 self.owner,
                 variant=self.variant,
                 version=self.version,
                 package=package,
                 exact_abi=self.exact_abi,
                 supported_abi=self.supported_abi,
                 min_version=self.min_version,
                 max_version=self.max_version),
                                             strict=self.strict)
             if apk_file:
                 available_packages.append(apk_file)
         if len(available_packages) == 1:
             self.apk_file = available_packages[0]
         elif len(available_packages) > 1:
             self.error_msg = self._get_package_error_msg('host')
示例#2
0
 def resolve_package_from_host(self, context):
     self.logger.debug('Resolving package on host system')
     if self.package_name:
         self.apk_file = context.get_resource(ApkFile(self.owner,
                                                      variant=self.variant,
                                                      version=self.version,
                                                      package=self.package_name,
                                                      exact_abi=self.exact_abi,
                                                      supported_abi=self.supported_abi),
                                              strict=self.strict)
     else:
         available_packages = []
         for package in self.owner.package_names:
             apk_file = context.get_resource(ApkFile(self.owner,
                                                     variant=self.variant,
                                                     version=self.version,
                                                     package=package,
                                                     exact_abi=self.exact_abi,
                                                     supported_abi=self.supported_abi),
                                             strict=self.strict)
             if apk_file:
                 available_packages.append(apk_file)
         if len(available_packages) == 1:
             self.apk_file = available_packages[0]
         elif len(available_packages) > 1:
             msg = 'Multiple matching packages found for "{}" on host: {}'
             self.error_msg = msg.format(self.owner, available_packages)
示例#3
0
 def init_resources(self, resolver):
     self.uiauto_file = resolver.get(ApkFile(self.owner, uiauto=True))
     if not self.uiauto_package:
         uiauto_info = get_cacheable_apk_info(self.uiauto_file)
         self.uiauto_package = uiauto_info.package