diff options
author | Moonchild <moonchild@palemoon.org> | 2022-07-21 08:39:20 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-07-21 08:39:43 +0000 |
commit | a5421542e5fbeb2167cbdd4b2e19e7482a227ca7 (patch) | |
tree | cade7c97c86b23195a3b961f9b6d7cc31374fa89 /python | |
parent | 9800079bc2d9eaf1f7dfd3c4db128af147eba1a4 (diff) | |
download | uxp-a5421542e5fbeb2167cbdd4b2e19e7482a227ca7.tar.gz |
Issue #1837 - Remove unused build back-ends from the tree.
This leaves just use of recursive make to build applications.
Diffstat (limited to 'python')
-rw-r--r-- | python/moz.build | 1 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/backend/__init__.py | 11 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/backend/base.py | 55 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/backend/common.py | 36 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/backend/configenvironment.py | 4 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/backend/cpp_eclipse.py | 685 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/backend/fastermake.py | 165 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/backend/mach_commands.py | 123 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/backend/visualstudio.py | 582 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/codecoverage/__init__.py | 0 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/codecoverage/chrome_map.py | 105 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/codecoverage/packager.py | 43 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/config_status.py | 17 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/mach_commands.py | 150 | ||||
-rw-r--r-- | python/mozbuild/mozbuild/test/backend/test_visualstudio.py | 64 |
15 files changed, 3 insertions, 2038 deletions
diff --git a/python/moz.build b/python/moz.build index 108b986b55..819d1db9d8 100644 --- a/python/moz.build +++ b/python/moz.build @@ -27,7 +27,6 @@ PYTHON_UNIT_TESTS += [ 'mozbuild/mozbuild/test/backend/test_build.py', 'mozbuild/mozbuild/test/backend/test_configenvironment.py', 'mozbuild/mozbuild/test/backend/test_recursivemake.py', - 'mozbuild/mozbuild/test/backend/test_visualstudio.py', 'mozbuild/mozbuild/test/compilation/test_warnings.py', 'mozbuild/mozbuild/test/configure/lint.py', 'mozbuild/mozbuild/test/configure/test_checks_configure.py', diff --git a/python/mozbuild/mozbuild/backend/__init__.py b/python/mozbuild/mozbuild/backend/__init__.py index 7093e0c83f..fede9cf9c7 100644 --- a/python/mozbuild/mozbuild/backend/__init__.py +++ b/python/mozbuild/mozbuild/backend/__init__.py @@ -3,23 +3,12 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. backends = { - 'ChromeMap': 'mozbuild.codecoverage.chrome_map', 'CompileDB': 'mozbuild.compilation.database', - 'CppEclipse': 'mozbuild.backend.cpp_eclipse', - 'FasterMake': 'mozbuild.backend.fastermake', - 'FasterMake+RecursiveMake': None, 'RecursiveMake': 'mozbuild.backend.recursivemake', - 'Tup': 'mozbuild.backend.tup', - 'VisualStudio': 'mozbuild.backend.visualstudio', } def get_backend_class(name): - if '+' in name: - from mozbuild.backend.base import HybridBackend - return HybridBackend(*(get_backend_class(name) - for name in name.split('+'))) - class_name = '%sBackend' % name module = __import__(backends[name], globals(), locals(), [class_name]) return getattr(module, class_name) diff --git a/python/mozbuild/mozbuild/backend/base.py b/python/mozbuild/mozbuild/backend/base.py index f5e0c2d3c8..c46a3b1397 100644 --- a/python/mozbuild/mozbuild/backend/base.py +++ b/python/mozbuild/mozbuild/backend/base.py @@ -125,13 +125,11 @@ class BuildBackend(LoggingMixin): for obj in objs: obj_start = time.time() - if (not self.consume_object(obj) and - not isinstance(self, PartialBackend)): + if (not self.consume_object(obj)): raise Exception('Unhandled object of type %s' % type(obj)) self._execution_time += time.time() - obj_start - if (isinstance(obj, ContextDerived) and - not isinstance(self, PartialBackend)): + if (isinstance(obj, ContextDerived)): self.backend_input_files |= obj.context_all_paths # Pull in all loaded Python as dependencies so any Python changes that @@ -266,52 +264,3 @@ class BuildBackend(LoggingMixin): with self._write_file(obj.output_path) as fh: pp.out = fh yield pp - - -class PartialBackend(BuildBackend): - """A PartialBackend is a BuildBackend declaring that its consume_object - method may not handle all build configuration objects it's passed, and - that it's fine.""" - - -def HybridBackend(*backends): - """A HybridBackend is the combination of one or more PartialBackends - with a non-partial BuildBackend. - - Build configuration objects are passed to each backend, stopping at the - first of them that declares having handled them. - """ - assert len(backends) >= 2 - assert all(issubclass(b, PartialBackend) for b in backends[:-1]) - assert not(issubclass(backends[-1], PartialBackend)) - assert all(issubclass(b, BuildBackend) for b in backends) - - class TheHybridBackend(BuildBackend): - def __init__(self, environment): - self._backends = [b(environment) for b in backends] - super(TheHybridBackend, self).__init__(environment) - - def consume_object(self, obj): - return any(b.consume_object(obj) for b in self._backends) - - def consume_finished(self): - for backend in self._backends: - backend.consume_finished() - - for attr in ('_execution_time', '_created_count', '_updated_count', - '_unchanged_count', '_deleted_count'): - setattr(self, attr, - sum(getattr(b, attr) for b in self._backends)) - - for b in self._backends: - self.file_diffs.update(b.file_diffs) - for attr in ('backend_input_files', '_backend_output_files'): - files = getattr(self, attr) - files |= getattr(b, attr) - - name = '+'.join(itertools.chain( - (b.__name__.replace('Backend', '') for b in backends[:1]), - (b.__name__ for b in backends[-1:]) - )) - - return type(str(name), (TheHybridBackend,), {}) diff --git a/python/mozbuild/mozbuild/backend/common.py b/python/mozbuild/mozbuild/backend/common.py index 12b2a27c45..a90aa1e5d5 100644 --- a/python/mozbuild/mozbuild/backend/common.py +++ b/python/mozbuild/mozbuild/backend/common.py @@ -252,71 +252,35 @@ class CommonBackend(BuildBackend): # We should consider aggregating WebIDL types in emitter.py. elif isinstance(obj, WebIDLFile): - # WebIDL isn't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - self._webidls.sources.add(mozpath.join(obj.srcdir, obj.basename)) elif isinstance(obj, GeneratedEventWebIDLFile): - # WebIDL isn't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - self._webidls.generated_events_sources.add(mozpath.join( obj.srcdir, obj.basename)) elif isinstance(obj, TestWebIDLFile): - # WebIDL isn't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - self._webidls.test_sources.add(mozpath.join(obj.srcdir, obj.basename)) elif isinstance(obj, PreprocessedTestWebIDLFile): - # WebIDL isn't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - self._webidls.preprocessed_test_sources.add(mozpath.join( obj.srcdir, obj.basename)) elif isinstance(obj, GeneratedWebIDLFile): - # WebIDL isn't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - self._webidls.generated_sources.add(mozpath.join(obj.srcdir, obj.basename)) elif isinstance(obj, PreprocessedWebIDLFile): - # WebIDL isn't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - self._webidls.preprocessed_sources.add(mozpath.join( obj.srcdir, obj.basename)) elif isinstance(obj, ExampleWebIDLInterface): - # WebIDL isn't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - self._webidls.example_interfaces.add(obj.name) elif isinstance(obj, IPDLFile): - # IPDL isn't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - self._ipdl_sources.add(mozpath.join(obj.srcdir, obj.basename)) elif isinstance(obj, UnifiedSources): - # Unified sources aren't relevant to artifact builds. - if self.environment.is_artifact_build: - return True - if obj.have_unified_mapping: self._write_unified_files(obj.unified_source_mapping, obj.objdir) if hasattr(self, '_process_unified_sources'): diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py index 331309af6d..0edcf53660 100644 --- a/python/mozbuild/mozbuild/backend/configenvironment.py +++ b/python/mozbuild/mozbuild/backend/configenvironment.py @@ -187,10 +187,6 @@ class ConfigEnvironment(object): self.substs_unicode = ReadOnlyDict(self.substs_unicode) - @property - def is_artifact_build(self): - return self.substs.get('MOZ_ARTIFACT_BUILDS', False) - @staticmethod def from_config_status(path): config = BuildConfig.from_config_status(path) diff --git a/python/mozbuild/mozbuild/backend/cpp_eclipse.py b/python/mozbuild/mozbuild/backend/cpp_eclipse.py deleted file mode 100644 index ae89df5b20..0000000000 --- a/python/mozbuild/mozbuild/backend/cpp_eclipse.py +++ /dev/null @@ -1,685 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from __future__ import absolute_import - -import errno -import random -import os -import subprocess -import types -import xml.etree.ElementTree as ET -from .common import CommonBackend - -from ..frontend.data import ( - Defines, -) -from mozbuild.base import ExecutionSummary - -# TODO Have ./mach eclipse generate the workspace and index it: -# /Users/bgirard/mozilla/eclipse/eclipse/eclipse/eclipse -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data $PWD/workspace -importAll $PWD/eclipse -# Open eclipse: -# /Users/bgirard/mozilla/eclipse/eclipse/eclipse/eclipse -data $PWD/workspace - -class CppEclipseBackend(CommonBackend): - """Backend that generates Cpp Eclipse project files. - """ - - def __init__(self, environment): - if os.name == 'nt': - raise Exception('Eclipse is not supported on Windows. ' - 'Consider using Visual Studio instead.') - super(CppEclipseBackend, self).__init__(environment) - - def _init(self): - CommonBackend._init(self) - - self._paths_to_defines = {} - self._project_name = 'Gecko' - self._workspace_dir = self._get_workspace_path() - self._project_dir = os.path.join(self._workspace_dir, self._project_name) - self._overwriting_workspace = os.path.isdir(self._workspace_dir) - - self._macbundle = self.environment.substs['MOZ_MACBUNDLE_NAME'] - self._appname = self.environment.substs['MOZ_APP_NAME'] - self._bin_suffix = self.environment.substs['BIN_SUFFIX'] - self._cxx = self.environment.substs['CXX'] - # Note: We need the C Pre Processor (CPP) flags, not the CXX flags - self._cppflags = self.environment.substs.get('CPPFLAGS', '') - - def summary(self): - return ExecutionSummary( - 'CppEclipse backend executed in {execution_time:.2f}s\n' - 'Generated Cpp Eclipse workspace in "{workspace:s}".\n' - 'If missing, import the project using File > Import > General > Existing Project into workspace\n' - '\n' - 'Run with: eclipse -data {workspace:s}\n', - execution_time=self._execution_time, - workspace=self._workspace_dir) - - def _get_workspace_path(self): - return CppEclipseBackend.get_workspace_path(self.environment.topsrcdir, self.environment.topobjdir) - - @staticmethod - def get_workspace_path(topsrcdir, topobjdir): - # Eclipse doesn't support having the workspace inside the srcdir. - # Since most people have their objdir inside their srcdir it's easier - # and more consistent to just put the workspace along side the srcdir - srcdir_parent = os.path.dirname(topsrcdir) - workspace_dirname = "eclipse_" + os.path.basename(topobjdir) - return os.path.join(srcdir_parent, workspace_dirname) - - def consume_object(self, obj): - reldir = getattr(obj, 'relativedir', None) - - # Note that unlike VS, Eclipse' indexer seem to crawl the headers and - # isn't picky about the local includes. - if isinstance(obj, Defines): - self._paths_to_defines.setdefault(reldir, {}).update(obj.defines) - - return True - - def consume_finished(self): - settings_dir = os.path.join(self._project_dir, '.settings') - launch_dir = os.path.join(self._project_dir, 'RunConfigurations') - workspace_settings_dir = os.path.join(self._workspace_dir, '.metadata/.plugins/org.eclipse.core.runtime/.settings') - workspace_language_dir = os.path.join(self._workspace_dir, '.metadata/.plugins/org.eclipse.cdt.core') - - for dir_name in [self._project_dir, settings_dir, launch_dir, workspace_settings_dir, workspace_language_dir]: - try: - os.makedirs(dir_name) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - project_path = os.path.join(self._project_dir, '.project') - with open(project_path, 'wb') as fh: - self._write_project(fh) - - cproject_path = os.path.join(self._project_dir, '.cproject') - with open(cproject_path, 'wb') as fh: - self._write_cproject(fh) - - language_path = os.path.join(settings_dir, 'language.settings.xml') - with open(language_path, 'wb') as fh: - self._write_language_settings(fh) - - workspace_language_path = os.path.join(workspace_language_dir, 'language.settings.xml') - with open(workspace_language_path, 'wb') as fh: - workspace_lang_settings = WORKSPACE_LANGUAGE_SETTINGS_TEMPLATE - workspace_lang_settings = workspace_lang_settings.replace("@COMPILER_FLAGS@", self._cxx + " " + self._cppflags); - fh.write(workspace_lang_settings) - - self._write_launch_files(launch_dir) - - # This will show up as an 'unmanged' formatter. This can be named by generating - # another file. - formatter_prefs_path = os.path.join(settings_dir, 'org.eclipse.cdt.core.prefs') - with open(formatter_prefs_path, 'wb') as fh: - fh.write(FORMATTER_SETTINGS); - - editor_prefs_path = os.path.join(workspace_settings_dir, "org.eclipse.ui.editors.prefs"); - with open(editor_prefs_path, 'wb') as fh: - fh.write(EDITOR_SETTINGS); - - # Now import the project into the workspace - self._import_project() - - def _import_project(self): - # If the workspace already exists then don't import the project again because - # eclipse doesn't handle this properly - if self._overwriting_workspace: - return - - # We disable the indexer otherwise we're forced to index - # the whole codebase when importing the project. Indexing the project can take 20 minutes. - self._write_noindex() - - try: - process = subprocess.check_call( - ["eclipse", "-application", "-nosplash", - "org.eclipse.cdt.managedbuilder.core.headlessbuild", - "-data", self._workspace_dir, "-importAll", self._project_dir]) - finally: - self._remove_noindex() - - def _write_noindex(self): - noindex_path = os.path.join(self._project_dir, '.settings/org.eclipse.cdt.core.prefs') - with open(noindex_path, 'wb') as fh: - fh.write(NOINDEX_TEMPLATE); - - def _remove_noindex(self): - noindex_path = os.path.join(self._project_dir, '.settings/org.eclipse.cdt.core.prefs') - os.remove(noindex_path) - - def _define_entry(self, name, value): - define = ET.Element('entry') - define.set('kind', 'macro') - define.set('name', name) - define.set('value', value) - return ET.tostring(define) - - def _write_language_settings(self, fh): - settings = LANGUAGE_SETTINGS_TEMPLATE - - settings = settings.replace('@GLOBAL_INCLUDE_PATH@', os.path.join(self.environment.topobjdir, 'dist/include')) - settings = settings.replace('@NSPR_INCLUDE_PATH@', os.path.join(self.environment.topobjdir, 'dist/include/nspr')) - settings = settings.replace('@IPDL_INCLUDE_PATH@', os.path.join(self.environment.topobjdir, 'ipc/ipdl/_ipdlheaders')) - settings = settings.replace('@PREINCLUDE_FILE_PATH@', os.path.join(self.environment.topobjdir, 'dist/include/mozilla-config.h')) - settings = settings.replace('@DEFINE_MOZILLA_INTERNAL_API@', self._define_entry('MOZILLA_INTERNAL_API', '1')) - settings = settings.replace("@COMPILER_FLAGS@", self._cxx + " " + self._cppflags); - - fh.write(settings) - - def _write_launch_files(self, launch_dir): - bin_dir = os.path.join(self.environment.topobjdir, 'dist') - - # TODO Improve binary detection - if self._macbundle: - exe_path = os.path.join(bin_dir, self._macbundle, 'Contents/MacOS') - else: - exe_path = os.path.join(bin_dir, 'bin') - - exe_path = os.path.join(exe_path, self._appname + self._bin_suffix) - - main_gecko_launch = os.path.join(launch_dir, 'gecko.launch') - with open(main_gecko_launch, 'wb') as fh: - launch = GECKO_LAUNCH_CONFIG_TEMPLATE - launch = launch.replace('@LAUNCH_PROGRAM@', exe_path) - launch = launch.replace('@LAUNCH_ARGS@', '-P -no-remote') - fh.write(launch) - - #TODO Add more launch configs (and delegate calls to mach) - - def _write_project(self, fh): - project = PROJECT_TEMPLATE; - - project = project.replace('@PROJECT_NAME@', self._project_name) - project = project.replace('@PROJECT_TOPSRCDIR@', self.environment.topsrcdir) - fh.write(project) - - def _write_cproject(self, fh): - cproject_header = CPROJECT_TEMPLATE_HEADER - cproject_header = cproject_header.replace('@PROJECT_TOPSRCDIR@', self.environment.topobjdir) - cproject_header = cproject_header.replace('@MACH_COMMAND@', os.path.join(self.environment.topsrcdir, 'mach')) - fh.write(cproject_header) - - for path, defines in self._paths_to_defines.items(): - folderinfo = CPROJECT_TEMPLATE_FOLDER_INFO_HEADER - folderinfo = folderinfo.replace('@FOLDER_ID@', str(random.randint(1000000, 99999999999))) - folderinfo = folderinfo.replace('@FOLDER_NAME@', 'tree/' + path) - fh.write(folderinfo) - for k, v in defines.items(): - define = ET.Element('listOptionValue') - define.set('builtIn', 'false') - define.set('value', str(k) + "=" + str(v)) - fh.write(ET.tostring(define)) - fh.write(CPROJECT_TEMPLATE_FOLDER_INFO_FOOTER) - - - fh.write(CPROJECT_TEMPLATE_FOOTER) - - -PROJECT_TEMPLATE = """<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>@PROJECT_NAME@</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> - <triggers>clean,full,incremental,</triggers> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> - <triggers></triggers> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.cdt.core.cnature</nature> - <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> - </natures> - <linkedResources> - <link> - <name>tree</name> - <type>2</type> - <location>@PROJECT_TOPSRCDIR@</location> - </link> - </linkedResources> - <filteredResources> - <filter> - <id>17111971</id> - <name>tree</name> - <type>30</type> - <matcher> - <id>org.eclipse.ui.ide.multiFilter</id> - <arguments>1.0-name-matches-false-false-obj-*</arguments> - </matcher> - </filter> - <filter> - <id>14081994</id> - <name>tree</name> - <type>22</type> - <matcher> - <id>org.eclipse.ui.ide.multiFilter</id> - <arguments>1.0-name-matches-false-false-*.rej</arguments> - </matcher> - </filter> - <filter> - <id>25121970</id> - <name>tree</name> - <type>22</type> - <matcher> - <id>org.eclipse.ui.ide.multiFilter</id> - <arguments>1.0-name-matches-false-false-*.orig</arguments> - </matcher> - </filter> - <filter> - <id>10102004</id> - <name>tree</name> - <type>10</type> - <matcher> - <id>org.eclipse.ui.ide.multiFilter</id> - <arguments>1.0-name-matches-false-false-.hg</arguments> - </matcher> - </filter> - <filter> - <id>23122002</id> - <name>tree</name> - <type>22</type> - <matcher> - <id>org.eclipse.ui.ide.multiFilter</id> - <arguments>1.0-name-matches-false-false-*.pyc</arguments> - </matcher> - </filter> - </filteredResources> -</projectDescription> -""" - -CPROJECT_TEMPLATE_HEADER = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?> - -<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> - <storageModule moduleId="org.eclipse.cdt.core.settings"> - <cconfiguration id="0.1674256904"> - <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1674256904" moduleId="org.eclipse.cdt.core.settings" name="Default"> - <externalSettings/> - <extensions> - <extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> - </extensions> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <configuration artifactName="${ProjName}" buildProperties="" description="" id="0.1674256904" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg"> - <folderInfo id="0.1674256904." name="/" resourcePath=""> - <toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.1276586933" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug"> - <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.710759961" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/> - <builder arguments="--log-no-times build" buildPath="@PROJECT_TOPSRCDIR@" command="@MACH_COMMAND@" enableCleanBuild="false" incrementalBuildTarget="binaries" id="org.eclipse.cdt.build.core.settings.default.builder.1437267827" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/> - </toolChain> - </folderInfo> -""" -CPROJECT_TEMPLATE_FOLDER_INFO_HEADER = """ - <folderInfo id="0.1674256904.@FOLDER_ID@" name="/" resourcePath="@FOLDER_NAME@"> - <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1022318069" name="No ToolChain" superClass="org.eclipse.cdt.build.core.prefbase.toolchain" unusedChildren=""> - <tool id="org.eclipse.cdt.build.core.settings.holder.libs.1259030812" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs.1800697532"/> - <tool id="org.eclipse.cdt.build.core.settings.holder.1407291069" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder.582514939"> - <option id="org.eclipse.cdt.build.core.settings.holder.symbols.1907658087" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols"> -""" -CPROJECT_TEMPLATE_FOLDER_INFO_DEFINE = """ - <listOptionValue builtIn="false" value="@FOLDER_DEFINE@"/> -""" -CPROJECT_TEMPLATE_FOLDER_INFO_FOOTER = """ - </option> - <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.440601711" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> - </tool> - </toolChain> - </folderInfo> -""" -CPROJECT_TEMPLATE_FILEINFO = """ <fileInfo id="0.1674256904.474736658" name="Layers.cpp" rcbsApplicability="disable" resourcePath="tree/gfx/layers/Layers.cpp" toolsToInvoke="org.eclipse.cdt.build.core.settings.holder.582514939.463639939"> - <tool id="org.eclipse.cdt.build.core.settings.holder.582514939.463639939" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder.582514939"> - <option id="org.eclipse.cdt.build.core.settings.holder.symbols.232300236" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols"> - <listOptionValue builtIn="false" value="BENWA=BENWAVAL"/> - </option> - <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1942876228" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> - </tool> - </fileInfo> -""" -CPROJECT_TEMPLATE_FOOTER = """ </configuration> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> - </cconfiguration> - </storageModule> - <storageModule moduleId="cdtBuildSystem" version="4.0.0"> - <project id="Empty.null.1281234804" name="Empty"/> - </storageModule> - <storageModule moduleId="scannerConfiguration"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - <scannerConfigBuildInfo instanceId="0.1674256904"> - <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> - </scannerConfigBuildInfo> - </storageModule> - <storageModule moduleId="refreshScope" versionNumber="2"> - <configuration configurationName="Default"/> - </storageModule> - <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> -</cproject> -""" - -WORKSPACE_LANGUAGE_SETTINGS_TEMPLATE = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<plugin> - <extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> - <provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="true" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="@COMPILER_FLAGS@ -E -P -v -dD "${INPUTS}""> - <language-scope id="org.eclipse.cdt.core.gcc"/> - <language-scope id="org.eclipse.cdt.core.g++"/> - </provider> - </extension> -</plugin> -""" - -LANGUAGE_SETTINGS_TEMPLATE = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<project> - <configuration id="0.1674256904" name="Default"> - <extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> - <provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true"> - <language id="org.eclipse.cdt.core.g++"> - <resource project-relative-path=""> - <entry kind="includePath" name="@GLOBAL_INCLUDE_PATH@"> - <flag value="LOCAL"/> - </entry> - <entry kind="includePath" name="@NSPR_INCLUDE_PATH@"> - <flag value="LOCAL"/> - </entry> - <entry kind="includePath" name="@IPDL_INCLUDE_PATH@"> - <flag value="LOCAL"/> - </entry> - <entry kind="includeFile" name="@PREINCLUDE_FILE_PATH@"> - <flag value="LOCAL"/> - </entry> - <!-- - Because of https://developer.mozilla.org/en-US/docs/Eclipse_CDT#Headers_are_only_parsed_once - we need to make sure headers are parsed with MOZILLA_INTERNAL_API to make sure - the indexer gets the version that is used in most of the true. This means that - MOZILLA_EXTERNAL_API code will suffer. - --> - @DEFINE_MOZILLA_INTERNAL_API@ - </resource> - </language> - </provider> - <provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-859273372804152468" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="@COMPILER_FLAGS@ -E -P -v -dD "${INPUTS}" -std=c++11" prefer-non-shared="true" store-entries-with-project="true"> - <language-scope id="org.eclipse.cdt.core.gcc"/> - <language-scope id="org.eclipse.cdt.core.g++"/> - </provider> - <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/> - </extension> - </configuration> -</project> -""" - -GECKO_LAUNCH_CONFIG_TEMPLATE = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType"> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/> -<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/> -<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="lldb"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/> -<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=""/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/> -<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/> -<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/> -<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> -<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> -<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/> -<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/> -<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="false"/> -<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/> -<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="@LAUNCH_ARGS@"/> -<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="@LAUNCH_PROGRAM@"/> -<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="Gecko"/> -<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/> -<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/> -<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/gecko"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="4"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> -<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> -</launchConfiguration> -""" - -B2GFLASH_LAUNCH_CONFIG_TEMPLATE = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType"> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/> -<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/> -<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="lldb"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/> -<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=""/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/> -<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/> -<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/> -<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/> -<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/> -<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/> -<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/> -<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/> -<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="false"/> -<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/> -<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="@LAUNCH_PROGRAM@"/> -<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="Gecko"/> -<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/> -<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/> -<stringAttribute key="org.eclipse.cdt.launch.WORKING_DIRECTORY" value="@OBJDIR@"/> -<booleanAttribute key="org.eclipse.cdt.launch.use_terminal" value="true"/> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/gecko"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="4"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> -<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/> -</launchConfiguration> -""" - - -EDITOR_SETTINGS = """eclipse.preferences.version=1 -lineNumberRuler=true -overviewRuler_migration=migrated_3.1 -printMargin=true -printMarginColumn=80 -showCarriageReturn=false -showEnclosedSpaces=false -showLeadingSpaces=false -showLineFeed=false -showWhitespaceCharacters=true -spacesForTabs=true -tabWidth=2 -undoHistorySize=200 -""" - -FORMATTER_SETTINGS = """eclipse.preferences.version=1 -org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.cdt.core.formatter.alignment_for_assignment=16 -org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80 -org.eclipse.cdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.cdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.cdt.core.formatter.alignment_for_conditional_expression=34 -org.eclipse.cdt.core.formatter.alignment_for_conditional_expression_chain=18 -org.eclipse.cdt.core.formatter.alignment_for_constructor_initializer_list=48 -org.eclipse.cdt.core.formatter.alignment_for_declarator_list=16 -org.eclipse.cdt.core.formatter.alignment_for_enumerator_list=48 -org.eclipse.cdt.core.formatter.alignment_for_expression_list=0 -org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.cdt.core.formatter.alignment_for_member_access=0 -org.eclipse.cdt.core.formatter.alignment_for_overloaded_left_shift_chain=16 -org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=next_line_shifted -org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=next_line -org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=next_line -org.eclipse.cdt.core.formatter.comment.min_distance_between_code_and_line_comment=1 -org.eclipse.cdt.core.formatter.comment.never_indent_line_comments_on_first_column=true -org.eclipse.cdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true -org.eclipse.cdt.core.formatter.compact_else_if=true -org.eclipse.cdt.core.formatter.continuation_indentation=2 -org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header=false -org.eclipse.cdt.core.formatter.indent_access_specifier_extra_spaces=0 -org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier=true -org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=false -org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=true -org.eclipse.cdt.core.formatter.indent_empty_lines=false -org.eclipse.cdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.cdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.cdt.core.formatter.indentation.size=2 -org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=insert -org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_colon_in_constructor_initializer_list=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=insert -org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.cdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments=insert -org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters=insert -org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause=insert -org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments=insert -org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters=insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.cdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.cdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=insert -org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.cdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert -org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert -org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.cdt.core.formatter.join_wrapped_lines=false -org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.cdt.core.formatter.lineSplit=80 -org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.cdt.core.formatter.tabulation.char=space -org.eclipse.cdt.core.formatter.tabulation.size=2 -org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations=false -""" - -NOINDEX_TEMPLATE = """eclipse.preferences.version=1 -indexer/indexerId=org.eclipse.cdt.core.nullIndexer -""" diff --git a/python/mozbuild/mozbuild/backend/fastermake.py b/python/mozbuild/mozbuild/backend/fastermake.py deleted file mode 100644 index d55928e8c7..0000000000 --- a/python/mozbuild/mozbuild/backend/fastermake.py +++ /dev/null @@ -1,165 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from __future__ import absolute_import, unicode_literals, print_function - -from mozbuild.backend.base import PartialBackend -from mozbuild.backend.common import CommonBackend -from mozbuild.frontend.context import ( - ObjDirPath, -) -from mozbuild.frontend.data import ( - ChromeManifestEntry, - FinalTargetPreprocessedFiles, - FinalTargetFiles, - JARManifest, - XPIDLFile, -) -from mozbuild.makeutil import Makefile -from mozbuild.util import OrderedDefaultDict -from mozpack.manifests import InstallManifest -import mozpack.path as mozpath - - -class FasterMakeBackend(CommonBackend, PartialBackend): - def _init(self): - super(FasterMakeBackend, self)._init() - - self._manifest_entries = OrderedDefaultDict(set) - - self._install_manifests = OrderedDefaultDict(InstallManifest) - - self._dependencies = OrderedDefaultDict(list) - - self._has_xpidl = False - - def _add_preprocess(self, obj, path, dest, target=None, **kwargs): - if target is None: - target = mozpath.basename(path) - # This matches what PP_TARGETS do in config/rules. - if target.endswith('.in'): - target = target[:-3] - if target.endswith('.css'): - kwargs['marker'] = '%' - depfile = mozpath.join( - self.environment.topobjdir, 'faster', '.deps', - mozpath.join(obj.install_target, dest, target).replace('/', '_')) - self._install_manifests[obj.install_target].add_preprocess( - mozpath.join(obj.srcdir, path), - mozpath.join(dest, target), - depfile, - **kwargs) - - def consume_object(self, obj): - if isinstance(obj, JARManifest) and \ - obj.install_target.startswith('dist/bin'): - self._consume_jar_manifest(obj) - - elif isinstance(obj, (FinalTargetFiles, - FinalTargetPreprocessedFiles)) and \ - obj.install_target.startswith('dist/bin'): - defines = obj.defines or {} - if defines: - defines = defines.defines - for path, files in obj.files.walk(): - for f in files: - if isinstance(obj, FinalTargetPreprocessedFiles): - self._add_preprocess(obj, f.full_path, path, - target=f.target_basename, - defines=defines) - elif '*' in f: - def _prefix(s): - for p in mozpath.split(s): - if '*' not in p: - yield p + '/' - prefix = ''.join(_prefix(f.full_path)) - - self._install_manifests[obj.install_target] \ - .add_pattern_symlink( - prefix, - f.full_path[len(prefix):], - mozpath.join(path, f.target_basename)) - else: - self._install_manifests[obj.install_target].add_symlink( - f.full_path, - mozpath.join(path, f.target_basename) - ) - if isinstance(f, ObjDirPath): - dep_target = 'install-%s' % obj.install_target - self._dependencies[dep_target].append( - mozpath.relpath(f.full_path, - self.environment.topobjdir)) - - elif isinstance(obj, ChromeManifestEntry) and \ - obj.install_target.startswith('dist/bin'): - top_level = mozpath.join(obj.install_target, 'chrome.manifest') - if obj.path != top_level: - entry = 'manifest %s' % mozpath.relpath(obj.path, - obj.install_target) - self._manifest_entries[top_level].add(entry) - self._manifest_entries[obj.path].add(str(obj.entry)) - - elif isinstance(obj, XPIDLFile): - self._has_xpidl = True - # We're not actually handling XPIDL files. - return False - - else: - return False - - return True - - def consume_finished(self): - mk = Makefile() - # Add the default rule at the very beginning. - mk.create_rule(['default']) - mk.add_statement('TOPSRCDIR = %s' % self.environment.topsrcdir) - mk.add_statement('TOPOBJDIR = %s' % self.environment.topobjdir) - if not self._has_xpidl: - mk.add_statement('NO_XPIDL = 1') - - # Add a few necessary variables inherited from configure - for var in ( - 'PYTHON', - 'ACDEFINES', - 'MOZ_BUILD_APP', - 'MOZ_WIDGET_TOOLKIT', - ): - value = self.environment.substs.get(var) - if value is not None: - mk.add_statement('%s = %s' % (var, value)) - - install_manifests_bases = self._install_manifests.keys() - - # Add information for chrome manifest generation - manifest_targets = [] - - for target, entries in self._manifest_entries.iteritems(): - manifest_targets.append(target) - install_target = mozpath.basedir(target, install_manifests_bases) - self._install_manifests[install_target].add_content( - ''.join('%s\n' % e for e in sorted(entries)), - mozpath.relpath(target, install_target)) - - # Add information for install manifests. - mk.add_statement('INSTALL_MANIFESTS = %s' - % ' '.join(self._install_manifests.keys())) - - # Add dependencies we infered: - for target, deps in self._dependencies.iteritems(): - mk.create_rule([target]).add_dependencies( - '$(TOPOBJDIR)/%s' % d for d in deps) - - mk.add_statement('include $(TOPSRCDIR)/config/faster/rules.mk') - - for base, install_manifest in self._install_manifests.iteritems(): - with self._write_file( - mozpath.join(self.environment.topobjdir, 'faster', - 'install_%s' % base.replace('/', '_'))) as fh: - install_manifest.write(fileobj=fh) - - with self._write_file( - mozpath.join(self.environment.topobjdir, 'faster', - 'Makefile')) as fh: - mk.dump(fh, removal_guard=False) diff --git a/python/mozbuild/mozbuild/backend/mach_commands.py b/python/mozbuild/mozbuild/backend/mach_commands.py deleted file mode 100644 index f2448b2f44..0000000000 --- a/python/mozbuild/mozbuild/backend/mach_commands.py +++ /dev/null @@ -1,123 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from __future__ import absolute_import, print_function, unicode_literals - -import argparse -import os -import sys -import subprocess -import which - -from mozbuild.base import ( - MachCommandBase, -) - -from mach.decorators import ( - CommandArgument, - CommandProvider, - Command, -) - -@CommandProvider -class MachCommands(MachCommandBase): - @Command('ide', category='devenv', - description='Generate a project and launch an IDE.') - @CommandArgument('ide', choices=['eclipse', 'visualstudio', 'intellij']) - @CommandArgument('args', nargs=argparse.REMAINDER) - def eclipse(self, ide, args): - if ide == 'eclipse': - backend = 'CppEclipse' - elif ide == 'visualstudio': - backend = 'VisualStudio' - - if ide == 'eclipse': - try: - which.which('eclipse') - except which.WhichError: - print('Eclipse CDT 8.4 or later must be installed in your PATH.') - print('Download: http://www.eclipse.org/cdt/downloads.php') - return 1 - elif ide =='intellij': - studio = ['idea'] - if sys.platform != 'darwin': - try: - which.which(studio[0]) - except: - self.print_ide_error(ide) - return 1 - else: - # In order of preference! - for d in self.get_mac_ide_preferences(ide): - if os.path.isdir(d): - studio = ['open', '-a', d] - break - else: - print('IntelliJ IDEA 14 is not installed in /Applications.') - return 1 - - # Here we refresh the whole build. 'build export' is sufficient here and is probably more - # correct but it's also nice having a single target to get a fully built and indexed - # project (gives a easy target to use before go out to lunch). - res = self._mach_context.commands.dispatch('build', self._mach_context) - if res != 0: - return 1 - - if ide in ('intellij'): - res = self._mach_context.commands.dispatch('package', self._mach_context) - if res != 0: - return 1 - else: - # Generate or refresh the IDE backend. - python = self.virtualenv_manager.python_path - config_status = os.path.join(self.topobjdir, 'config.status') - args = [python, config_status, '--backend=%s' % backend] - res = self._run_command_in_objdir(args=args, pass_thru=True, ensure_exit_code=False) - if res != 0: - return 1 - - - if ide == 'eclipse': - eclipse_workspace_dir = self.get_eclipse_workspace_path() - process = subprocess.check_call(['eclipse', '-data', eclipse_workspace_dir]) - elif ide == 'visualstudio': - visual_studio_workspace_dir = self.get_visualstudio_workspace_path() - process = subprocess.check_call(['explorer.exe', visual_studio_workspace_dir]) - elif ide == 'intellij': - gradle_dir = None - if self.is_gradle_project_already_imported(): - gradle_dir = self.get_gradle_project_path() - else: - gradle_dir = self.get_gradle_import_path() - process = subprocess.check_call(studio + [gradle_dir]) - - def get_eclipse_workspace_path(self): - from mozbuild.backend.cpp_eclipse import CppEclipseBackend - return CppEclipseBackend.get_workspace_path(self.topsrcdir, self.topobjdir) - - def get_visualstudio_workspace_path(self): - return os.path.join(self.topobjdir, 'msvc', 'mozilla.sln') - - def get_gradle_project_path(self): - return os.path.join(self.topobjdir, 'mobile', 'gradle') - - def get_gradle_import_path(self): - return os.path.join(self.get_gradle_project_path(), 'build.gradle') - - def is_gradle_project_already_imported(self): - gradle_project_path = os.path.join(self.get_gradle_project_path(), '.idea') - return os.path.exists(gradle_project_path) - - def get_mac_ide_preferences(self, ide): - if sys.platform == 'darwin': - return [ - '/Applications/IntelliJ IDEA 14 EAP.app', - '/Applications/IntelliJ IDEA 14.app', - '/Applications/IntelliJ IDEA 14 CE EAP.app', - '/Applications/IntelliJ IDEA 14 CE.app'] - - def print_ide_error(self, ide): - if ide == 'intellij': - print('IntelliJ is not installed in your PATH.') - print('You can generate a command-line launcher from IntelliJ IDEA->Tools->Create Command-line launcher with script name \'idea\'') diff --git a/python/mozbuild/mozbuild/backend/visualstudio.py b/python/mozbuild/mozbuild/backend/visualstudio.py deleted file mode 100644 index 86e97d13d3..0000000000 --- a/python/mozbuild/mozbuild/backend/visualstudio.py +++ /dev/null @@ -1,582 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -# This file contains a build backend for generating Visual Studio project -# files. - -from __future__ import absolute_import, unicode_literals - -import errno -import os -import re -import types -import uuid - -from xml.dom import getDOMImplementation - -from mozpack.files import FileFinder - -from .common import CommonBackend -from ..frontend.data import ( - Defines, - GeneratedSources, - HostProgram, - HostSources, - Library, - LocalInclude, - Program, - Sources, - UnifiedSources, -) -from mozbuild.base import ExecutionSummary - - -MSBUILD_NAMESPACE = 'http://schemas.microsoft.com/developer/msbuild/2003' - -def get_id(name): - return str(uuid.uuid5(uuid.NAMESPACE_URL, name)).upper() - -def visual_studio_product_to_solution_version(version): - if version == '2015': - return '12.00', '14' - else: - raise Exception('Unknown version seen: %s' % version) - -def visual_studio_product_to_platform_toolset_version(version): - if version == '2015': - return 'v140' - else: - raise Exception('Unknown version seen: %s' % version) - -class VisualStudioBackend(CommonBackend): - """Generate Visual Studio project files. - - This backend is used to produce Visual Studio projects and a solution - to foster developing Firefox with Visual Studio. - - This backend is currently considered experimental. There are many things - not optimal about how it works. - """ - - def _init(self): - CommonBackend._init(self) - - # These should eventually evolve into parameters. - self._out_dir = os.path.join(self.environment.topobjdir, 'msvc') - self._projsubdir = 'projects' - - self._version = self.environment.substs.get('MSVS_VERSION', '2015') - - self._paths_to_sources = {} - self._paths_to_includes = {} - self._paths_to_defines = {} - self._paths_to_configs = {} - self._libs_to_paths = {} - self._progs_to_paths = {} - - def summary(self): - return ExecutionSummary( - 'VisualStudio backend executed in {execution_time:.2f}s\n' - 'Generated Visual Studio solution at {path:s}', - execution_time=self._execution_time, - path=os.path.join(self._out_dir, 'mozilla.sln')) - - def consume_object(self, obj): - reldir = getattr(obj, 'relativedir', None) - - if hasattr(obj, 'config') and reldir not in self._paths_to_configs: - self._paths_to_configs[reldir] = obj.config - - if isinstance(obj, Sources): - self._add_sources(reldir, obj) - - elif isinstance(obj, HostSources): - self._add_sources(reldir, obj) - - elif isinstance(obj, GeneratedSources): - self._add_sources(reldir, obj) - - elif isinstance(obj, UnifiedSources): - # XXX we should be letting CommonBackend.consume_object call this - # for us instead. - self._process_unified_sources(obj); - - elif isinstance(obj, Library): - self._libs_to_paths[obj.basename] = reldir - - elif isinstance(obj, Program) or isinstance(obj, HostProgram): - self._progs_to_paths[obj.program] = reldir - - elif isinstance(obj, Defines): - self._paths_to_defines.setdefault(reldir, {}).update(obj.defines) - - elif isinstance(obj, LocalInclude): - includes = self._paths_to_includes.setdefault(reldir, []) - includes.append(obj.path.full_path) - - # Just acknowledge everything. - return True - - def _add_sources(self, reldir, obj): - s = self._paths_to_sources.setdefault(reldir, set()) - s.update(obj.files) - - def _process_unified_sources(self, obj): - reldir = getattr(obj, 'relativedir', None) - - s = self._paths_to_sources.setdefault(reldir, set()) - s.update(obj.files) - - def consume_finished(self): - out_dir = self._out_dir - out_proj_dir = os.path.join(self._out_dir, self._projsubdir) - - projects = self._write_projects_for_sources(self._libs_to_paths, - "library", out_proj_dir) - projects.update(self._write_projects_for_sources(self._progs_to_paths, - "binary", out_proj_dir)) - - # Generate projects that can be used to build common targets. - for target in ('export', 'binaries', 'tools', 'full'): - basename = 'target_%s' % target - command = '$(SolutionDir)\\mach.bat build' - if target != 'full': - command += ' %s' % target - - project_id = self._write_vs_project(out_proj_dir, basename, target, - build_command=command, - clean_command='$(SolutionDir)\\mach.bat build clean') - - projects[basename] = (project_id, basename, target) - - # A project that can be used to regenerate the visual studio projects. - basename = 'target_vs' - project_id = self._write_vs_project(out_proj_dir, basename, 'visual-studio', - build_command='$(SolutionDir)\\mach.bat build-backend -b VisualStudio') - projects[basename] = (project_id, basename, 'visual-studio') - - # Write out a shared property file with common variables. - props_path = os.path.join(out_proj_dir, 'mozilla.props') - with self._write_file(props_path, mode='rb') as fh: - self._write_props(fh) - - # Generate some wrapper scripts that allow us to invoke mach inside - # a MozillaBuild-like environment. We currently only use the batch - # script. We'd like to use the PowerShell script. However, it seems - # to buffer output from within Visual Studio (surely this is - # configurable) and the default execution policy of PowerShell doesn't - # allow custom scripts to be executed. - with self._write_file(os.path.join(out_dir, 'mach.bat'), mode='rb') as fh: - self._write_mach_batch(fh) - - with self._write_file(os.path.join(out_dir, 'mach.ps1'), mode='rb') as fh: - self._write_mach_powershell(fh) - - # Write out a solution file to tie it all together. - solution_path = os.path.join(out_dir, 'mozilla.sln') - with self._write_file(solution_path, mode='rb') as fh: - self._write_solution(fh, projects) - - def _write_projects_for_sources(self, sources, prefix, out_dir): - projects = {} - for item, path in sorted(sources.items()): - config = self._paths_to_configs.get(path, None) - sources = self._paths_to_sources.get(path, set()) - sources = set(os.path.join('$(TopSrcDir)', path, s) for s in sources) - sources = set(os.path.normpath(s) for s in sources) - - finder = FileFinder(os.path.join(self.environment.topsrcdir, path), - find_executables=False) - - headers = [t[0] for t in finder.find('*.h')] - headers = [os.path.normpath(os.path.join('$(TopSrcDir)', - path, f)) for f in headers] - - includes = [ - os.path.join('$(TopSrcDir)', path), - os.path.join('$(TopObjDir)', path), - ] - includes.extend(self._paths_to_includes.get(path, [])) - includes.append('$(TopObjDir)\\dist\\include\\nss') - includes.append('$(TopObjDir)\\dist\\include') - - for v in ('NSPR_CFLAGS', 'NSS_CFLAGS', 'MOZ_JPEG_CFLAGS', - 'MOZ_PNG_CFLAGS', 'MOZ_ZLIB_CFLAGS', 'MOZ_PIXMAN_CFLAGS'): - if not config: - break - - args = config.substs.get(v, []) - - for i, arg in enumerate(args): - if arg.startswith('-I'): - includes.append(os.path.normpath(arg[2:])) - - # Pull in system defaults. - includes.append('$(DefaultIncludes)') - - includes = [os.path.normpath(i) for i in includes] - - defines = [] - for k, v in self._paths_to_defines.get(path, {}).items(): - if v is True: - defines.append(k) - else: - defines.append('%s=%s' % (k, v)) - - debugger=None - if prefix == 'binary': - if item.startswith(self.environment.substs['MOZ_APP_NAME']): - debugger = ('$(TopObjDir)\\dist\\bin\\%s' % item, '-no-remote') - else: - debugger = ('$(TopObjDir)\\dist\\bin\\%s' % item, '') - - basename = '%s_%s' % (prefix, item) - - project_id = self._write_vs_project(out_dir, basename, item, - includes=includes, - forced_includes=['$(TopObjDir)\\dist\\include\\mozilla-config.h'], - defines=defines, - headers=headers, - sources=sources, - debugger=debugger) - - projects[basename] = (project_id, basename, item) - - return projects - - def _write_solution(self, fh, projects): - # Visual Studio appears to write out its current version in the - # solution file. Instead of trying to figure out what version it will - # write, try to parse the version out of the existing file and use it - # verbatim. - vs_version = None - try: - with open(fh.name, 'rb') as sfh: - for line in sfh: - if line.startswith(b'VisualStudioVersion = '): - vs_version = line.split(b' = ', 1)[1].strip() - except IOError as e: - if e.errno != errno.ENOENT: - raise - - format_version, comment_version = visual_studio_product_to_solution_version(self._version) - # This is a Visual C++ Project type. - project_type = '8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942' - - # Visual Studio seems to require this header. - fh.write('Microsoft Visual Studio Solution File, Format Version %s\r\n' % - format_version) - fh.write('# Visual Studio %s\r\n' % comment_version) - - if vs_version: - fh.write('VisualStudioVersion = %s\r\n' % vs_version) - - # Corresponds to VS2013. - fh.write('MinimumVisualStudioVersion = 12.0.31101.0\r\n') - - binaries_id = projects['target_binaries'][0] - - # Write out entries for each project. - for key in sorted(projects): - project_id, basename, name = projects[key] - path = os.path.join(self._projsubdir, '%s.vcxproj' % basename) - - fh.write('Project("{%s}") = "%s", "%s", "{%s}"\r\n' % ( - project_type, name, path, project_id)) - - # Make all libraries depend on the binaries target. - if key.startswith('library_'): - fh.write('\tProjectSection(ProjectDependencies) = postProject\r\n') - fh.write('\t\t{%s} = {%s}\r\n' % (binaries_id, binaries_id)) - fh.write('\tEndProjectSection\r\n') - - fh.write('EndProject\r\n') - - # Write out solution folders for organizing things. - - # This is the UUID you use for solution folders. - container_id = '2150E333-8FDC-42A3-9474-1A3956D46DE8' - - def write_container(desc): - cid = get_id(desc.encode('utf-8')) - fh.write('Project("{%s}") = "%s", "%s", "{%s}"\r\n' % ( - container_id, desc, desc, cid)) - fh.write('EndProject\r\n') - - return cid - - library_id = write_container('Libraries') - target_id = write_container('Build Targets') - binary_id = write_container('Binaries') - - fh.write('Global\r\n') - - # Make every project a member of our one configuration. - fh.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n') - fh.write('\t\tBuild|Win32 = Build|Win32\r\n') - fh.write('\tEndGlobalSection\r\n') - - # Set every project's active configuration to the one configuration and - # set up the default build project. - fh.write('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n') - for name, project in sorted(projects.items()): - fh.write('\t\t{%s}.Build|Win32.ActiveCfg = Build|Win32\r\n' % project[0]) - - # Only build the full build target by default. - # It's important we don't write multiple entries here because they - # conflict! - if name == 'target_full': - fh.write('\t\t{%s}.Build|Win32.Build.0 = Build|Win32\r\n' % project[0]) - - fh.write('\tEndGlobalSection\r\n') - - fh.write('\tGlobalSection(SolutionProperties) = preSolution\r\n') - fh.write('\t\tHideSolutionNode = FALSE\r\n') - fh.write('\tEndGlobalSection\r\n') - - # Associate projects with containers. - fh.write('\tGlobalSection(NestedProjects) = preSolution\r\n') - for key in sorted(projects): - project_id = projects[key][0] - - if key.startswith('library_'): - container_id = library_id - elif key.startswith('target_'): - container_id = target_id - elif key.startswith('binary_'): - container_id = binary_id - else: - raise Exception('Unknown project type: %s' % key) - - fh.write('\t\t{%s} = {%s}\r\n' % (project_id, container_id)) - fh.write('\tEndGlobalSection\r\n') - - fh.write('EndGlobal\r\n') - - def _write_props(self, fh): - impl = getDOMImplementation() - doc = impl.createDocument(MSBUILD_NAMESPACE, 'Project', None) - - project = doc.documentElement - project.setAttribute('xmlns', MSBUILD_NAMESPACE) - project.setAttribute('ToolsVersion', '4.0') - - ig = project.appendChild(doc.createElement('ImportGroup')) - ig.setAttribute('Label', 'PropertySheets') - - pg = project.appendChild(doc.createElement('PropertyGroup')) - pg.setAttribute('Label', 'UserMacros') - - ig = project.appendChild(doc.createElement('ItemGroup')) - - def add_var(k, v): - e = pg.appendChild(doc.createElement(k)) - e.appendChild(doc.createTextNode(v)) - - e = ig.appendChild(doc.createElement('BuildMacro')) - e.setAttribute('Include', k) - - e = e.appendChild(doc.createElement('Value')) - e.appendChild(doc.createTextNode('$(%s)' % k)) - - add_var('TopObjDir', os.path.normpath(self.environment.topobjdir)) - add_var('TopSrcDir', os.path.normpath(self.environment.topsrcdir)) - add_var('PYTHON', '$(TopObjDir)\\_virtualenv\\Scripts\\python.exe') - add_var('MACH', '$(TopSrcDir)\\mach') - - # From MozillaBuild. - add_var('DefaultIncludes', os.environ.get('INCLUDE', '')) - - fh.write(b'\xef\xbb\xbf') - doc.writexml(fh, addindent=' ', newl='\r\n') - - def _relevant_environment_variables(self): - # Write out the environment variables, presumably coming from - # MozillaBuild. - for k, v in sorted(os.environ.items()): - if not re.match('^[a-zA-Z0-9_]+$', k): - continue - - if k in ('OLDPWD', 'PS1'): - continue - - if k.startswith('_'): - continue - - yield k, v - - yield 'TOPSRCDIR', self.environment.topsrcdir - yield 'TOPOBJDIR', self.environment.topobjdir - - def _write_mach_powershell(self, fh): - for k, v in self._relevant_environment_variables(): - fh.write(b'$env:%s = "%s"\r\n' % (k, v)) - - relpath = os.path.relpath(self.environment.topsrcdir, - self.environment.topobjdir).replace('\\', '/') - - fh.write(b'$bashargs = "%s/mach", "--log-no-times"\r\n' % relpath) - fh.write(b'$bashargs = $bashargs + $args\r\n') - - fh.write(b"$expanded = $bashargs -join ' '\r\n") - fh.write(b'$procargs = "-c", $expanded\r\n') - - fh.write(b'Start-Process -WorkingDirectory $env:TOPOBJDIR ' - b'-FilePath $env:MOZILLABUILD\\msys\\bin\\bash ' - b'-ArgumentList $procargs ' - b'-Wait -NoNewWindow\r\n') - - def _write_mach_batch(self, fh): - """Write out a batch script that builds the tree. - - The script "bootstraps" into the MozillaBuild environment by setting - the environment variables that are active in the current MozillaBuild - environment. Then, it builds the tree. - """ - for k, v in self._relevant_environment_variables(): - fh.write(b'SET "%s=%s"\r\n' % (k, v)) - - fh.write(b'cd %TOPOBJDIR%\r\n') - - # We need to convert Windows-native paths to msys paths. Easiest way is - # relative paths, since munging c:\ to /c/ is slightly more - # complicated. - relpath = os.path.relpath(self.environment.topsrcdir, - self.environment.topobjdir).replace('\\', '/') - - # We go through mach because it has the logic for choosing the most - # appropriate build tool. - fh.write(b'"%%MOZILLABUILD%%\\msys\\bin\\bash" ' - b'-c "%s/mach --log-no-times %%1 %%2 %%3 %%4 %%5 %%6 %%7"' % relpath) - - def _write_vs_project(self, out_dir, basename, name, **kwargs): - root = '%s.vcxproj' % basename - project_id = get_id(basename.encode('utf-8')) - - with self._write_file(os.path.join(out_dir, root), mode='rb') as fh: - project_id, name = VisualStudioBackend.write_vs_project(fh, - self._version, project_id, name, **kwargs) - - with self._write_file(os.path.join(out_dir, '%s.user' % root), mode='rb') as fh: - fh.write('<?xml version="1.0" encoding="utf-8"?>\r\n') - fh.write('<Project ToolsVersion="4.0" xmlns="%s">\r\n' % - MSBUILD_NAMESPACE) - fh.write('</Project>\r\n') - - return project_id - - @staticmethod - def write_vs_project(fh, version, project_id, name, includes=[], - forced_includes=[], defines=[], - build_command=None, clean_command=None, - debugger=None, headers=[], sources=[]): - - impl = getDOMImplementation() - doc = impl.createDocument(MSBUILD_NAMESPACE, 'Project', None) - - project = doc.documentElement - project.setAttribute('DefaultTargets', 'Build') - project.setAttribute('ToolsVersion', '4.0') - project.setAttribute('xmlns', MSBUILD_NAMESPACE) - - ig = project.appendChild(doc.createElement('ItemGroup')) - ig.setAttribute('Label', 'ProjectConfigurations') - - pc = ig.appendChild(doc.createElement('ProjectConfiguration')) - pc.setAttribute('Include', 'Build|Win32') - - c = pc.appendChild(doc.createElement('Configuration')) - c.appendChild(doc.createTextNode('Build')) - - p = pc.appendChild(doc.createElement('Platform')) - p.appendChild(doc.createTextNode('Win32')) - - pg = project.appendChild(doc.createElement('PropertyGroup')) - pg.setAttribute('Label', 'Globals') - - n = pg.appendChild(doc.createElement('ProjectName')) - n.appendChild(doc.createTextNode(name)) - - k = pg.appendChild(doc.createElement('Keyword')) - k.appendChild(doc.createTextNode('MakeFileProj')) - - g = pg.appendChild(doc.createElement('ProjectGuid')) - g.appendChild(doc.createTextNode('{%s}' % project_id)) - - rn = pg.appendChild(doc.createElement('RootNamespace')) - rn.appendChild(doc.createTextNode('mozilla')) - - pts = pg.appendChild(doc.createElement('PlatformToolset')) - pts.appendChild(doc.createTextNode(visual_studio_product_to_platform_toolset_version(version))) - - i = project.appendChild(doc.createElement('Import')) - i.setAttribute('Project', '$(VCTargetsPath)\\Microsoft.Cpp.Default.props') - - ig = project.appendChild(doc.createElement('ImportGroup')) - ig.setAttribute('Label', 'ExtensionTargets') - - ig = project.appendChild(doc.createElement('ImportGroup')) - ig.setAttribute('Label', 'ExtensionSettings') - - ig = project.appendChild(doc.createElement('ImportGroup')) - ig.setAttribute('Label', 'PropertySheets') - i = ig.appendChild(doc.createElement('Import')) - i.setAttribute('Project', 'mozilla.props') - - pg = project.appendChild(doc.createElement('PropertyGroup')) - pg.setAttribute('Label', 'Configuration') - ct = pg.appendChild(doc.createElement('ConfigurationType')) - ct.appendChild(doc.createTextNode('Makefile')) - - pg = project.appendChild(doc.createElement('PropertyGroup')) - pg.setAttribute('Condition', "'$(Configuration)|$(Platform)'=='Build|Win32'") - - if build_command: - n = pg.appendChild(doc.createElement('NMakeBuildCommandLine')) - n.appendChild(doc.createTextNode(build_command)) - - if clean_command: - n = pg.appendChild(doc.createElement('NMakeCleanCommandLine')) - n.appendChild(doc.createTextNode(clean_command)) - - if includes: - n = pg.appendChild(doc.createElement('NMakeIncludeSearchPath')) - n.appendChild(doc.createTextNode(';'.join(includes))) - - if forced_includes: - n = pg.appendChild(doc.createElement('NMakeForcedIncludes')) - n.appendChild(doc.createTextNode(';'.join(forced_includes))) - - if defines: - n = pg.appendChild(doc.createElement('NMakePreprocessorDefinitions')) - n.appendChild(doc.createTextNode(';'.join(defines))) - - if debugger: - n = pg.appendChild(doc.createElement('LocalDebuggerCommand')) - n.appendChild(doc.createTextNode(debugger[0])) - - n = pg.appendChild(doc.createElement('LocalDebuggerCommandArguments')) - n.appendChild(doc.createTextNode(debugger[1])) - - i = project.appendChild(doc.createElement('Import')) - i.setAttribute('Project', '$(VCTargetsPath)\\Microsoft.Cpp.props') - - i = project.appendChild(doc.createElement('Import')) - i.setAttribute('Project', '$(VCTargetsPath)\\Microsoft.Cpp.targets') - - # Now add files to the project. - ig = project.appendChild(doc.createElement('ItemGroup')) - for header in sorted(headers or []): - n = ig.appendChild(doc.createElement('ClInclude')) - n.setAttribute('Include', header) - - ig = project.appendChild(doc.createElement('ItemGroup')) - for source in sorted(sources or []): - n = ig.appendChild(doc.createElement('ClCompile')) - n.setAttribute('Include', source) - - fh.write(b'\xef\xbb\xbf') - doc.writexml(fh, addindent=' ', newl='\r\n') - - return project_id, name diff --git a/python/mozbuild/mozbuild/codecoverage/__init__.py b/python/mozbuild/mozbuild/codecoverage/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/python/mozbuild/mozbuild/codecoverage/__init__.py +++ /dev/null diff --git a/python/mozbuild/mozbuild/codecoverage/chrome_map.py b/python/mozbuild/mozbuild/codecoverage/chrome_map.py deleted file mode 100644 index 81c3c9a071..0000000000 --- a/python/mozbuild/mozbuild/codecoverage/chrome_map.py +++ /dev/null @@ -1,105 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from collections import defaultdict -import json -import os -import urlparse - -from mach.config import ConfigSettings -from mach.logging import LoggingManager -from mozbuild.backend.common import CommonBackend -from mozbuild.base import MozbuildObject -from mozbuild.frontend.data import ( - FinalTargetFiles, - FinalTargetPreprocessedFiles, -) -from mozbuild.frontend.data import JARManifest, ChromeManifestEntry -from mozpack.chrome.manifest import ( - Manifest, - ManifestChrome, - ManifestOverride, - ManifestResource, - parse_manifest, -) -import mozpack.path as mozpath - - -class ChromeManifestHandler(object): - def __init__(self): - self.overrides = {} - self.chrome_mapping = defaultdict(set) - - def handle_manifest_entry(self, entry): - format_strings = { - "content": "chrome://%s/content/", - "resource": "resource://%s/", - "locale": "chrome://%s/locale/", - "skin": "chrome://%s/skin/", - } - - if isinstance(entry, (ManifestChrome, ManifestResource)): - if isinstance(entry, ManifestResource): - dest = entry.target - url = urlparse.urlparse(dest) - if not url.scheme: - dest = mozpath.normpath(mozpath.join(entry.base, dest)) - if url.scheme == 'file': - dest = mozpath.normpath(url.path) - else: - dest = mozpath.normpath(entry.path) - - base_uri = format_strings[entry.type] % entry.name - self.chrome_mapping[base_uri].add(dest) - if isinstance(entry, ManifestOverride): - self.overrides[entry.overloaded] = entry.overload - if isinstance(entry, Manifest): - for e in parse_manifest(None, entry.path): - self.handle_manifest_entry(e) - -class ChromeMapBackend(CommonBackend): - def _init(self): - CommonBackend._init(self) - - log_manager = LoggingManager() - self._cmd = MozbuildObject(self.environment.topsrcdir, ConfigSettings(), - log_manager, self.environment.topobjdir) - self._install_mapping = {} - self.manifest_handler = ChromeManifestHandler() - - def consume_object(self, obj): - if isinstance(obj, JARManifest): - self._consume_jar_manifest(obj) - if isinstance(obj, ChromeManifestEntry): - self.manifest_handler.handle_manifest_entry(obj.entry) - if isinstance(obj, (FinalTargetFiles, - FinalTargetPreprocessedFiles)): - self._handle_final_target_files(obj) - return True - - def _handle_final_target_files(self, obj): - for path, files in obj.files.walk(): - for f in files: - dest = mozpath.join(obj.install_target, path, f.target_basename) - is_pp = isinstance(obj, - FinalTargetPreprocessedFiles) - self._install_mapping[dest] = f.full_path, is_pp - - def consume_finished(self): - # Our result has three parts: - # A map from url prefixes to objdir directories: - # { "chrome://mozapps/content/": [ "dist/bin/chrome/toolkit/content/mozapps" ], ... } - # A map of overrides. - # A map from objdir paths to sourcedir paths, and a flag for whether the source was preprocessed: - # { "dist/bin/browser/chrome/browser/content/browser/aboutSessionRestore.js": - # [ "$topsrcdir/browser/components/sessionstore/content/aboutSessionRestore.js", false ], ... } - outputfile = os.path.join(self.environment.topobjdir, 'chrome-map.json') - with self._write_file(outputfile) as fh: - chrome_mapping = self.manifest_handler.chrome_mapping - overrides = self.manifest_handler.overrides - json.dump([ - {k: list(v) for k, v in chrome_mapping.iteritems()}, - overrides, - self._install_mapping, - ], fh, sort_keys=True, indent=2) diff --git a/python/mozbuild/mozbuild/codecoverage/packager.py b/python/mozbuild/mozbuild/codecoverage/packager.py deleted file mode 100644 index 3a4f359f6a..0000000000 --- a/python/mozbuild/mozbuild/codecoverage/packager.py +++ /dev/null @@ -1,43 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from __future__ import absolute_import, print_function - -import argparse -import sys - -from mozpack.files import FileFinder -from mozpack.copier import Jarrer - -def package_gcno_tree(root, output_file): - # XXX JarWriter doesn't support unicode strings, see bug 1056859 - if isinstance(root, unicode): - root = root.encode('utf-8') - - finder = FileFinder(root) - jarrer = Jarrer(optimize=False) - for p, f in finder.find("**/*.gcno"): - jarrer.add(p, f) - jarrer.copy(output_file) - - -def cli(args=sys.argv[1:]): - parser = argparse.ArgumentParser() - parser.add_argument('-o', '--output-file', - dest='output_file', - help='Path to save packaged data to.') - parser.add_argument('--root', - dest='root', - default=None, - help='Root directory to search from.') - args = parser.parse_args(args) - - if not args.root: - from buildconfig import topobjdir - args.root = topobjdir - - return package_gcno_tree(args.root, args.output_file) - -if __name__ == '__main__': - sys.exit(cli()) diff --git a/python/mozbuild/mozbuild/config_status.py b/python/mozbuild/mozbuild/config_status.py index 0b4e6e41dd..ac91a65afe 100644 --- a/python/mozbuild/mozbuild/config_status.py +++ b/python/mozbuild/mozbuild/config_status.py @@ -32,19 +32,6 @@ from mozbuild.backend import ( log_manager = LoggingManager() -VISUAL_STUDIO_ADVERTISEMENT = ''' -=============================== -Visual Studio Support Available - -You are building Firefox on Windows. You can generate Visual Studio -files by running: - - mach build-backend --backend=VisualStudio - -=============================== -'''.strip() - - def config_status(topobjdir='.', topsrcdir='.', defines=None, non_global_defines=None, substs=None, source=None, mozconfig=None, args=sys.argv[1:]): @@ -173,7 +160,3 @@ def config_status(topobjdir='.', topsrcdir='.', defines=None, for path, diff in sorted(the_backend.file_diffs.items()): print('\n'.join(diff)) - # Advertise Visual Studio if appropriate. - if os.name == 'nt' and 'VisualStudio' not in options.backend: - print(VISUAL_STUDIO_ADVERTISEMENT) - diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index 6616b24931..38a98b7432 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -509,7 +509,7 @@ class Build(MachCommandBase): # to avoid accidentally disclosing PII. telemetry_data['substs'] = {} try: - for key in ['MOZ_ARTIFACT_BUILDS', 'MOZ_USING_CCACHE']: + for key in ['MOZ_USING_CCACHE']: value = self.substs.get(key, False) telemetry_data['substs'][key] = value except BuildEnvironmentNotFoundException: @@ -1493,154 +1493,6 @@ class MachDebug(MachCommandBase): return json.JSONEncoder.default(self, obj) json.dump(self, cls=EnvironmentEncoder, sort_keys=True, fp=out) -class ArtifactSubCommand(SubCommand): - def __call__(self, func): - after = SubCommand.__call__(self, func) - jobchoices = { - 'linux', - 'linux64', - 'macosx64', - 'win32', - 'win64' - } - args = [ - CommandArgument('--tree', metavar='TREE', type=str, - help='Firefox tree.'), - CommandArgument('--job', metavar='JOB', choices=jobchoices, - help='Build job.'), - CommandArgument('--verbose', '-v', action='store_true', - help='Print verbose output.'), - ] - for arg in args: - after = arg(after) - return after - - -@CommandProvider -class PackageFrontend(MachCommandBase): - """Fetch and install binary artifacts from Mozilla automation.""" - - @Command('artifact', category='post-build', - description='Use pre-built artifacts to build Firefox.') - def artifact(self): - '''Download, cache, and install pre-built binary artifacts to build Firefox. - - Use |mach build| as normal to freshen your installed binary libraries: - artifact builds automatically download, cache, and install binary - artifacts from Mozilla automation, replacing whatever may be in your - object directory. Use |mach artifact last| to see what binary artifacts - were last used. - - Never build libxul again! - - ''' - pass - - def _set_log_level(self, verbose): - self.log_manager.terminal_handler.setLevel(logging.INFO if not verbose else logging.DEBUG) - - def _install_pip_package(self, package): - if os.environ.get('MOZ_AUTOMATION'): - self.virtualenv_manager._run_pip([ - 'install', - package, - '--no-index', - '--find-links', - 'http://pypi.pub.build.mozilla.org/pub', - '--trusted-host', - 'pypi.pub.build.mozilla.org', - ]) - return - self.virtualenv_manager.install_pip_package(package) - - def _make_artifacts(self, tree=None, job=None, skip_cache=False): - # Undo PATH munging that will be done by activating the virtualenv, - # so that invoked subprocesses expecting to find system python - # (git cinnabar, in particular), will not find virtualenv python. - original_path = os.environ.get('PATH', '') - self._activate_virtualenv() - os.environ['PATH'] = original_path - - for package in ('taskcluster==0.0.32', - 'mozregression==1.0.2'): - self._install_pip_package(package) - - state_dir = self._mach_context.state_dir - cache_dir = os.path.join(state_dir, 'package-frontend') - - try: - os.makedirs(cache_dir) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - import which - - here = os.path.abspath(os.path.dirname(__file__)) - build_obj = MozbuildObject.from_environment(cwd=here) - - hg = None - if conditions.is_hg(build_obj): - if self._is_windows(): - hg = which.which('hg.exe') - else: - hg = which.which('hg') - - git = None - if conditions.is_git(build_obj): - if self._is_windows(): - git = which.which('git.exe') - else: - git = which.which('git') - - # Absolutely must come after the virtualenv is populated! - from mozbuild.artifacts import Artifacts - artifacts = Artifacts(tree, self.substs, self.defines, job, - log=self.log, cache_dir=cache_dir, - skip_cache=skip_cache, hg=hg, git=git, - topsrcdir=self.topsrcdir) - return artifacts - - @ArtifactSubCommand('artifact', 'install', - 'Install a good pre-built artifact.') - @CommandArgument('source', metavar='SRC', nargs='?', type=str, - help='Where to fetch and install artifacts from. Can be omitted, in ' - 'which case the current hg repository is inspected; an hg revision; ' - 'a remote URL; or a local file.', - default=None) - @CommandArgument('--skip-cache', action='store_true', - help='Skip all local caches to force re-fetching remote artifacts.', - default=False) - def artifact_install(self, source=None, skip_cache=False, tree=None, job=None, verbose=False): - self._set_log_level(verbose) - artifacts = self._make_artifacts(tree=tree, job=job, skip_cache=skip_cache) - - return artifacts.install_from(source, self.distdir) - - @ArtifactSubCommand('artifact', 'last', - 'Print the last pre-built artifact installed.') - def artifact_print_last(self, tree=None, job=None, verbose=False): - self._set_log_level(verbose) - artifacts = self._make_artifacts(tree=tree, job=job) - artifacts.print_last() - return 0 - - @ArtifactSubCommand('artifact', 'print-cache', - 'Print local artifact cache for debugging.') - def artifact_print_cache(self, tree=None, job=None, verbose=False): - self._set_log_level(verbose) - artifacts = self._make_artifacts(tree=tree, job=job) - artifacts.print_cache() - return 0 - - @ArtifactSubCommand('artifact', 'clear-cache', - 'Delete local artifacts and reset local artifact cache.') - def artifact_clear_cache(self, tree=None, job=None, verbose=False): - self._set_log_level(verbose) - artifacts = self._make_artifacts(tree=tree, job=job) - artifacts.clear_cache() - return 0 - @CommandProvider class Vendor(MachCommandBase): """Vendor third-party dependencies into the source repository.""" diff --git a/python/mozbuild/mozbuild/test/backend/test_visualstudio.py b/python/mozbuild/mozbuild/test/backend/test_visualstudio.py deleted file mode 100644 index bfc95e5527..0000000000 --- a/python/mozbuild/mozbuild/test/backend/test_visualstudio.py +++ /dev/null @@ -1,64 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from __future__ import unicode_literals - -from xml.dom.minidom import parse -import os -import unittest - -from mozbuild.backend.visualstudio import VisualStudioBackend -from mozbuild.test.backend.common import BackendTester - -from mozunit import main - - -class TestVisualStudioBackend(BackendTester): - @unittest.skip('Failing inconsistently in automation.') - def test_basic(self): - """Ensure we can consume our stub project.""" - - env = self._consume('visual-studio', VisualStudioBackend) - - msvc = os.path.join(env.topobjdir, 'msvc') - self.assertTrue(os.path.isdir(msvc)) - - self.assertTrue(os.path.isfile(os.path.join(msvc, 'mozilla.sln'))) - self.assertTrue(os.path.isfile(os.path.join(msvc, 'mozilla.props'))) - self.assertTrue(os.path.isfile(os.path.join(msvc, 'mach.bat'))) - self.assertTrue(os.path.isfile(os.path.join(msvc, 'binary_my_app.vcxproj'))) - self.assertTrue(os.path.isfile(os.path.join(msvc, 'target_full.vcxproj'))) - self.assertTrue(os.path.isfile(os.path.join(msvc, 'library_dir1.vcxproj'))) - self.assertTrue(os.path.isfile(os.path.join(msvc, 'library_dir1.vcxproj.user'))) - - d = parse(os.path.join(msvc, 'library_dir1.vcxproj')) - self.assertEqual(d.documentElement.tagName, 'Project') - els = d.getElementsByTagName('ClCompile') - self.assertEqual(len(els), 2) - - # mozilla-config.h should be explicitly listed as an include. - els = d.getElementsByTagName('NMakeForcedIncludes') - self.assertEqual(len(els), 1) - self.assertEqual(els[0].firstChild.nodeValue, - '$(TopObjDir)\\dist\\include\\mozilla-config.h') - - # LOCAL_INCLUDES get added to the include search path. - els = d.getElementsByTagName('NMakeIncludeSearchPath') - self.assertEqual(len(els), 1) - includes = els[0].firstChild.nodeValue.split(';') - self.assertIn(os.path.normpath('$(TopSrcDir)/includeA/foo'), includes) - self.assertIn(os.path.normpath('$(TopSrcDir)/dir1'), includes) - self.assertIn(os.path.normpath('$(TopObjDir)/dir1'), includes) - self.assertIn(os.path.normpath('$(TopObjDir)\\dist\\include'), includes) - - # DEFINES get added to the project. - els = d.getElementsByTagName('NMakePreprocessorDefinitions') - self.assertEqual(len(els), 1) - defines = els[0].firstChild.nodeValue.split(';') - self.assertIn('DEFINEFOO', defines) - self.assertIn('DEFINEBAR=bar', defines) - - -if __name__ == '__main__': - main() |