summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-10-14 16:57:01 +0000
committerMatt A. Tobin <email@mattatobin.com>2021-10-14 14:59:59 -0400
commit38228cf5cd66dc06a044e00fa4020076e310c6d7 (patch)
tree327a790a5623ca8c03338f25da7f3acbdc20e0a6 /python
parent60e8b05a510f704758de029bec8c3c6429cc7d3c (diff)
downloadaura-central-38228cf5cd66dc06a044e00fa4020076e310c6d7.tar.gz
Issue %3020 - Part 2: First pass Android defines and remove Android Annotation
processors, some Andoid packaging stuff, Eclipse IDE support et al.
Diffstat (limited to 'python')
-rw-r--r--python/mozbuild/mozbuild/backend/recursivemake.py57
-rw-r--r--python/mozbuild/mozbuild/frontend/context.py86
-rw-r--r--python/mozbuild/mozbuild/frontend/emitter.py28
-rw-r--r--python/mozbuild/mozbuild/frontend/reader.py29
4 files changed, 0 insertions, 200 deletions
diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
index a314124f4..4a37b2966 100644
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -29,11 +29,6 @@ from mozbuild.frontend.context import (
)
from .common import CommonBackend
from ..frontend.data import (
- AndroidAssetsDirs,
- AndroidResDirs,
- AndroidExtraResDirs,
- AndroidExtraPackages,
- AndroidEclipseProjectData,
ChromeManifestEntry,
ConfigFileSubstitution,
ContextDerived,
@@ -75,13 +70,6 @@ from ..makeutil import Makefile
from mozbuild.shellutil import quote as shell_quote
MOZBUILD_VARIABLES = [
- b'ANDROID_APK_NAME',
- b'ANDROID_APK_PACKAGE',
- b'ANDROID_ASSETS_DIRS',
- b'ANDROID_EXTRA_PACKAGES',
- b'ANDROID_EXTRA_RES_DIRS',
- b'ANDROID_GENERATED_RESFILES',
- b'ANDROID_RES_DIRS',
b'ASFLAGS',
b'CMSRCS',
b'CMMSRCS',
@@ -137,7 +125,6 @@ MOZBUILD_VARIABLES = [
]
DEPRECATED_VARIABLES = [
- b'ANDROID_RESFILES',
b'EXPORT_LIBRARY',
b'EXTRA_LIBS',
b'HOST_LIBS',
@@ -568,8 +555,6 @@ class RecursiveMakeBackend(CommonBackend):
# automated.
if isinstance(obj.wrapped, JavaJarData):
self._process_java_jar_data(obj.wrapped, backend_file)
- elif isinstance(obj.wrapped, AndroidEclipseProjectData):
- self._process_android_eclipse_project_data(obj.wrapped, backend_file)
else:
return False
@@ -597,26 +582,6 @@ class RecursiveMakeBackend(CommonBackend):
elif isinstance(obj, ObjdirPreprocessedFiles):
self._process_final_target_pp_files(obj, obj.files, backend_file, 'OBJDIR_PP_FILES')
- elif isinstance(obj, AndroidResDirs):
- # Order matters.
- for p in obj.paths:
- backend_file.write('ANDROID_RES_DIRS += %s\n' % p.full_path)
-
- elif isinstance(obj, AndroidAssetsDirs):
- # Order matters.
- for p in obj.paths:
- backend_file.write('ANDROID_ASSETS_DIRS += %s\n' % p.full_path)
-
- elif isinstance(obj, AndroidExtraResDirs):
- # Order does not matter.
- for p in sorted(set(p.full_path for p in obj.paths)):
- backend_file.write('ANDROID_EXTRA_RES_DIRS += %s\n' % p)
-
- elif isinstance(obj, AndroidExtraPackages):
- # Order does not matter.
- for p in sorted(set(obj.packages)):
- backend_file.write('ANDROID_EXTRA_PACKAGES += %s\n' % p)
-
elif isinstance(obj, ChromeManifestEntry):
self._process_chrome_manifest_entry(obj, backend_file)
@@ -1118,28 +1083,6 @@ class RecursiveMakeBackend(CommonBackend):
backend_file.write('%s_JAVAC_FLAGS := %s\n' %
(target, ' '.join(jar.javac_flags)))
- def _process_android_eclipse_project_data(self, project, backend_file):
- # We add a single target to the backend.mk corresponding to
- # the moz.build defining the Android Eclipse project. This
- # target depends on some targets to be fresh, and installs a
- # manifest generated by the Android Eclipse build backend. The
- # manifests for all projects live in $TOPOBJDIR/android_eclipse
- # and are installed into subdirectories thereof.
-
- project_directory = mozpath.join(self.environment.topobjdir, 'android_eclipse', project.name)
- manifest_path = mozpath.join(self.environment.topobjdir, 'android_eclipse', '%s.manifest' % project.name)
-
- fragment = Makefile()
- rule = fragment.create_rule(targets=['ANDROID_ECLIPSE_PROJECT_%s' % project.name])
- rule.add_dependencies(project.recursive_make_targets)
- args = ['--no-remove',
- '--no-remove-all-directory-symlinks',
- '--no-remove-empty-directories',
- project_directory,
- manifest_path]
- rule.add_commands(['$(call py_action,process_install_manifest,%s)' % ' '.join(args)])
- fragment.dump(backend_file.fh, removal_guard=False)
-
def _process_shared_library(self, libdef, backend_file):
backend_file.write_once('LIBRARY_NAME := %s\n' % libdef.basename)
backend_file.write('FORCE_SHARED_LIB := 1\n')
diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py
index eb501dc66..f81665b52 100644
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -880,59 +880,6 @@ VARIABLES = {
"""),
# Variables controlling reading of other frontend files.
- 'ANDROID_GENERATED_RESFILES': (StrictOrderingOnAppendList, list,
- """Android resource files generated as part of the build.
-
- This variable contains a list of files that are expected to be
- generated (often by preprocessing) into a 'res' directory as
- part of the build process, and subsequently merged into an APK
- file.
- """),
-
- 'ANDROID_APK_NAME': (unicode, unicode,
- """The name of an Android APK file to generate.
- """),
-
- 'ANDROID_APK_PACKAGE': (unicode, unicode,
- """The name of the Android package to generate R.java for, like org.mozilla.gecko.
- """),
-
- 'ANDROID_EXTRA_PACKAGES': (StrictOrderingOnAppendList, list,
- """The name of extra Android packages to generate R.java for, like ['org.mozilla.other'].
- """),
-
- 'ANDROID_EXTRA_RES_DIRS': (ContextDerivedTypedListWithItems(Path, List), list,
- """Android extra package resource directories.
-
- This variable contains a list of directories containing static files
- to package into a 'res' directory and merge into an APK file. These
- directories are packaged into the APK but are assumed to be static
- unchecked dependencies that should not be otherwise re-distributed.
- """),
-
- 'ANDROID_RES_DIRS': (ContextDerivedTypedListWithItems(Path, List), list,
- """Android resource directories.
-
- This variable contains a list of directories containing static
- files to package into a 'res' directory and merge into an APK
- file.
- """),
-
- 'ANDROID_ASSETS_DIRS': (ContextDerivedTypedListWithItems(Path, List), list,
- """Android assets directories.
-
- This variable contains a list of directories containing static
- files to package into an 'assets' directory and merge into an
- APK file.
- """),
-
- 'ANDROID_ECLIPSE_PROJECT_TARGETS': (dict, dict,
- """Defines Android Eclipse project targets.
-
- This variable should not be populated directly. Instead, it should
- populated by calling add_android_eclipse{_library}_project().
- """),
-
'SOURCES': (ContextDerivedTypedListWithItems(Path, StrictOrderingOnAppendListWithFlagsFactory({'no_pgo': bool, 'flags': List})), list,
"""Source code files.
@@ -1511,10 +1458,6 @@ VARIABLES = {
"""List of manifest files defining jetpack addon tests.
"""),
- 'ANDROID_INSTRUMENTATION_MANIFESTS': (ManifestparserManifestList, list,
- """List of manifest files defining Android instrumentation tests.
- """),
-
'FIREFOX_UI_FUNCTIONAL_MANIFESTS': (ManifestparserManifestList, list,
"""List of manifest files defining firefox-ui-functional tests.
"""),
@@ -1878,35 +1821,6 @@ FUNCTIONS = {
:py:class:`mozbuild.frontend.data.JavaJarData`.
"""),
- 'add_android_eclipse_project': (
- lambda self: self._add_android_eclipse_project, (str, str),
- """Declare an Android Eclipse project.
-
- This is one of the supported ways to populate the
- ANDROID_ECLIPSE_PROJECT_TARGETS variable.
-
- The parameters are:
- * name - project name.
- * manifest - path to AndroidManifest.xml.
-
- This returns a rich Android Eclipse project type, described at
- :py:class:`mozbuild.frontend.data.AndroidEclipseProjectData`.
- """),
-
- 'add_android_eclipse_library_project': (
- lambda self: self._add_android_eclipse_library_project, (str,),
- """Declare an Android Eclipse library project.
-
- This is one of the supported ways to populate the
- ANDROID_ECLIPSE_PROJECT_TARGETS variable.
-
- The parameters are:
- * name - project name.
-
- This returns a rich Android Eclipse project type, described at
- :py:class:`mozbuild.frontend.data.AndroidEclipseProjectData`.
- """),
-
'export': (lambda self: self._export, (str,),
"""Make the specified variable available to all child directories.
diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
index 25c582662..49ec1e8d7 100644
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -23,10 +23,6 @@ import mozinfo
import pytoml
from .data import (
- AndroidAssetsDirs,
- AndroidExtraPackages,
- AndroidExtraResDirs,
- AndroidResDirs,
BaseSources,
BrandingFiles,
ChromeManifestEntry,
@@ -789,9 +785,6 @@ class TreeMetadataEmitter(LoggingMixin):
passthru = VariablePassthru(context)
varlist = [
'ALLOW_COMPILER_WARNINGS',
- 'ANDROID_APK_NAME',
- 'ANDROID_APK_PACKAGE',
- 'ANDROID_GENERATED_RESFILES',
'DISABLE_STL_WRAPPING',
'EXTRA_DSO_LDOPTS',
'PYTHON_UNIT_TESTS',
@@ -993,9 +986,6 @@ class TreeMetadataEmitter(LoggingMixin):
for name, jar in context.get('JAVA_JAR_TARGETS', {}).items():
yield ContextWrapped(context, jar)
- for name, data in context.get('ANDROID_ECLIPSE_PROJECT_TARGETS', {}).items():
- yield ContextWrapped(context, data)
-
if context.get('USE_YASM') is True:
yasm = context.config.substs.get('YASM')
if not yasm:
@@ -1004,24 +994,6 @@ class TreeMetadataEmitter(LoggingMixin):
passthru.variables['ASFLAGS'] = context.config.substs.get('YASM_ASFLAGS')
passthru.variables['AS_DASH_C_FLAG'] = ''
- for (symbol, cls) in [
- ('ANDROID_RES_DIRS', AndroidResDirs),
- ('ANDROID_EXTRA_RES_DIRS', AndroidExtraResDirs),
- ('ANDROID_ASSETS_DIRS', AndroidAssetsDirs)]:
- paths = context.get(symbol)
- if not paths:
- continue
- for p in paths:
- if isinstance(p, SourcePath) and not os.path.isdir(p.full_path):
- raise SandboxValidationError('Directory listed in '
- '%s is not a directory: \'%s\'' %
- (symbol, p.full_path), context)
- yield cls(context, paths)
-
- android_extra_packages = context.get('ANDROID_EXTRA_PACKAGES')
- if android_extra_packages:
- yield AndroidExtraPackages(context, android_extra_packages)
-
if passthru.variables:
yield passthru
diff --git a/python/mozbuild/mozbuild/frontend/reader.py b/python/mozbuild/mozbuild/frontend/reader.py
index 8192b1ec6..a7d7e8b71 100644
--- a/python/mozbuild/mozbuild/frontend/reader.py
+++ b/python/mozbuild/mozbuild/frontend/reader.py
@@ -53,7 +53,6 @@ from mozpack.files import FileFinder
import mozpack.path as mozpath
from .data import (
- AndroidEclipseProjectData,
JavaJarData,
)
@@ -263,34 +262,6 @@ class MozbuildSandbox(Sandbox):
self['JAVA_JAR_TARGETS'][name] = jar
return jar
- # Not exposed to the sandbox.
- def add_android_eclipse_project_helper(self, name):
- """Add an Android Eclipse project target."""
- if not name:
- raise Exception('Android Eclipse project cannot be registered without a name')
-
- if name in self['ANDROID_ECLIPSE_PROJECT_TARGETS']:
- raise Exception('Android Eclipse project has already been registered: %s' % name)
-
- data = AndroidEclipseProjectData(name)
- self['ANDROID_ECLIPSE_PROJECT_TARGETS'][name] = data
- return data
-
- def _add_android_eclipse_project(self, name, manifest):
- if not manifest:
- raise Exception('Android Eclipse project must specify a manifest')
-
- data = self.add_android_eclipse_project_helper(name)
- data.manifest = manifest
- data.is_library = False
- return data
-
- def _add_android_eclipse_library_project(self, name):
- data = self.add_android_eclipse_project_helper(name)
- data.manifest = None
- data.is_library = True
- return data
-
def _export(self, varname):
"""Export the variable to all subdirectories of the current path."""