Bug 1171288 - Add ability to build with RecyclerView support library. r=nalexander
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 16 Jun 2015 19:52:44 +0200
changeset 267619 cae5d7fee4243ddad100824bbac49246dbac6256
parent 267526 844efb38a131a2a7320c8f837413a69302c9c4fb
child 267620 e798232c7a8ace7900a4a85053f452843c1dbe52
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1171288
milestone41.0a1
Bug 1171288 - Add ability to build with RecyclerView support library. r=nalexander
build/autoconf/android.m4
mobile/android/base/Makefile.in
mobile/android/base/moz.build
mobile/android/gradle/base/build.gradle
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -255,16 +255,26 @@ if test -n "$MOZ_NATIVE_DEVICES" ; then
     AC_MSG_CHECKING([for v7 appcompat library])
     if ! test -e $ANDROID_APPCOMPAT_LIB ; then
         AC_MSG_ERROR([You must download the v7 app compat Android support library when targeting Android with native video casting support enabled.  Run the Android SDK tool and install Android Support Library under Extras.  See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_APPCOMPAT_LIB)])
     fi
     AC_MSG_RESULT([$ANDROID_APPCOMPAT_LIB])
     AC_SUBST(ANDROID_APPCOMPAT_LIB)
     AC_SUBST(ANDROID_APPCOMPAT_RES)
 
+    ANDROID_RECYCLERVIEW_LIB="$ANDROID_COMPAT_DIR_BASE/v7/recyclerview/libs/android-support-v7-recyclerview.jar"
+    ANDROID_RECYCLERVIEW_RES="$ANDROID_COMPAT_DIR_BASE/v7/recyclerview/res"
+    AC_MSG_CHECKING([for v7 recyclerview library])
+    if ! test -e $ANDROID_RECYCLERVIEW_LIB ; then
+        AC_MSG_ERROR([You must download the v7 recyclerview Android support library.  Run the Android SDK tool and install Android Support Library under Extras.  See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_RECYCLERVIEW_LIB)])
+    fi
+    AC_MSG_RESULT([$ANDROID_RECYCLERVIEW_LIB])
+    AC_SUBST(ANDROID_RECYCLERVIEW_LIB)
+    AC_SUBST(ANDROID_RECYCLERVIEW_RES)
+
     ANDROID_MEDIAROUTER_LIB="$ANDROID_COMPAT_DIR_BASE/v7/mediarouter/libs/android-support-v7-mediarouter.jar"
     ANDROID_MEDIAROUTER_RES="$ANDROID_COMPAT_DIR_BASE/v7/mediarouter/res"
     AC_MSG_CHECKING([for v7 mediarouter library])
     if ! test -e $ANDROID_MEDIAROUTER_LIB ; then
         AC_MSG_ERROR([You must download the v7 media router Android support library when targeting Android with native video casting support enabled.  Run the Android SDK tool and install Android Support Library under Extras.  See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_MEDIAROUTER_LIB)])
     fi
     AC_MSG_RESULT([$ANDROID_MEDIAROUTER_LIB])
     AC_SUBST(ANDROID_MEDIAROUTER_LIB)
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -59,32 +59,35 @@ GARBAGE_DIRS += classes db jars res sync
 # over changes in behaviour between versions.
 JAVA_BOOTCLASSPATH := \
     $(ANDROID_SDK)/android.jar \
     $(ANDROID_COMPAT_LIB) \
     $(NULL)
 
 JAVA_BOOTCLASSPATH := $(subst $(NULL) ,:,$(strip $(JAVA_BOOTCLASSPATH)))
 
+JAVA_CLASSPATH += $(ANDROID_RECYCLERVIEW_LIB)
+
 # If native devices are enabled, add Google Play Services and some of the v7
 # compat libraries.
 ifdef MOZ_NATIVE_DEVICES
     JAVA_CLASSPATH += \
         $(GOOGLE_PLAY_SERVICES_LIB) \
         $(ANDROID_MEDIAROUTER_LIB) \
         $(ANDROID_APPCOMPAT_LIB) \
         $(NULL)
 endif
 
 JAVA_CLASSPATH := $(subst $(NULL) ,:,$(strip $(JAVA_CLASSPATH)))
 
 # Library jars that we're bundling: these are subject to Proguard before inclusion
 # into classes.dex.
 java_bundled_libs := \
     $(ANDROID_COMPAT_LIB) \
+    $(ANDROID_RECYCLERVIEW_LIB) \
     $(NULL)
 
 ifdef MOZ_NATIVE_DEVICES
     java_bundled_libs += \
         $(GOOGLE_PLAY_SERVICES_LIB) \
         $(ANDROID_MEDIAROUTER_LIB) \
         $(ANDROID_APPCOMPAT_LIB) \
         $(NULL)
@@ -364,29 +367,33 @@ geckoview_resources.zip: $(all_resources
 # Make to treat the target differently, in a way that defeats our
 # dependencies.
 
 generated/org/mozilla/gecko/R.java: .aapt.deps ;
 
 # If native devices are enabled, add Google Play Services, build their resources
 generated/android/support/v7/appcompat/R.java: .aapt.deps ;
 generated/android/support/v7/mediarouter/R.java: .aapt.deps ;
+generated/android/support/v7/recyclerview/R.java: .aapt.deps ;
 generated/com/google/android/gms/R.java: .aapt.deps ;
 
 ifdef MOZ_NATIVE_DEVICES
     extra_packages += android.support.v7.appcompat
     extra_res_dirs += $(ANDROID_APPCOMPAT_RES)
 
     extra_packages += android.support.v7.mediarouter
     extra_res_dirs += $(ANDROID_MEDIAROUTER_RES)
 
     extra_packages += com.google.android.gms
     extra_res_dirs += $(GOOGLE_PLAY_SERVICES_RES)
 endif
 
+extra_packages += android.support.v7.recyclerview
+extra_res_dirs += $(ANDROID_RECYCLERVIEW_RES)
+
 gecko.ap_: .aapt.deps ;
 R.txt: .aapt.deps ;
 
 # [Comment 2/3] This tom-foolery provides a target that forces a
 # rebuild of gecko.ap_.  This is used during packaging to ensure that
 # resources are fresh.  The alternative would be complicated; see
 # [Comment 1/3].
 
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -39,16 +39,18 @@ resjar.generated_sources += [
     'org/mozilla/gecko/R.java',
 ]
 
 if CONFIG['MOZ_NATIVE_DEVICES']:
     resjar.generated_sources += ['com/google/android/gms/R.java']
     resjar.generated_sources += ['android/support/v7/appcompat/R.java']
     resjar.generated_sources += ['android/support/v7/mediarouter/R.java']
 
+resjar.generated_sources += ['android/support/v7/recyclerview/R.java']
+
 resjar.javac_flags += ['-Xlint:all']
 
 mgjar = add_java_jar('gecko-mozglue')
 mgjar.sources += [
     'mozglue/ByteBufferInputStream.java',
     'mozglue/ContextUtils.java',
     'mozglue/DirectBufferAllocator.java',
     'mozglue/GeckoLoader.java',
@@ -611,16 +613,17 @@ moz_native_devices_sources = [
     'ChromeCast.java',
     'GeckoMediaPlayer.java',
     'MediaPlayerManager.java',
     'PresentationMediaPlayerManager.java',
 ]
 if CONFIG['MOZ_NATIVE_DEVICES']:
     gbjar.extra_jars += moz_native_devices_jars
     gbjar.sources += moz_native_devices_sources
+gbjar.extra_jars += [CONFIG['ANDROID_RECYCLERVIEW_LIB']]
 
 gbjar.javac_flags += ['-Xlint:all,-deprecation,-fallthrough', '-J-Xmx512m', '-J-Xms128m']
 
 # gecko-thirdparty is a good place to put small independent libraries
 gtjar = add_java_jar('gecko-thirdparty')
 gtjar.sources += [ thirdparty_source_dir + f for f in [
     'com/nineoldandroids/animation/Animator.java',
     'com/nineoldandroids/animation/AnimatorInflater.java',
--- a/mobile/android/gradle/base/build.gradle
+++ b/mobile/android/gradle/base/build.gradle
@@ -43,16 +43,17 @@ android {
                 }
             }
         }
     }
 }
 
 dependencies {
     compile 'com.android.support:support-v4:22.2.0'
+    compile 'com.android.support:recyclerview-v7:22.2.0'
 
     if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
         compile 'com.android.support:appcompat-v7:22.2.0'
         compile 'com.android.support:mediarouter-v7:22.2.0'
         compile 'com.google.android.gms:play-services-base:6.5.+'
         compile 'com.google.android.gms:play-services-cast:6.5.+'
     }