Bug 1086693 - Part 2: Generate and build Android SDK JNI wrappers. r=gps
☠☠ backed out by 12c9b418a8fc ☠ ☠
authorNick Alexander <nalexander@mozilla.com>
Tue, 11 Nov 2014 14:46:07 -0600
changeset 215058 408af1e3b457143e1cc6daa4f647436b6ade8329
parent 215057 4c759b83892a4c767dc82b56be71fd781f7b28cd
child 215059 6ea8b92479154feef7127d3b838434e3a420d566
push idunknown
push userunknown
push dateunknown
reviewersgps
bugs1086693
milestone36.0a1
Bug 1086693 - Part 2: Generate and build Android SDK JNI wrappers. r=gps
build/annotationProcessors/Makefile.in
config/recurse.mk
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/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
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -136,16 +136,17 @@ endif # ifeq (.,$(DEPTH))
 recurse:
 	@$(RECURSED_COMMAND)
 	$(LOOP_OVER_DIRS)
 
 ifeq (.,$(DEPTH))
 # Interdependencies for parallel export.
 js/xpconnect/src/export: dom/bindings/export xpcom/xpidl/export
 accessible/xpcom/export: xpcom/xpidl/export
+widget/android/bindings/export: build/annotationProcessors/export
 ifdef ENABLE_CLANG_PLUGIN
 $(filter-out build/clang-plugin/%,$(compile_targets)): build/clang-plugin/target build/clang-plugin/tests/target
 build/clang-plugin/tests/target: build/clang-plugin/target
 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)
new file mode 100644
--- /dev/null
+++ b/widget/android/bindings/Makefile.in
@@ -0,0 +1,26 @@
+# 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 := \
+  MediaCodec.h \
+  SurfaceTexture.h \
+  $(NULL)
+
+INSTALL_TARGETS += bindings_exports
+bindings_exports_FILES := $(bindings_exports)
+bindings_exports_DEST = $(DIST)/include
+bindings_exports_TARGET := export
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_INCLUDES += [
+    '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',