Issue #1053 - Second pass remove android defines and build system stuff.

Mostly IPC, tools and mozbuild.
This commit is contained in:
Moonchild committed 2022-04-01 15:47:43 +02:00
1 parent 35e7103093
commit ce0cefe053
47 files changed
+30 -1056

No files matched your search

-5
View File
@@ -36,11 +36,6 @@ def FlagsForFile(filename):
flag_list = shlex.split(out.getvalue())
# This flag is added by Fennec for android build and causes ycmd to fail to parse the file.
# Removing this flag is a workaround until ycmd starts to handle this flag properly.
# https://github.com/Valloric/YouCompleteMe/issues/1490
final_flags = [x for x in flag_list if not x.startswith('-march=armv')]
return {
'flags': final_flags,
'do_cache': True
-7
View File
@@ -144,16 +144,9 @@ ifeq (.,$(DEPTH))
js/xpconnect/src/export: dom/bindings/export xpcom/xpidl/export
accessible/xpcom/export: xpcom/xpidl/export
# The widget binding generator code is part of the annotationProcessors.
widget/android/bindings/export: build/annotationProcessors/export
# .xpt generation needs the xpidl lex/yacc files
xpcom/xpidl/export: xpcom/idl-parser/xpidl/export
# The roboextender addon includes a classes.dex containing a test Java addon.
# The test addon must be built first.
mobile/android/tests/browser/robocop/roboextender/tools: mobile/android/tests/javaaddons/tools
ifdef ENABLE_CLANG_PLUGIN
$(filter-out config/host build/unix/stdc++compat/% build/clang-plugin/%,$(compile_targets)): build/clang-plugin/target build/clang-plugin/tests/target
build/clang-plugin/tests/target: build/clang-plugin/target
@@ -20,7 +20,7 @@ ConditionVariable::ConditionVariable(Lock* user_lock)
: user_mutex_(user_lock->lock_impl()->os_lock()) {
int rv = 0;
#if !defined(OS_MACOSX) && \
!(defined(OS_ANDROID) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC))
defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC))
pthread_condattr_t attrs;
rv = pthread_condattr_init(&attrs);
DCHECK_EQ(0, rv);
@@ -68,12 +68,7 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
absolute_time.tv_nsec %= Time::kNanosecondsPerSecond;
DCHECK_GE(absolute_time.tv_sec, now.tv_sec); // Overflow paranoia
#if defined(OS_ANDROID) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)
int rv = pthread_cond_timedwait_monotonic_np(
&condition_, user_mutex_, &absolute_time);
#else
int rv = pthread_cond_timedwait(&condition_, user_mutex_, &absolute_time);
#endif // OS_ANDROID && HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC
#endif // OS_MACOSX
DCHECK(rv == 0 || rv == ETIMEDOUT);
+1 -1
View File
@@ -252,7 +252,7 @@ class FilePath {
#endif // OS_WIN
// Implement hash function so that we can use FilePaths in hashsets and maps.
#if defined(COMPILER_GCC) && !defined(ANDROID)
#if defined(COMPILER_GCC)
namespace __gnu_cxx {
template<>
+1 -1
View File
@@ -9,7 +9,7 @@
#include <io.h>
#endif
#include <stdio.h>
#if defined(ANDROID) || defined(OS_POSIX)
#if defined(OS_POSIX)
#include <unistd.h>
#endif
-2
View File
@@ -13,8 +13,6 @@
#if defined(OS_WIN)
#include <windows.h>
#elif defined(ANDROID)
#include <sys/stat.h>
#elif defined(OS_POSIX)
#include <sys/types.h>
#include <sys/stat.h>
-4
View File
@@ -165,13 +165,9 @@ bool CreateNewTempDirectory(const FilePath::StringType& prefix,
return false;
tmpdir = tmpdir.Append(kTempFileName);
std::string tmpdir_string = tmpdir.value();
#ifdef ANDROID
char* dtemp = NULL;
#else
// this should be OK since mkdtemp just replaces characters in place
char* buffer = const_cast<char*>(tmpdir_string.c_str());
char* dtemp = mkdtemp(buffer);
#endif
if (!dtemp)
return false;
*new_temp_path = FilePath(dtemp);
+2 -22
View File
@@ -20,38 +20,18 @@
#include "base/string16.h"
#if defined(COMPILER_MSVC) || (defined(ANDROID) && defined(_STLP_STD_NAME))
#ifdef COMPILER_MSVC
#if defined(COMPILER_MSVC)
#pragma push_macro("_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS")
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
#endif
// Suppress -Wshadow warnings from stlport headers.
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wshadow"
# pragma GCC diagnostic ignored "-Wshadow-local"
#endif
#include <hash_map>
#include <hash_set>
#ifdef __GNUC__
# pragma GCC diagnostic pop // -Wshadow-local
# pragma GCC diagnostic pop // -Wshadow
#endif
#ifdef COMPILER_MSVC
#pragma pop_macro("_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS")
#endif
namespace base {
#ifdef ANDROID
using _STLP_STD_NAME::hash_map;
using _STLP_STD_NAME::hash_set;
#else
using stdext::hash_map;
using stdext::hash_set;
#endif
}
#elif defined(COMPILER_GCC)
// This is a hack to disable the gcc 4.4 warning about hash_map and hash_set
-3
View File
@@ -25,9 +25,6 @@
#include "base/message_pump_glib.h"
#endif
#endif
#ifdef ANDROID
#include "base/message_pump_android.h"
#endif
#ifdef MOZ_TASK_TRACER
#include "GeckoTaskTracer.h"
#include "TracedTaskCommon.h"
@@ -10,7 +10,7 @@
#ifdef OS_SOLARIS
#include <sys/stat.h>
#endif
#if defined(ANDROID) || defined(OS_POSIX)
#if defined(OS_POSIX)
#include <unistd.h>
#endif
-4
View File
@@ -13,10 +13,6 @@
#include "base/basictypes.h"
#include "base/logging.h"
#if defined(ANDROID) && defined(_STLP_STD_NAME)
using _STLP_STD_NAME::find;
#endif
namespace base {
///////////////////////////////////////////////////////////////////////////////
@@ -8,9 +8,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#ifdef ANDROID
#include <linux/stat.h>
#endif
#include "base/logging.h"
#include "base/string_util.h"
+1 -8
View File
@@ -94,10 +94,6 @@ bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
return result;
}
#ifdef ANDROID
typedef unsigned long int rlim_t;
#endif
// A class to handle auto-closing of DIR*'s.
class ScopedDIRClose {
public:
@@ -113,10 +109,7 @@ typedef mozilla::UniquePtr<DIR, ScopedDIRClose> ScopedDIR;
void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
// DANGER: no calls to malloc are allowed from now on:
// http://crbug.com/36678
#if defined(ANDROID)
static const rlim_t kSystemDefaultMaxFds = 1024;
static const char kFDDir[] = "/proc/self/fd";
#elif defined(OS_LINUX) || defined(OS_SOLARIS)
#if defined(OS_LINUX) || defined(OS_SOLARIS)
static const rlim_t kSystemDefaultMaxFds = 8192;
static const char kFDDir[] = "/proc/self/fd";
#elif defined(OS_MACOSX)
@@ -269,39 +269,6 @@ void SharedMemory::Close(bool unmap_view) {
}
}
#ifdef ANDROID
void SharedMemory::LockOrUnlockCommon(int function) {
DCHECK(mapped_file_ >= 0);
struct flock lockreq;
lockreq.l_type = function;
lockreq.l_whence = SEEK_SET;
lockreq.l_start = 0;
lockreq.l_len = 0;
while (fcntl(mapped_file_, F_SETLKW, &lockreq) < 0) {
if (errno == EINTR) {
continue;
} else if (errno == ENOLCK) {
// temporary kernel resource exaustion
PlatformThread::Sleep(500);
continue;
} else {
NOTREACHED() << "lockf() failed."
<< " function:" << function
<< " fd:" << mapped_file_
<< " errno:" << errno
<< " msg:" << strerror(errno);
}
}
}
void SharedMemory::Lock() {
LockOrUnlockCommon(F_WRLCK);
}
void SharedMemory::Unlock() {
LockOrUnlockCommon(F_UNLCK);
}
#else
void SharedMemory::LockOrUnlockCommon(int function) {
DCHECK(mapped_file_ >= 0);
while (lockf(mapped_file_, function, 0) < 0) {
@@ -328,7 +295,6 @@ void SharedMemory::Lock() {
void SharedMemory::Unlock() {
LockOrUnlockCommon(F_ULOCK);
}
#endif
SharedMemoryHandle SharedMemory::handle() const {
return FileDescriptor(mapped_file_, false);
-6
View File
@@ -8,9 +8,7 @@
#include <errno.h>
#include <string.h>
#ifndef ANDROID
#include <sys/statvfs.h>
#endif
#include <sys/utsname.h>
#include <unistd.h>
@@ -90,15 +88,11 @@ int64_t SysInfo::AmountOfPhysicalMemory() {
// static
int64_t SysInfo::AmountOfFreeDiskSpace(const std::wstring& path) {
#ifndef ANDROID
struct statvfs stats;
if (statvfs(WideToUTF8(path).c_str(), &stats) != 0) {
return -1;
}
return static_cast<int64_t>(stats.f_bavail) * stats.f_frsize;
#else
return -1;
#endif
}
// static
+2 -6
View File
@@ -9,12 +9,8 @@
#include <mach/mach_time.h>
#endif
#include <sys/time.h>
#if defined(ANDROID) && !defined(__LP64__)
#include <time64.h>
#else
#include <time.h>
#endif
#if defined(ANDROID) || defined(OS_POSIX)
#if defined(OS_POSIX)
#include <unistd.h>
#endif
@@ -72,7 +68,7 @@ Time Time::FromExploded(bool is_local, const Exploded& exploded) {
#endif
time_t seconds;
#if defined(ANDROID) || defined(OS_SOLARIS)
#if defined(OS_SOLARIS)
seconds = mktime(&timestruct);
#else
if (is_local)
+2 -2
View File
@@ -127,8 +127,8 @@ Library::Create(JSContext* cx, HandleValue path, const JSCTypesCallbacks* callba
return nullptr;
} else {
// Fallback: assume the platform native charset is UTF-8. This is true
// for Mac OS X, Android, and probably Linux.
// Fallback: assume the platform native charset is UTF-8.
// This is true on most flavors of Linux.
size_t nbytes =
GetDeflatedUTF8StringLength(cx, pathStrChars.twoByteChars(), pathStr->length());
if (nbytes == (size_t) -1)
+2 -6
View File
@@ -115,7 +115,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
@@ -123,10 +123,6 @@ case $maybe_os in
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@@ -1365,7 +1361,7 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -mingw32* | -mingw64* | -linux-gnu* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-6
View File
@@ -21,12 +21,6 @@
#include "vm/MutexIDs.h"
// perf expects its data to be in a file /tmp/perf-PID.map, but for Android
// and B2G the map files are written to /data/local/tmp/perf-PID.map
//
// Except that Android 4.3 no longer allows the browser to write to /data/local/tmp/
// so also try /sdcard/.
#ifndef PERF_SPEW_DIR
# define PERF_SPEW_DIR "/tmp/"
#endif
-1
View File
@@ -103,7 +103,6 @@ AllTheNonBasicVanillaNewAllocations()
{
// posix_memalign and aligned_alloc aren't available on all Linux
// configurations.
// valloc was deprecated in Android 5.0
//char* q;
//posix_memalign((void**)&q, 16, 16);
+3 -3
View File
@@ -988,7 +988,7 @@ AC_LANG_CPLUSPLUS
MOZ_CXX11
case "${OS_TARGET}" in
WINNT|Darwin|Android)
WINNT|Darwin)
;;
*)
STL_FLAGS="-I${DIST}/stl_wrappers"
@@ -1605,11 +1605,11 @@ dnl = Enable jemalloc
dnl ========================================================
case "${OS_TARGET}" in
Android|WINNT|Darwin)
WINNT|Darwin)
MOZ_GLUE_IN_PROGRAM=
;;
*)
dnl On !Android !Windows !OSX, we only want to link executables against mozglue
dnl On !Windows, we only want to link executables against mozglue
MOZ_GLUE_IN_PROGRAM=1
AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
;;
+2 -1
View File
@@ -157,8 +157,9 @@ js::ConditionVariable::wait_for(UniqueLock<Mutex>& lock,
r = pthread_cond_timedwait(ptCond, ptMutex, &abs_ts);
#else
// Our non-clock-supporting platforms, OS X and Android, do support waiting
// Our non-clock-supporting platforms do support waiting
// on a condition variable with a relative timeout.
// XXXMC: This was in use on Android and OSX. Can probably be removed.
r = pthread_cond_timedwait_relative_np(ptCond, ptMutex, &rel_ts);
#endif
+1 -2
View File
@@ -3,8 +3,7 @@
* 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/. */
// Some Linux kernels -- specifically, newer versions of Android and
// some B2G devices -- have a feature for assigning names to ranges of
// Some Linux kernels have a feature for assigning names to ranges of
// anonymous memory (i.e., memory that doesn't have a "name" in the
// form of an underlying mapped file). These names are reported in
// /proc/<pid>/smaps alongside system-level memory usage information
-5
View File
@@ -21,11 +21,6 @@
#include <limits>
#include <sstream>
#ifndef UINT64_C
// For Android toolchain
#define UINT64_C(c) (c ## ULL)
#endif
#ifdef ASSERT
#undef ASSERT
#endif
-20
View File
@@ -2822,26 +2822,6 @@ linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
linux*android*)
version_type=none # Android doesn't support versioned libraries.
need_lib_prefix=no
need_version=no
library_names_spec='$libname$release$shared_ext'
soname_spec='$libname$release$shared_ext'
finish_cmds=
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
dynamic_linker='Android linker'
# Don't embed -rpath directories since the linker doesn't support them.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
;;
# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
+2 -6
View File
@@ -114,7 +114,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | cloudabi*-eabi* | \
@@ -122,10 +122,6 @@ case $maybe_os in
os=-$maybe_os
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
if [ "$basic_machine" != "$1" ]
@@ -1383,7 +1379,7 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
| -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
+1 -1
View File
@@ -2028,7 +2028,7 @@ pref("intl.locale.matchOS", false);
pref("intl.fallbackCharsetList.ISO-8859-1", "windows-1252");
pref("font.language.group", "chrome://global/locale/intl.properties");
// Pref to use key-events-only mode for IME-unaware webapps. (legacy from android)
// Pref to use key-events-only mode for IME-unaware webapps.
pref("intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition", false);
// If you use legacy Chinese IME which puts an ideographic space to composition
+1 -3
View File
@@ -7,9 +7,7 @@ include('build/moz.configure/init.configure')
# Note:
# - Gecko-specific options and rules should go in toolkit/moz.configure.
# - Firefox-specific options and rules should go in browser/moz.configure.
# - Fennec-specific options and rules should go in
# mobile/android/moz.configure.
# - Browser-specific options and rules should go in browser/moz.configure.
# - Spidermonkey-specific options and rules should go in js/moz.configure.
# - etc.
-7
View File
@@ -3,12 +3,6 @@
# 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/.
with Files('mach/**'):
BUG_COMPONENT = ('Core', 'mach')
with Files('mozbuild/**'):
BUG_COMPONENT = ('Core', 'Build Config')
SPHINX_PYTHON_PACKAGE_DIRS += [
'mach',
'mozbuild/mozbuild',
@@ -30,7 +24,6 @@ PYTHON_UNIT_TESTS += [
'mozbuild/mozbuild/test/action/test_buildlist.py',
'mozbuild/mozbuild/test/action/test_generate_browsersearch.py',
'mozbuild/mozbuild/test/action/test_package_fennec_apk.py',
'mozbuild/mozbuild/test/backend/test_android_eclipse.py',
'mozbuild/mozbuild/test/backend/test_build.py',
'mozbuild/mozbuild/test/backend/test_configenvironment.py',
'mozbuild/mozbuild/test/backend/test_recursivemake.py',
@@ -1,72 +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 errno
import os
import shutil
import sys
import zipfile
from mozpack.files import FileFinder
import mozpack.path as mozpath
from mozbuild.util import ensureParentDir
def explode(aar, destdir):
# Take just the support-v4-22.2.1 part.
name, _ = os.path.splitext(os.path.basename(aar))
destdir = mozpath.join(destdir, name)
if os.path.exists(destdir):
# We always want to start fresh.
shutil.rmtree(destdir)
ensureParentDir(destdir)
with zipfile.ZipFile(aar) as zf:
zf.extractall(destdir)
# classes.jar is always present. However, multiple JAR files with the same
# name confuses our staged Proguard process in
# mobile/android/base/Makefile.in, so we make the names unique here.
classes_jar = mozpath.join(destdir, name + '-classes.jar')
os.rename(mozpath.join(destdir, 'classes.jar'), classes_jar)
# Embedded JAR libraries are optional.
finder = FileFinder(mozpath.join(destdir, 'libs'), find_executables=False)
for p, _ in finder.find('*.jar'):
jar = mozpath.join(finder.base, name + '-' + p)
os.rename(mozpath.join(finder.base, p), jar)
# Frequently assets/ is present but empty. Protect against meaningless
# changes to the AAR files by deleting empty assets/ directories.
assets = mozpath.join(destdir, 'assets')
try:
os.rmdir(assets)
except OSError, e:
if e.errno in (errno.ENOTEMPTY, errno.ENOENT):
pass
else:
raise
return True
def main(argv):
parser = argparse.ArgumentParser(
description='Explode Android AAR file.')
parser.add_argument('--destdir', required=True, help='Destination directory.')
parser.add_argument('aars', nargs='+', help='Path to AAR file(s).')
args = parser.parse_args(argv)
for aar in args.aars:
if not explode(aar, args.destdir):
return 1
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
@@ -1,147 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# 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/.
''' Script to generate the suggestedsites.json file for Fennec.
This script follows these steps:
1. Read the region.properties file in all the given source directories
(see srcdir option). Merge all properties into a single dict accounting for
the priority of source directories.
2. Read the list of sites from the list 'browser.suggestedsites.list.INDEX' and
'browser.suggestedsites.restricted.list.INDEX' properties with value of these keys
being an identifier for each suggested site e.g. browser.suggestedsites.list.0=mozilla,
browser.suggestedsites.list.1=fxmarketplace.
3. For each site identifier defined by the list keys, look for matching branches
containing the respective properties i.e. url, title, etc. For example,
for a 'mozilla' identifier, we'll look for keys like:
browser.suggestedsites.mozilla.url, browser.suggestedsites.mozilla.title, etc.
4. Generate a JSON representation of each site, join them in a JSON array, and
write the result to suggestedsites.json on the locale-specific raw resource
directory e.g. raw/suggestedsites.json, raw-pt-rBR/suggestedsites.json.
'''
from __future__ import absolute_import, print_function
import argparse
import copy
import json
import sys
import os
from mozbuild.dotproperties import (
DotProperties,
)
from mozbuild.util import (
FileAvoidWrite,
)
from mozpack.files import (
FileFinder,
)
import mozpack.path as mozpath
def merge_properties(filename, srcdirs):
"""Merges properties from the given file in the given source directories."""
properties = DotProperties()
for srcdir in srcdirs:
path = mozpath.join(srcdir, filename)
try:
properties.update(path)
except IOError:
# Ignore non-existing files
continue
return properties
def main(args):
parser = argparse.ArgumentParser()
parser.add_argument('--verbose', '-v', default=False, action='store_true',
help='be verbose')
parser.add_argument('--silent', '-s', default=False, action='store_true',
help='be silent')
parser.add_argument('--android-package-name', metavar='NAME',
required=True,
help='Android package name')
parser.add_argument('--resources', metavar='RESOURCES',
default=None,
help='optional Android resource directory to find drawables in')
parser.add_argument('--srcdir', metavar='SRCDIR',
action='append', required=True,
help='directories to read inputs from, in order of priority')
parser.add_argument('output', metavar='OUTPUT',
help='output')
opts = parser.parse_args(args)
# Use reversed order so that the first srcdir has higher priority to override keys.
properties = merge_properties('region.properties', reversed(opts.srcdir))
# Keep these two in sync.
image_url_template = 'android.resource://%s/drawable/suggestedsites_{name}' % opts.android_package_name
drawables_template = 'drawable*/suggestedsites_{name}.*'
# Load properties corresponding to each site name and define their
# respective image URL.
sites = []
def add_names(names, defaults={}):
for name in names:
site = copy.deepcopy(defaults)
site.update(properties.get_dict('browser.suggestedsites.{name}'.format(name=name), required_keys=('title', 'url', 'bgcolor')))
site['imageurl'] = image_url_template.format(name=name)
sites.append(site)
# Now check for existence of an appropriately named drawable. If none
# exists, throw. This stops a locale discovering, at runtime, that the
# corresponding drawable was not added to en-US.
if not opts.resources:
continue
resources = os.path.abspath(opts.resources)
finder = FileFinder(resources)
matches = [p for p, _ in finder.find(drawables_template.format(name=name))]
if not matches:
raise Exception("Could not find drawable in '{resources}' for '{name}'"
.format(resources=resources, name=name))
else:
if opts.verbose:
print("Found {len} drawables in '{resources}' for '{name}': {matches}"
.format(len=len(matches), resources=resources, name=name, matches=matches))
# We want the lists to be ordered for reproducibility. Each list has a
# "default" JSON list item which will be extended by the properties read.
lists = [
('browser.suggestedsites.list', {}),
('browser.suggestedsites.restricted.list', {'restricted': True}),
]
if opts.verbose:
print('Reading {len} suggested site lists: {lists}'.format(len=len(lists), lists=[list_name for list_name, _ in lists]))
for (list_name, list_item_defaults) in lists:
names = properties.get_list(list_name)
if opts.verbose:
print('Reading {len} suggested sites from {list}: {names}'.format(len=len(names), list=list_name, names=names))
add_names(names, list_item_defaults)
# FileAvoidWrite creates its parent directories.
output = os.path.abspath(opts.output)
fh = FileAvoidWrite(output)
json.dump(sites, fh)
existed, updated = fh.close()
if not opts.silent:
if updated:
print('{output} updated'.format(output=output))
else:
print('{output} already up-to-date'.format(output=output))
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
@@ -1,150 +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/.
'''
Script to produce an Android package (.apk) for Fennec.
'''
from __future__ import absolute_import, print_function
import argparse
import buildconfig
import os
import subprocess
import sys
from mozpack.copier import Jarrer
from mozpack.files import (
DeflatedFile,
File,
FileFinder,
)
from mozpack.mozjar import JarReader
import mozpack.path as mozpath
def package_fennec_apk(inputs=[], omni_ja=None, classes_dex=None,
lib_dirs=[],
assets_dirs=[],
features_dirs=[],
root_files=[],
verbose=False):
jarrer = Jarrer(optimize=False)
# First, take input files. The contents of the later files overwrites the
# content of earlier files.
for input in inputs:
jar = JarReader(input)
for file in jar:
path = file.filename
if jarrer.contains(path):
jarrer.remove(path)
jarrer.add(path, DeflatedFile(file), compress=file.compressed)
def add(path, file, compress=None):
abspath = os.path.abspath(file.path)
if verbose:
print('Packaging %s from %s' % (path, file.path))
if not os.path.exists(abspath):
raise ValueError('File %s not found (looked for %s)' % \
(file.path, abspath))
if jarrer.contains(path):
jarrer.remove(path)
jarrer.add(path, file, compress=compress)
for features_dir in features_dirs:
finder = FileFinder(features_dir, find_executables=False)
for p, f in finder.find('**'):
add(mozpath.join('assets', 'features', p), f, False)
for assets_dir in assets_dirs:
finder = FileFinder(assets_dir, find_executables=False)
for p, f in finder.find('**'):
compress = None # Take default from Jarrer.
if p.endswith('.so'):
# Asset libraries are special.
if f.open().read(5)[1:] == '7zXZ':
print('%s is already compressed' % p)
# We need to store (rather than deflate) compressed libraries
# (even if we don't compress them ourselves).
compress = False
elif buildconfig.substs.get('XZ'):
cmd = [buildconfig.substs.get('XZ'), '-zkf',
mozpath.join(finder.base, p)]
bcj = None
if buildconfig.substs.get('MOZ_THUMB2'):
bcj = '--armthumb'
elif buildconfig.substs.get('CPU_ARCH') == 'arm':
bcj = '--arm'
elif buildconfig.substs.get('CPU_ARCH') == 'x86':
bcj = '--x86'
if bcj:
cmd.extend([bcj, '--lzma2'])
print('xz-compressing %s with %s' % (p, ' '.join(cmd)))
subprocess.check_output(cmd)
os.rename(f.path + '.xz', f.path)
compress = False
add(mozpath.join('assets', p), f, compress=compress)
for lib_dir in lib_dirs:
finder = FileFinder(lib_dir, find_executables=False)
for p, f in finder.find('**'):
add(mozpath.join('lib', p), f)
for root_file in root_files:
add(os.path.basename(root_file), File(root_file))
if omni_ja:
add(mozpath.join('assets', 'omni.ja'), File(omni_ja), compress=False)
if classes_dex:
add('classes.dex', File(classes_dex))
return jarrer
def main(args):
parser = argparse.ArgumentParser()
parser.add_argument('--verbose', '-v', default=False, action='store_true',
help='be verbose')
parser.add_argument('--inputs', nargs='+',
help='Input skeleton AP_ or APK file(s).')
parser.add_argument('-o', '--output',
help='Output APK file.')
parser.add_argument('--omnijar', default=None,
help='Optional omni.ja to pack into APK file.')
parser.add_argument('--classes-dex', default=None,
help='Optional classes.dex to pack into APK file.')
parser.add_argument('--lib-dirs', nargs='*', default=[],
help='Optional lib/ dirs to pack into APK file.')
parser.add_argument('--assets-dirs', nargs='*', default=[],
help='Optional assets/ dirs to pack into APK file.')
parser.add_argument('--features-dirs', nargs='*', default=[],
help='Optional features/ dirs to pack into APK file.')
parser.add_argument('--root-files', nargs='*', default=[],
help='Optional files to pack into APK file root.')
args = parser.parse_args(args)
if buildconfig.substs.get('OMNIJAR_NAME') != 'assets/omni.ja':
raise ValueError("Don't know how package Fennec APKs when "
" OMNIJAR_NAME is not 'assets/omni.jar'.")
jarrer = package_fennec_apk(inputs=args.inputs,
omni_ja=args.omnijar,
classes_dex=args.classes_dex,
lib_dirs=args.lib_dirs,
assets_dirs=args.assets_dirs,
features_dirs=args.features_dirs,
root_files=args.root_files,
verbose=args.verbose)
jarrer.copy(args.output)
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
@@ -1,167 +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 math
import sys
import time
# Builds before this build ID use the v0 version scheme. Builds after this
# build ID use the v1 version scheme.
V1_CUTOFF = 20150801000000 # YYYYmmddHHMMSS
def android_version_code_v0(buildid, cpu_arch=None, min_sdk=0, max_sdk=0):
base = int(str(buildid)[:10])
# None is interpreted as arm.
if not cpu_arch or cpu_arch in ['armeabi', 'armeabi-v7a']:
# Increment by MIN_SDK_VERSION -- this adds 9 to every build ID as a
# minimum. Our split APK starts at 15.
return base + min_sdk + 0
elif cpu_arch in ['x86']:
# Increment the version code by 3 for x86 builds so they are offered to
# x86 phones that have ARM emulators, beating the 2-point advantage that
# the v15+ ARMv7 APK has. If we change our splits in the future, we'll
# need to do this further still.
return base + min_sdk + 3
else:
raise ValueError("Don't know how to compute android:versionCode "
"for CPU arch %s" % cpu_arch)
def android_version_code_v1(buildid, cpu_arch=None, min_sdk=0, max_sdk=0):
'''Generate a v1 android:versionCode.
The important consideration is that version codes be monotonically
increasing (per Android package name) for all published builds. The input
build IDs are based on timestamps and hence are always monotonically
increasing.
The generated v1 version codes look like (in binary):
0111 1000 0010 tttt tttt tttt tttt txpg
The 17 bits labelled 't' represent the number of hours since midnight on
September 1, 2015. (2015090100 in YYYYMMMDDHH format.) This yields a
little under 15 years worth of hourly build identifiers, since 2**17 / (366
* 24) =~ 14.92.
The bits labelled 'x', 'p', and 'g' are feature flags.
The bit labelled 'x' is 1 if the build is for an x86 architecture and 0
otherwise, which means the build is for an ARM architecture. (Fennec no
longer supports ARMv6, so ARM is equivalent to ARMv7 and above.)
The bit labelled 'p' is a placeholder that is always 0 (for now).
Firefox no longer supports API 14 or earlier.
This version code computation allows for a split on API levels that allowed
us to ship builds specifically for Gingerbread (API 9-10); we preserve
that functionality for sanity's sake, and to allow us to reintroduce a
split in the future.
At present, the bit labelled 'g' is 1 if the build is an ARM build
targeting API 15+, which will always be the case.
We throw an explanatory exception when we are within one calendar year of
running out of build events. This gives lots of time to update the version
scheme. The responsible individual should then bump the range (to allow
builds to continue) and use the time remaining to update the version scheme
via the reserved high order bits.
N.B.: the reserved 0 bit to the left of the highest order 't' bit can,
sometimes, be used to bump the version scheme. In addition, by reducing the
granularity of the build identifiers (for example, moving to identifying
builds every 2 or 4 hours), the version scheme may be adjusted further still
without losing a (valuable) high order bit.
'''
def hours_since_cutoff(buildid):
# The ID is formatted like YYYYMMDDHHMMSS (using
# datetime.utcnow().strftime('%Y%m%d%H%M%S'); see build/variables.py).
# The inverse function is time.strptime.
# N.B.: the time module expresses time as decimal seconds since the
# epoch.
fmt = '%Y%m%d%H%M%S'
build = time.strptime(str(buildid), fmt)
cutoff = time.strptime(str(V1_CUTOFF), fmt)
return int(math.floor((time.mktime(build) - time.mktime(cutoff)) / (60.0 * 60.0)))
# Of the 21 low order bits, we take 17 bits for builds.
base = hours_since_cutoff(buildid)
if base < 0:
raise ValueError("Something has gone horribly wrong: cannot calculate "
"android:versionCode from build ID %s: hours underflow "
"bits allotted!" % buildid)
if base > 2**17:
raise ValueError("Something has gone horribly wrong: cannot calculate "
"android:versionCode from build ID %s: hours overflow "
"bits allotted!" % buildid)
if base > 2**17 - 366 * 24:
raise ValueError("Running out of low order bits calculating "
"android:versionCode from build ID %s: "
"; YOU HAVE ONE YEAR TO UPDATE THE VERSION SCHEME." % buildid)
version = 0b1111000001000000000000000000000
# We reserve 1 "middle" high order bit for the future, and 3 low order bits
# for architecture and APK splits.
version |= base << 3
# None is interpreted as arm.
if not cpu_arch or cpu_arch in ['armeabi', 'armeabi-v7a']:
# 0 is interpreted as SDK 9.
if not min_sdk or min_sdk == 9:
pass
# This used to compare to 11. The 15+ APK directly supersedes 11+, so
# we reuse this check.
elif min_sdk == 15:
version |= 1 << 0
else:
raise ValueError("Don't know how to compute android:versionCode "
"for CPU arch %s and min SDK %s" % (cpu_arch, min_sdk))
elif cpu_arch in ['x86']:
version |= 1 << 2
else:
raise ValueError("Don't know how to compute android:versionCode "
"for CPU arch %s" % cpu_arch)
return version
def android_version_code(buildid, *args, **kwargs):
base = int(str(buildid))
if base < V1_CUTOFF:
return android_version_code_v0(buildid, *args, **kwargs)
else:
return android_version_code_v1(buildid, *args, **kwargs)
def main(argv):
parser = argparse.ArgumentParser('Generate an android:versionCode',
add_help=False)
parser.add_argument('--verbose', action='store_true',
default=False,
help='Be verbose')
parser.add_argument('--with-android-cpu-arch', dest='cpu_arch',
choices=['armeabi', 'armeabi-v7a', 'mips', 'x86'],
help='The target CPU architecture')
parser.add_argument('--with-android-min-sdk-version', dest='min_sdk',
type=int, default=0,
help='The minimum target SDK')
parser.add_argument('--with-android-max-sdk-version', dest='max_sdk',
type=int, default=0,
help='The maximum target SDK')
parser.add_argument('buildid', type=int,
help='The input build ID')
args = parser.parse_args(argv)
code = android_version_code(args.buildid,
cpu_arch=args.cpu_arch,
min_sdk=args.min_sdk,
max_sdk=args.max_sdk)
print(code)
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
@@ -3,7 +3,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
backends = {
'AndroidEclipse': 'mozbuild.backend.android_eclipse',
'ChromeMap': 'mozbuild.codecoverage.chrome_map',
'CompileDB': 'mozbuild.compilation.database',
'CppEclipse': 'mozbuild.backend.cpp_eclipse',
-17
View File
@@ -29,25 +29,8 @@ from mozbuild.backend import (
get_backend_class,
)
log_manager = LoggingManager()
ANDROID_IDE_ADVERTISEMENT = '''
=============
ADVERTISEMENT
You are building Firefox for Android. After your build completes, you can open
the top source directory in IntelliJ or Android Studio directly and build using
Gradle. See the documentation at
https://developer.mozilla.org/en-US/docs/Simple_Firefox_for_Android_build
PLEASE BE AWARE THAT GRADLE AND INTELLIJ/ANDROID STUDIO SUPPORT IS EXPERIMENTAL.
You should verify any changes using |mach build|.
=============
'''.strip()
VISUAL_STUDIO_ADVERTISEMENT = '''
===============================
Visual Studio Support Available
-113
View File
@@ -936,119 +936,6 @@ class GeneratedFile(ContextDerived):
self.inputs = inputs
self.flags = flags
class ClassPathEntry(object):
"""Represents a classpathentry in an Android Eclipse project."""
__slots__ = (
'dstdir',
'srcdir',
'path',
'exclude_patterns',
'ignore_warnings',
)
def __init__(self):
self.dstdir = None
self.srcdir = None
self.path = None
self.exclude_patterns = []
self.ignore_warnings = False
class AndroidEclipseProjectData(object):
"""Represents an Android Eclipse project."""
__slots__ = (
'name',
'package_name',
'is_library',
'res',
'assets',
'libs',
'manifest',
'recursive_make_targets',
'extra_jars',
'included_projects',
'referenced_projects',
'_classpathentries',
'filtered_resources',
)
def __init__(self, name):
self.name = name
self.is_library = False
self.manifest = None
self.res = None
self.assets = None
self.libs = []
self.recursive_make_targets = []
self.extra_jars = []
self.included_projects = []
self.referenced_projects = []
self._classpathentries = []
self.filtered_resources = []
def add_classpathentry(self, path, srcdir, dstdir, exclude_patterns=[], ignore_warnings=False):
cpe = ClassPathEntry()
cpe.srcdir = srcdir
cpe.dstdir = dstdir
cpe.path = path
cpe.exclude_patterns = list(exclude_patterns)
cpe.ignore_warnings = ignore_warnings
self._classpathentries.append(cpe)
return cpe
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."""
+2 -7
View File
@@ -532,10 +532,7 @@ class Build(MachCommandBase):
# need to be burdened with this.
if not what:
try:
# Fennec doesn't have useful output from just building. We should
# arguably make the build action useful for Fennec. Another day...
if self.substs['MOZ_BUILD_APP'] != 'mobile/android':
print('To take your build for a test drive, run: |mach run|')
print('To take your build for a test drive, run: |mach run|')
except Exception:
# Ignore Exceptions in case we can't find config.status (such
# as when doing OSX Universal builds)
@@ -1147,7 +1144,7 @@ class Install(MachCommandBase):
@Command('install', category='post-build',
description='Install the package on the machine, or on a device.')
@CommandArgument('--verbose', '-v', action='store_true',
help='Print verbose output when installing to an Android emulator.')
help='Print verbose output.')
def install(self, verbose=False):
ret = self._run_make(directory=".", target='install', ensure_exit_code=False)
if ret == 0:
@@ -1484,8 +1481,6 @@ class ArtifactSubCommand(SubCommand):
def __call__(self, func):
after = SubCommand.__call__(self, func)
jobchoices = {
'android-api-15',
'android-x86',
'linux',
'linux64',
'macosx64',
+1 -7
View File
@@ -36,8 +36,7 @@ def build_dict(config, env=os.environ):
o = substs["OS_TARGET"]
known_os = {"Linux": "linux",
"WINNT": "win",
"Darwin": "mac",
"Android": "android"}
"Darwin": "mac"}
if o in known_os:
d["os"] = known_os[o]
else:
@@ -108,11 +107,6 @@ def build_dict(config, env=os.environ):
return p
if d['buildapp'] == 'mobile/android':
if d['processor'] == 'x86':
return 'android-x86'
return 'android-arm'
def guess_buildtype():
if d['debug']:
return 'debug'
@@ -1,153 +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
import json
import os
import unittest
from mozbuild.backend.android_eclipse import AndroidEclipseBackend
from mozbuild.frontend.emitter import TreeMetadataEmitter
from mozbuild.frontend.reader import BuildReader
from mozbuild.test.backend.common import BackendTester
from mozpack.manifests import InstallManifest
from mozunit import main
import mozpack.path as mozpath
class TestAndroidEclipseBackend(BackendTester):
def __init__(self, *args, **kwargs):
BackendTester.__init__(self, *args, **kwargs)
self.env = None
def assertExists(self, *args):
p = mozpath.join(self.env.topobjdir, 'android_eclipse', *args)
self.assertTrue(os.path.exists(p), "Path %s exists" % p)
def assertNotExists(self, *args):
p = mozpath.join(self.env.topobjdir, 'android_eclipse', *args)
self.assertFalse(os.path.exists(p), "Path %s does not exist" % p)
def test_library_project_files(self):
"""Ensure we generate reasonable files for library projects."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
for f in ['.classpath',
'.project',
'.settings',
'AndroidManifest.xml',
'project.properties']:
self.assertExists('library1', f)
def test_main_project_files(self):
"""Ensure we generate reasonable files for main (non-library) projects."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
for f in ['.classpath',
'.project',
'.settings',
'gen',
'lint.xml',
'project.properties']:
self.assertExists('main1', f)
def test_library_manifest(self):
"""Ensure we generate manifest for library projects."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertExists('library1', 'AndroidManifest.xml')
def test_classpathentries(self):
"""Ensure we produce reasonable classpathentries."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertExists('main3', '.classpath')
# This is brittle but simple.
with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main3', '.classpath'), 'rt') as fh:
lines = fh.readlines()
lines = [line.strip() for line in lines]
self.assertIn('<classpathentry including="**/*.java" kind="src" path="a" />', lines)
self.assertIn('<classpathentry excluding="b/Excludes.java|b/Excludes2.java" including="**/*.java" kind="src" path="b" />', lines)
self.assertIn('<classpathentry including="**/*.java" kind="src" path="c"><attributes><attribute name="ignore_optional_problems" value="true" /></attributes></classpathentry>', lines)
def test_library_project_setting(self):
"""Ensure we declare a library project correctly."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertExists('library1', 'project.properties')
with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'library1', 'project.properties'), 'rt') as fh:
lines = fh.readlines()
lines = [line.strip() for line in lines]
self.assertIn('android.library=true', lines)
self.assertExists('main1', 'project.properties')
with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main1', 'project.properties'), 'rt') as fh:
lines = fh.readlines()
lines = [line.strip() for line in lines]
self.assertNotIn('android.library=true', lines)
def test_referenced_projects(self):
"""Ensure we reference another project correctly."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertExists('main4', '.classpath')
# This is brittle but simple.
with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main4', '.classpath'), 'rt') as fh:
lines = fh.readlines()
lines = [line.strip() for line in lines]
self.assertIn('<classpathentry combineaccessrules="false" kind="src" path="/library1" />', lines)
def test_extra_jars(self):
"""Ensure we add class path entries to extra jars iff asked to."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertExists('main2', '.classpath')
# This is brittle but simple.
with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main2', '.classpath'), 'rt') as fh:
lines = fh.readlines()
lines = [line.strip() for line in lines]
self.assertIn('<classpathentry exported="true" kind="lib" path="%s/main2/extra.jar" />' % self.env.topsrcdir, lines)
def test_included_projects(self):
"""Ensure we include another project correctly."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertExists('main4', 'project.properties')
# This is brittle but simple.
with open(mozpath.join(self.env.topobjdir, 'android_eclipse', 'main4', 'project.properties'), 'rt') as fh:
lines = fh.readlines()
lines = [line.strip() for line in lines]
self.assertIn('android.library.reference.1=library2', lines)
def assertInManifest(self, project_name, *args):
manifest_path = mozpath.join(self.env.topobjdir, 'android_eclipse', '%s.manifest' % project_name)
manifest = InstallManifest(manifest_path)
for arg in args:
self.assertIn(arg, manifest, '%s in manifest for project %s' % (arg, project_name))
def assertNotInManifest(self, project_name, *args):
manifest_path = mozpath.join(self.env.topobjdir, 'android_eclipse', '%s.manifest' % project_name)
manifest = InstallManifest(manifest_path)
for arg in args:
self.assertNotIn(arg, manifest, '%s not in manifest for project %s' % (arg, project_name))
def test_manifest_main_manifest(self):
"""Ensure we symlink manifest if asked to for main projects."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertInManifest('main1', 'AndroidManifest.xml')
def test_manifest_res(self):
"""Ensure we symlink res/ iff asked to."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertInManifest('library1', 'res')
self.assertNotInManifest('library2', 'res')
def test_manifest_classpathentries(self):
"""Ensure we symlink classpathentries correctly."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertInManifest('main3', 'a/a', 'b', 'd/e')
def test_manifest_assets(self):
"""Ensure we symlink assets/ iff asked to."""
self.env = self._consume('android_eclipse', AndroidEclipseBackend)
self.assertNotInManifest('main1', 'assets')
self.assertInManifest('main2', 'assets')
if __name__ == '__main__':
main()
-1
View File
@@ -276,7 +276,6 @@ class TestResolver(MozbuildObject):
TEST_MANIFESTS = dict(
A11Y=('a11y', 'testing/mochitest', 'a11y', True),
BROWSER_CHROME=('browser-chrome', 'testing/mochitest', 'browser', True),
ANDROID_INSTRUMENTATION=('instrumentation', 'instrumentation', '.', False),
JETPACK_PACKAGE=('jetpack-package', 'testing/mochitest', 'jetpack-package', True),
JETPACK_ADDON=('jetpack-addon', 'testing/mochitest', 'jetpack-addon', False),
FIREFOX_UI_FUNCTIONAL=('firefox-ui-functional', 'firefox-ui', '.', False),
+3 -4
View File
@@ -60,13 +60,12 @@ def is_executable(path):
'''
Return whether a given file path points to an executable or a library,
where an executable or library is identified by:
- the file extension on OS/2 and WINNT
- the file signature on OS/X and ELF systems (GNU/Linux, Android, BSD,
Solaris)
- the file extension on WINNT
- the file signature on ELF systems (GNU/Linux, Solaris)
As this function is intended for use to choose between the ExecutableFile
and File classes in FileFinder, and choosing ExecutableFile only matters
on OS/2, OS/X, ELF and WINNT (in GCC build) systems, we don't bother
on ELF and WINNT (in GCC build) systems, we don't bother
detecting other kind of executables.
'''
from buildconfig import substs
+1 -1
View File
@@ -18,7 +18,7 @@ class MozlintParser(ArgumentParser):
{'nargs': '*',
'default': None,
'help': "Paths to file or directories to lint, like "
"'browser/components/loop' or 'mobile/android'. "
"'browser/components/loop'. "
"Defaults to the current directory if not given.",
}],
[['-l', '--linter'],
-2
View File
@@ -102,7 +102,6 @@
"import_module.jsm": ["MODULE_IMPORTED", "MODULE_URI", "SUBMODULE_IMPORTED", "same_scope", "SUBMODULE_IMPORTED_TO_SCOPE"],
"import_sub_module.jsm": ["SUBMODULE_IMPORTED", "test_obj"],
"InlineSpellChecker.jsm": ["InlineSpellChecker", "SpellCheckHelper"],
"JNI.jsm": ["JNI", "android_log"],
"jpakeclient.js": ["JPAKEClient", "SendCredentialsController"],
"Jsbeautify.jsm": ["jsBeautify"],
"jsdebugger.jsm": ["addDebuggerToGlobal"],
@@ -133,7 +132,6 @@
"mozelement.js": ["Elem", "Selector", "ID", "Link", "XPath", "Name", "Lookup", "MozMillElement", "MozMillCheckBox", "MozMillRadio", "MozMillDropList", "MozMillTextBox", "subclasses"],
"mozmill.js": ["controller", "utils", "elementslib", "os", "getBrowserController", "newBrowserController", "getAddonsController", "getPreferencesController", "newMail3PaneController", "getMail3PaneController", "wm", "platform", "getAddrbkController", "getMsgComposeController", "getDownloadsController", "Application", "findElement", "getPlacesController", "isMac", "isLinux", "isWindows", "firePythonCallback", "getAddons"],
"msgbroker.js": ["addListener", "addObject", "removeListener", "sendMessage", "log", "pass", "fail"],
"MulticastDNSAndroid.jsm": ["MulticastDNS"],
"NativeMessaging.jsm": ["HostManifestManager", "NativeApp"],
"NetworkPrioritizer.jsm": ["trackBrowserWindow"],
"NotificationDB.jsm": [],
-2
View File
@@ -12,7 +12,6 @@
and OS_ macros are defined too, since they are sometimes
convenient. */
#undef SPS_PLAT_arm_android
#undef SPS_PLAT_amd64_linux
#undef SPS_PLAT_x86_linux
#undef SPS_PLAT_amd64_darwin
@@ -24,7 +23,6 @@
#undef SPS_ARCH_x86
#undef SPS_ARCH_amd64
#undef SPS_OS_android
#undef SPS_OS_linux
#undef SPS_OS_darwin
#undef SPS_OS_windows
-32
View File
@@ -31,7 +31,6 @@
// This file is derived from the following files in
// toolkit/crashreporter/google-breakpad:
// src/common/android/include/elf.h
// src/common/linux/elfutils.h
// src/common/linux/file_id.h
// src/common/linux/elfutils-inl.h
@@ -54,38 +53,7 @@
// elfutils.h: Utilities for dealing with ELF files.
//
#if defined(LUL_OS_android)
// From toolkit/crashreporter/google-breakpad/src/common/android/include/elf.h
// The Android headers don't always define this constant.
#ifndef EM_X86_64
#define EM_X86_64 62
#endif
#ifndef EM_PPC64
#define EM_PPC64 21
#endif
#ifndef EM_S390
#define EM_S390 22
#endif
#ifndef NT_GNU_BUILD_ID
#define NT_GNU_BUILD_ID 3
#endif
#define ElfW(type) _ElfW (Elf, ELFSIZE, type)
#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
#define _ElfW_1(e,w,t) e##w##t
//FIXME
extern "C" {
extern char* basename(const char* path);
};
#else
# include <link.h>
#endif
namespace lul {
-3
View File
@@ -15,14 +15,11 @@
#undef LUL_PLAT_x64_linux
#undef LUL_PLAT_x86_linux
#undef LUL_PLAT_arm_android
#undef LUL_PLAT_x86_android
#undef LUL_ARCH_arm
#undef LUL_ARCH_x86
#undef LUL_ARCH_x64
#undef LUL_OS_android
#undef LUL_OS_linux
#if defined(__linux__) && defined(__x86_64__)
-1
View File
@@ -45,7 +45,6 @@ media/webrtc/trunk/
mfbt/decimal/
mfbt/double-conversion/
mfbt/lz4
mobile/android/thirdparty/
modules/brotli/
modules/freetype2/
modules/libbz2/