Bug 1086693 - Part 2: Generate and build Android SDK JNI wrappers. r=gps, a=lsblakk
authorNick Alexander <nalexander@mozilla.com>
Tue, 18 Nov 2014 17:28:47 -0600
changeset 226083 6a35dcdb17d6
parent 226082 2a9f1894f93f
child 226084 0b896cfeb63a
push id4146
push userjwillcox@mozilla.com
push dateTue, 18 Nov 2014 23:29:08 +0000
treeherdermozilla-beta@cc4419d99df3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, lsblakk
bugs1086693
milestone34.0
Bug 1086693 - Part 2: Generate and build Android SDK JNI wrappers. r=gps, a=lsblakk
Makefile.in
build/annotationProcessors/Makefile.in
widget/android/bindings/Makefile.in
widget/android/bindings/mediacodec-classes.txt
widget/android/bindings/moz.build
widget/android/bindings/surfacetexture-classes.txt
widget/android/moz.build
--- a/Makefile.in
+++ b/Makefile.in
@@ -313,16 +313,20 @@ source-package install:
 .PHONY: config/export
 config/export:
 
 endif
 
 # Interdependencies for parallel export.
 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
+
 ifdef ENABLE_CLANG_PLUGIN
 js/src/export config/host: build/clang-plugin/export
 endif
 
 # Interdependencies that moz.build world don't know about yet for compilation.
 # Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
 toolkit/library/target: widget/gtk/mozgtk/gtk3/target
--- a/build/annotationProcessors/Makefile.in
+++ b/build/annotationProcessors/Makefile.in
@@ -4,9 +4,9 @@
 
 include $(topsrcdir)/config/rules.mk
 
 JAVA_CLASSPATH := $(ANDROID_SDK)/android.jar
 
 # Include Android specific java flags, instead of what's in rules.mk.
 include $(topsrcdir)/config/android-common.mk
 
-libs:: annotationProcessors.jar
+export:: annotationProcessors.jar
new file mode 100644
--- /dev/null
+++ b/widget/android/bindings/Makefile.in
@@ -0,0 +1,24 @@
+# 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/.
+
+annotation_processor_jar_files := $(DEPTH)/build/annotationProcessors/annotationProcessors.jar
+
+MediaCodec.cpp: $(ANDROID_SDK)/android.jar mediacodec-classes.txt
+	$(JAVA) -classpath $(annotation_processor_jar_files) org.mozilla.gecko.annotationProcessors.SDKProcessor $(ANDROID_SDK)/android.jar $(srcdir)/mediacodec-classes.txt $(CURDIR) MediaCodec
+
+MediaCodec.h: MediaCodec.cpp
+
+SurfaceTexture.cpp: $(ANDROID_SDK)/android.jar surfacetexture-classes.txt
+	$(JAVA) -classpath $(annotation_processor_jar_files) org.mozilla.gecko.annotationProcessors.SDKProcessor $(ANDROID_SDK)/android.jar $(srcdir)/surfacetexture-classes.txt $(CURDIR) SurfaceTexture
+
+SurfaceTexture.h: SurfaceTexture.cpp
+
+# We'd like these to be defined in a future GENERATED_EXPORTS list.
+bindings_exports_FILES := \
+  MediaCodec.h \
+  SurfaceTexture.h \
+  $(NULL)
+bindings_exports_DEST = $(DIST)/include
+bindings_exports_TARGET := export
+INSTALL_TARGETS += bindings_exports
new file mode 100644
--- /dev/null
+++ b/widget/android/bindings/mediacodec-classes.txt
@@ -0,0 +1,3 @@
+android.media.MediaCodec
+android.media.MediaCodec$BufferInfo
+android.media.MediaFormat
new file mode 100644
--- /dev/null
+++ b/widget/android/bindings/moz.build
@@ -0,0 +1,24 @@
+# -*- Mode: python; c-basic-offset: 4; 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/.
+
+GENERATED_SOURCES += [
+    'MediaCodec.cpp',
+    'SurfaceTexture.cpp',
+]
+
+# We'd like to add these to a future GENERATED_EXPORTS list, but for now we mark
+# them as generated here and manually install them in Makefile.in.
+GENERATED_FILES += [
+    'MediaCodec.h',
+    'SurfaceTexture.h',
+]
+
+FAIL_ON_WARNINGS = True
+FINAL_LIBRARY = 'xul'
+
+LOCAL_INCLUDES += [
+    '/widget/android',
+]
new file mode 100644
--- /dev/null
+++ b/widget/android/bindings/surfacetexture-classes.txt
@@ -0,0 +1,2 @@
+android.graphics.SurfaceTexture
+android.view.Surface
--- a/widget/android/moz.build
+++ b/widget/android/moz.build
@@ -1,14 +1,18 @@
 # -*- Mode: python; c-basic-offset: 4; 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/.
 
+DIRS += [
+    'bindings',
+]
+
 XPIDL_SOURCES += [
     'nsIAndroidBridge.idl',
 ]
 
 XPIDL_MODULE = 'widget_android'
 
 EXPORTS += [
     'AndroidBridge.h',