2019-08-21 17:32:01 +02:00
|
|
|
import taskcluster
|
|
|
|
|
|
|
|
|
|
|
|
class VariantApk:
|
|
|
|
def __init__(self, build_type, abi, engine, file_name):
|
2019-05-27 15:00:44 +02:00
|
|
|
self.abi = abi
|
2019-09-18 12:49:22 +02:00
|
|
|
self.taskcluster_path = u'public/build/{}/{}/target.apk'.format(abi, engine)
|
2019-08-21 17:32:01 +02:00
|
|
|
self.absolute_path = '/opt/fenix/app/build/outputs/apk/{}/{}/{}'.format(engine, build_type, file_name)
|
|
|
|
|
|
|
|
|
|
|
|
class Variant:
|
|
|
|
def __init__(self, name, build_type, apks):
|
|
|
|
self.name = name
|
2019-05-27 15:00:44 +02:00
|
|
|
self.build_type = build_type
|
2019-08-21 17:32:01 +02:00
|
|
|
self._apks = apks
|
2019-05-27 15:00:44 +02:00
|
|
|
|
2019-08-27 23:08:17 +02:00
|
|
|
def get_apk(self, abi):
|
|
|
|
return [apk for apk in self._apks if apk.abi == abi][0]
|
|
|
|
|
2019-08-21 17:32:01 +02:00
|
|
|
def artifacts(self):
|
|
|
|
return {
|
|
|
|
apk.taskcluster_path: {
|
|
|
|
'type': 'file',
|
|
|
|
'path': apk.absolute_path,
|
|
|
|
'expires': taskcluster.stringDate(taskcluster.fromNow('1 year')),
|
|
|
|
} for apk in self._apks
|
|
|
|
}
|
2019-05-27 15:00:44 +02:00
|
|
|
|
2019-08-21 17:32:01 +02:00
|
|
|
def upstream_artifacts(self):
|
|
|
|
return [apk.taskcluster_path for apk in self._apks]
|
2019-09-18 11:40:14 +02:00
|
|
|
|
|
|
|
@property
|
|
|
|
def upstream_artifacts_per_abi(self):
|
|
|
|
return {apk.abi: apk.taskcluster_path for apk in self._apks}
|