Skip to content

Commit

Permalink
Bug 1676815 - Factorize Linux bootstrapping of Android builds r=andi …
Browse files Browse the repository at this point in the history
…DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D96813
  • Loading branch information
gabrielesvelto committed Nov 12, 2020
1 parent b55fe19 commit 5a1bd0b
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 91 deletions.
14 changes: 1 addition & 13 deletions python/mozboot/mozboot/archlinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,7 @@ def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False)

# 2. Android pieces.
self.ensure_java(mozconfig_builder)
from mozboot import android

android.ensure_android(
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
)

def generate_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android

return android.generate_mozconfig("linux", artifact_mode=artifact_mode)

def generate_mobile_android_artifact_mode_mozconfig(self):
return self.generate_mobile_android_mozconfig(artifact_mode=True)
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)

def _update_package_manager(self):
self.pacman_update()
Expand Down
14 changes: 1 addition & 13 deletions python/mozboot/mozboot/centosfedora.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,7 @@ def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False)
self.dnf_install(*self.mobile_android_packages)

self.ensure_java(mozconfig_builder)
from mozboot import android

android.ensure_android(
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
)

def generate_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android

return android.generate_mozconfig("linux", artifact_mode=artifact_mode)

def generate_mobile_android_artifact_mode_mozconfig(self):
return self.generate_mobile_android_mozconfig(artifact_mode=True)
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)

def upgrade_mercurial(self, current):
if current is None:
Expand Down
14 changes: 1 addition & 13 deletions python/mozboot/mozboot/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,7 @@ def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False)

# 2. Android pieces.
self.ensure_java(mozconfig_builder)
from mozboot import android

android.ensure_android(
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
)

def generate_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android

return android.generate_mozconfig("linux", artifact_mode=artifact_mode)

def generate_mobile_android_artifact_mode_mozconfig(self):
return self.generate_mobile_android_mozconfig(artifact_mode=True)
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)

def _update_package_manager(self):
self.apt_update()
Expand Down
14 changes: 1 addition & 13 deletions python/mozboot/mozboot/gentoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,7 @@ def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False)
self.run_as_root(["emerge", "--noreplace", "--quiet", "dev-java/openjdk-bin"])

self.ensure_java(mozconfig_builder)
from mozboot import android

android.ensure_android(
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
)

def generate_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android

return android.generate_mozconfig("linux", artifact_mode=artifact_mode)

def generate_mobile_android_artifact_mode_mozconfig(self):
return self.generate_mobile_android_mozconfig(artifact_mode=True)
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)

def _update_package_manager(self):
self.run_as_root(["emerge", "--sync"])
Expand Down
21 changes: 21 additions & 0 deletions python/mozboot/mozboot/linux_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,33 @@ def ensure_dump_syms_packages(self, state_dir, checkout_root):
)


class MobileAndroidBootstrapper(object):
def __init__(self, **kwargs):
pass

def ensure_mobile_android_packages(self, artifact_mode=False):
from mozboot import android

android.ensure_android(
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
)

def generate_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android

return android.generate_mozconfig("linux", artifact_mode=artifact_mode)

def generate_mobile_android_artifact_mode_mozconfig(self):
return self.generate_mobile_android_mozconfig(artifact_mode=True)


class LinuxBootstrapper(
ClangStaticAnalysisInstall,
FixStacksInstall,
DumpSymsInstall,
LucetcInstall,
MinidumpStackwalkInstall,
MobileAndroidBootstrapper,
NasmInstall,
NodeInstall,
SccacheInstall,
Expand Down
14 changes: 1 addition & 13 deletions python/mozboot/mozboot/opensuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,7 @@ def ensure_mobile_android_packages(self, artifact_mode=False):
raise e

# 2. Android pieces.
from mozboot import android

android.ensure_android(
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
)

def generate_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android

return android.generate_mozconfig("linux", artifact_mode=artifact_mode)

def generate_mobile_android_artifact_mode_mozconfig(self):
return self.generate_mobile_android_mozconfig(artifact_mode=True)
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)

def _update_package_manager(self):
self.zypper_update
Expand Down
14 changes: 1 addition & 13 deletions python/mozboot/mozboot/solus.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,7 @@ def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False)

# 2. Android pieces.
self.ensure_java(mozconfig_builder)
from mozboot import android

android.ensure_android(
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
)

def generate_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android

return android.generate_mozconfig("linux", artifact_mode=artifact_mode)

def generate_mobile_android_artifact_mode_mozconfig(self):
return self.generate_mobile_android_mozconfig(artifact_mode=True)
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)

def _update_package_manager(self):
pass
Expand Down
14 changes: 1 addition & 13 deletions python/mozboot/mozboot/void.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,7 @@ def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False)

# 2. Android pieces.
self.ensure_java(mozconfig_builder)
from mozboot import android

android.ensure_android(
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
)

def generate_mobile_android_mozconfig(self, artifact_mode=False):
from mozboot import android

return android.generate_mozconfig("linux", artifact_mode=artifact_mode)

def generate_mobile_android_artifact_mode_mozconfig(self):
return self.generate_mobile_android_mozconfig(artifact_mode=True)
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)

def _update_package_manager(self):
self.xbps_update()

0 comments on commit 5a1bd0b

Please sign in to comment.