# HG changeset patch
# User Nick Alexander <nalexander@mozilla.com>
# Date 1520376784 28800
# Node ID c15be736fff0142881ff6129f18728dd96a6f7a7
# Parent  3ebf1fc64bf0074c4fee1928df7542bd30b60ea6
Bug 1443204 - Pre: Clean-up unused Android data structures in mozbuild frontend. r=chmanchester

MozReview-Commit-ID: 5ympxk0jSJq

diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -24,20 +24,16 @@ from mozbuild.frontend.context import (
     AbsolutePath,
     Path,
     RenamedSourcePath,
     SourcePath,
     ObjDirPath,
 )
 from .common import CommonBackend
 from ..frontend.data import (
-    AndroidAssetsDirs,
-    AndroidResDirs,
-    AndroidExtraResDirs,
-    AndroidExtraPackages,
     BaseLibrary,
     BaseProgram,
     ChromeManifestEntry,
     ComputedFlags,
     ConfigFileSubstitution,
     ContextDerived,
     Defines,
     DirectoryTraversal,
diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -1003,69 +1003,16 @@ class GeneratedFile(ContextDerived):
             '.inc',
             '.py',
             '.rs',
             'new', # 'new' is an output from make-stl-wrappers.py
         )
         self.required_for_compile = any(f.endswith(suffixes) for f in self.outputs)
 
 
-class AndroidResDirs(ContextDerived):
-    """Represents Android resource directories."""
-
-    __slots__ = (
-        'paths',
-    )
-
-    def __init__(self, context, paths):
-        ContextDerived.__init__(self, context)
-        self.paths = paths
-
-
-class AndroidAssetsDirs(ContextDerived):
-    """Represents Android assets directories."""
-
-    __slots__ = (
-        'paths',
-    )
-
-    def __init__(self, context, paths):
-        ContextDerived.__init__(self, context)
-        self.paths = paths
-
-
-class AndroidExtraResDirs(ContextDerived):
-    """Represents Android extra resource directories.
-
-    Extra resources are resources provided by libraries and including in a
-    packaged APK, but not otherwise redistributed.  In practice, this means
-    resources included in Fennec but not in GeckoView.
-    """
-
-    __slots__ = (
-        'paths',
-    )
-
-    def __init__(self, context, paths):
-        ContextDerived.__init__(self, context)
-        self.paths = paths
-
-
-class AndroidExtraPackages(ContextDerived):
-    """Represents Android extra packages."""
-
-    __slots__ = (
-        'packages',
-    )
-
-    def __init__(self, context, packages):
-        ContextDerived.__init__(self, context)
-        self.packages = packages
-
-
 class ChromeManifestEntry(ContextDerived):
     """Represents a chrome.manifest entry."""
 
     __slots__ = (
         'path',
         'entry',
     )
 
diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -18,20 +18,16 @@ from mozbuild.util import (
     OrderedDefaultDict,
 )
 
 import mozpack.path as mozpath
 import mozinfo
 import pytoml
 
 from .data import (
-    AndroidAssetsDirs,
-    AndroidExtraPackages,
-    AndroidExtraResDirs,
-    AndroidResDirs,
     BaseSources,
     ChromeManifestEntry,
     ComputedFlags,
     ConfigFileSubstitution,
     Defines,
     DirectoryTraversal,
     Exports,
     FinalTargetFiles,
@@ -1334,28 +1330,29 @@ class TreeMetadataEmitter(LoggingMixin):
                     if not os.path.exists(script):
                         raise SandboxValidationError(
                             'Script for generating %s does not exist: %s'
                             % (f, script), context)
                     if os.path.splitext(script)[1] != '.py':
                         raise SandboxValidationError(
                             'Script for generating %s does not end in .py: %s'
                             % (f, script), context)
-
-                    for i in flags.inputs:
-                        p = Path(context, i)
-                        if (isinstance(p, SourcePath) and
-                                not os.path.exists(p.full_path)):
-                            raise SandboxValidationError(
-                                'Input for generating %s does not exist: %s'
-                                % (f, p.full_path), context)
-                        inputs.append(p)
                 else:
                     script = None
                     method = None
+
+                for i in flags.inputs:
+                    p = Path(context, i)
+                    if (isinstance(p, SourcePath) and
+                            not os.path.exists(p.full_path)):
+                        raise SandboxValidationError(
+                            'Input for generating %s does not exist: %s'
+                            % (f, p.full_path), context)
+                    inputs.append(p)
+
                 yield GeneratedFile(context, script, method, outputs, inputs,
                                     flags.flags, localized=localized)
 
     def _process_test_manifests(self, context):
         for prefix, info in TEST_MANIFESTS.items():
             for path, manifest in context.get('%s_MANIFESTS' % prefix, []):
                 for obj in self._process_test_manifest(context, info, path, manifest):
                     yield obj
diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -9,17 +9,16 @@ import unittest
 
 from mozunit import main
 
 from mozbuild.frontend.context import (
     ObjDirPath,
     Path,
 )
 from mozbuild.frontend.data import (
-    AndroidResDirs,
     ChromeManifestEntry,
     ComputedFlags,
     ConfigFileSubstitution,
     Defines,
     DirectoryTraversal,
     Exports,
     FinalTargetPreprocessedFiles,
     GeneratedFile,
