Bug 1086693 - Part 2: Generate and build Android SDK JNI wrappers. r=gps
authorNick Alexander <nalexander@mozilla.com>
Thu, 13 Nov 2014 12:47:23 -0600
changeset 215643 47fd2549de1c9c88459df81246fc3a7ab14ec101
parent 215642 cd4f9f9a469be47a9d963c513df3dbade53b4e80
child 215644 f3729315950769c90c785a5902d48d430018069f
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,20 @@ 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
+
+# The widget binding generator code is part of the annotationProcessors.
+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,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',