# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- # vim: set filetype=python: # 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/. with Files("**"): BUG_COMPONENT = ("GeckoView", "General") SCHEDULES.exclusive = ["android"] with Files("*CompositorWidget*"): BUG_COMPONENT = ("Core", "Graphics") DIRS += [ "jni", ] if CONFIG["ENABLE_TESTS"]: DIRS += [ "tests", ] EXPORTS += [ "AndroidBridge.h", ] classes_with_WrapForJNI = [ "AndroidGamepadManager", "AndroidVsync", "Base64Utils", "ClientAuthCertificateManager", "Clipboard", "CodecProxy", "CompositorSurfaceManager", "ContentInputStream", "EnterpriseRoots", "EventCallback", "EventDispatcher", "GeckoAppShell", "GeckoAudioInfo", "GeckoBatteryManager", "GeckoBundle", "GeckoDragAndDrop", "GeckoEditableChild", "GeckoHLSDemuxerWrapper", "GeckoHLSResourceWrapper", "GeckoHLSSample", "GeckoInputStream", "GeckoJavaSampler", "GeckoNetworkManager", "GeckoProcessManager", "GeckoProcessType", "GeckoResult", "GeckoRuntime", "GeckoServiceChildProcess", "GeckoServiceGpuProcess", "GeckoSession", "GeckoSurface", "GeckoSurfaceTexture", "GeckoSystemStateListener", "GeckoThread", "GeckoViewInputStream", "GeckoVRManager", "GeckoVideoInfo", "GeckoWebExecutor", "HardwareCodecCapabilityUtils", "Image", "ImageDecoder", "MediaDrmProxy", "PanZoomController", "Sample", "SampleBuffer", "ScreenManagerHelper", "ServiceAllocator", "SessionAccessibility", "SessionKeyInfo", "SessionTextInput", "SpeechSynthesisService", "SurfaceAllocator", "SurfaceControlManager", "SurfaceTextureListener", "TelemetryUtils", "WebAuthnTokenManager", "WebAuthnUtils", "WebMessage", "WebNotification", "WebNotificationDelegate", "WebRequest", "WebRequestError", "WebResponse", "XPCOMEventTarget", ] natives_from_WrapForJNI = sorted( ["GeneratedJNI/{}Natives.h".format(c) for c in classes_with_WrapForJNI] ) wrappers_from_WrapForJNI = sorted( ["GeneratedJNI/{}Wrappers.h".format(c) for c in classes_with_WrapForJNI] ) sources_from_WrapForJNI = sorted( "GeneratedJNI/{}Wrappers.cpp".format(c) for c in classes_with_WrapForJNI ) EXPORTS.mozilla.widget += [ "AndroidCompositorWidget.h", "AndroidUiThread.h", "AndroidView.h", "AndroidVsync.h", "AndroidWidgetUtils.h", "CompositorWidgetChild.h", "CompositorWidgetParent.h", "EventDispatcher.h", "GeckoViewSupport.h", "InProcessAndroidCompositorWidget.h", "nsWindow.h", "WebExecutorSupport.h", "WindowEvent.h", ] EXPORTS.mozilla.java += ["!{}".format(c) for c in natives_from_WrapForJNI] EXPORTS.mozilla.java += ["!{}".format(c) for c in wrappers_from_WrapForJNI] SOURCES += ["!{}".format(c) for c in sources_from_WrapForJNI] SOURCES += [ "MediaKeysEventSourceFactory.cpp", ] UNIFIED_SOURCES += [ "AndroidAlerts.cpp", "AndroidBridge.cpp", "AndroidCompositorWidget.cpp", "AndroidContentController.cpp", "AndroidUiThread.cpp", "AndroidVsync.cpp", "AndroidWidgetUtils.cpp", "CompositorWidgetChild.cpp", "CompositorWidgetParent.cpp", "EventDispatcher.cpp", "GeckoEditableSupport.cpp", "GeckoProcessManager.cpp", "GfxInfo.cpp", "ImageDecoderSupport.cpp", "InProcessAndroidCompositorWidget.cpp", "nsAppShell.cpp", "nsClipboard.cpp", "nsDeviceContextAndroid.cpp", "nsDragService.cpp", "nsLookAndFeel.cpp", "nsPrintSettingsServiceAndroid.cpp", "nsUserIdleServiceAndroid.cpp", "nsWidgetFactory.cpp", "nsWindow.cpp", "OhttpHelper.cpp", "ScreenHelperAndroid.cpp", "WebExecutorSupport.cpp", ] XPCOM_MANIFESTS += [ "components.conf", ] include("/ipc/chromium/chromium-config.mozbuild") # List of stems to generate .cpp and .h files for. To add a stem, add it to # this list and ensure that $(stem)-classes.txt exists in `bindings/`. generated_bindings = [ "AccessibilityEvent", "AndroidBuild", "AndroidDragEvent", "AndroidGraphics", "AndroidInputType", "AndroidProcess", "AndroidRect", "InetAddress", "JavaBuiltins", "JavaExceptions", "KeyEvent", "MediaCodec", "MotionEvent", "SurfaceTexture", "ViewConfiguration", ] SOURCES += ["!bindings/%s.cpp" % stem for stem in generated_bindings] EXPORTS += ["!bindings/%s.h" % stem for stem in generated_bindings] # The recursive make backend treats the first output specially: it's passed as # an open FileAvoidWrite to the invoked script. That doesn't work well with # the Gradle task that generates all of the outputs, so we add a dummy first # output. t = tuple( ["generated_geckoview_files"] + natives_from_WrapForJNI + sources_from_WrapForJNI + wrappers_from_WrapForJNI + ["bindings/%s.cpp" % stem for stem in generated_bindings] + ["bindings/%s.h" % stem for stem in generated_bindings] ) GeneratedFile( *t, script="/mobile/android/gradle.py", inputs=["bindings/%s-classes.txt" % stem for stem in generated_bindings], force=True, ) FINAL_LIBRARY = "xul" LOCAL_INCLUDES += [ "/docshell/base", "/dom/base", "/dom/system/android", "/gfx/2d", "/gfx/vr", "/layout/forms", "/layout/painting", "/netwerk/base", "/widget", "/widget/headless", "/xpcom/threads", ] OS_LIBS += ["android"]