Bug 1503455 - Part 4: Compile with SDK28. r=nalexander,snorp
authorJan Henning <jh+bugzilla@buttercookie.de>
Mon, 28 Jan 2019 18:32:11 +0000
changeset 513580 22ac6aeda14eb6f96aa5e9aabc1513d7df0043ef
parent 513579 b25a6a0433d62d03c6a03d7b725a95007655800f
child 513581 49c898d16dbf22a68def68ae963b033eab07be3a
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, snorp
bugs1503455
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1503455 - Part 4: Compile with SDK28. r=nalexander,snorp android.test.* is no longer part of the main framework, so as per https://developer.android.com/training/testing/set-up-project, - we must no longer declare them as a *required* dependency in our manifests - we must explicitly include a dependency on them in our build config This will temporarily break running tests depending on android.test.* (i.e. mainly Robocop) on devices using P or newer until we also start targeting P as well. Differential Revision: https://phabricator.services.mozilla.com/D16422
build.gradle
mobile/android/app/build.gradle
mobile/android/app/src/androidTest/AndroidManifest.xml
mobile/android/geckoview/build.gradle
mobile/android/geckoview_example/src/main/AndroidManifest.xml
mobile/android/tests/browser/robocop/AndroidManifest.xml.in
python/mozboot/mozboot/android-packages.txt
--- a/build.gradle
+++ b/build.gradle
@@ -10,17 +10,17 @@ def tryInt = { string ->
 
 allprojects {
     // Expose the per-object-directory configuration to all projects.
     ext {
         mozconfig = gradle.mozconfig
         topsrcdir = gradle.mozconfig.topsrcdir
         topobjdir = gradle.mozconfig.topobjdir
 
-        compileSdkVersion = 26
+        compileSdkVersion = 28
         targetSdkVersion = tryInt(mozconfig.substs.ANDROID_TARGET_SDK)
         minSdkVersion = tryInt(mozconfig.substs.MOZ_ANDROID_MIN_SDK_VERSION)
         manifestPlaceholders = [
             ANDROID_PACKAGE_NAME: mozconfig.substs.ANDROID_PACKAGE_NAME,
             ANDROID_TARGET_SDK: mozconfig.substs.ANDROID_TARGET_SDK,
             MOZ_ANDROID_MIN_SDK_VERSION: mozconfig.substs.MOZ_ANDROID_MIN_SDK_VERSION,
             MOZ_ANDROID_SHARED_ID: "${mozconfig.substs.ANDROID_PACKAGE_NAME}.sharedID",
         ]
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -14,16 +14,20 @@ if (mozconfig.substs.MOZILLA_OFFICIAL) {
     dexcount {
         format = "tree"
     }
 }
 
 android {
     compileSdkVersion project.ext.compileSdkVersion
 
+    useLibrary 'android.test.runner'
+    useLibrary 'android.test.base'
+    useLibrary 'android.test.mock'
+
     defaultConfig {
         targetSdkVersion project.ext.targetSdkVersion
         minSdkVersion project.ext.minSdkVersion
         manifestPlaceholders = project.ext.manifestPlaceholders
 
         applicationId mozconfig.substs.ANDROID_PACKAGE_NAME
         testApplicationId 'org.mozilla.roboexample.test'
         testInstrumentationRunner 'org.mozilla.gecko.FennecInstrumentationTestRunner'
--- a/mobile/android/app/src/androidTest/AndroidManifest.xml
+++ b/mobile/android/app/src/androidTest/AndroidManifest.xml
@@ -16,17 +16,18 @@
 
     <instrumentation
         android:name="org.mozilla.gecko.FennecInstrumentationTestRunner"
         android:targetPackage="${ANDROID_PACKAGE_NAME}" />
 
     <application
         android:label="@string/app_name">
 
-        <uses-library android:name="android.test.runner" />
+        <uses-library android:name="android.test.runner"
+                      android:required="false" />
 
         <!-- Fake handlers to ensure that we have some share intents to show in our share handler list -->
         <activity android:name="org.mozilla.gecko.RobocopShare1"
                   android:label="Robocop fake activity">
 
             <intent-filter android:label="Fake robocop share handler 1">
                 <action android:name="android.intent.action.SEND" />
                 <category android:name="android.intent.category.DEFAULT" />
--- a/mobile/android/geckoview/build.gradle
+++ b/mobile/android/geckoview/build.gradle
@@ -52,16 +52,20 @@ def computeVersionNumber() {
 // Mimic Python: open(os.path.join(buildconfig.topobjdir, 'buildid.h')).readline().split()[2]
 def getBuildId() {
     return file("${topobjdir}/buildid.h").getText('utf-8').split()[2]
 }
 
 android {
     compileSdkVersion project.ext.compileSdkVersion
 
+    useLibrary 'android.test.runner'
+    useLibrary 'android.test.base'
+    useLibrary 'android.test.mock'
+
     defaultConfig {
         targetSdkVersion project.ext.targetSdkVersion
         minSdkVersion project.ext.minSdkVersion
         manifestPlaceholders = project.ext.manifestPlaceholders
 
         versionCode computeVersionCode()
         versionName "${mozconfig.substs.MOZ_APP_VERSION}-${mozconfig.substs.MOZ_UPDATE_CHANNEL}"
         consumerProguardFiles 'proguard-rules.txt'
--- a/mobile/android/geckoview_example/src/main/AndroidManifest.xml
+++ b/mobile/android/geckoview_example/src/main/AndroidManifest.xml
@@ -9,17 +9,18 @@
     <uses-permission android:name="android.permission.RECORD_AUDIO"/>
     <uses-permission android:name="android.permission.CAMERA"/>
 
     <application
             android:allowBackup="true"
             android:label="@string/app_name"
             android:supportsRtl="true"
             android:usesCleartextTraffic="true">
-        <uses-library android:name="android.test.runner"/>
+        <uses-library android:name="android.test.runner"
+                      android:required="false"/>
 
         <activity
                 android:name=".GeckoViewActivity"
                 android:label="GeckoView Example"
                 android:launchMode="singleTop"
                 android:theme="@style/Theme.AppCompat.Light.NoActionBar"
                 android:windowSoftInputMode="stateUnspecified|adjustResize">
             <intent-filter>
--- a/mobile/android/tests/browser/robocop/AndroidManifest.xml.in
+++ b/mobile/android/tests/browser/robocop/AndroidManifest.xml.in
@@ -22,17 +22,18 @@
     <instrumentation
         android:name="org.mozilla.gecko.FennecInstrumentationTestRunner"
         android:targetPackage="@ANDROID_PACKAGE_NAME@" />
 
     <application
         android:label="@string/app_name"
         android:debuggable="true">
 
-        <uses-library android:name="android.test.runner" />
+        <uses-library android:name="android.test.runner"
+                      android:required="false" />
 
         <!-- Fake handlers to ensure that we have some share intents to show in our share handler list -->
         <activity android:name="org.mozilla.gecko.RobocopShare1"
                   android:label="Robocop fake activity">
 
             <intent-filter android:label="Fake robocop share handler 1">
                 <action android:name="android.intent.action.SEND" />
                 <category android:name="android.intent.category.DEFAULT" />
--- a/python/mozboot/mozboot/android-packages.txt
+++ b/python/mozboot/mozboot/android-packages.txt
@@ -1,4 +1,4 @@
 platform-tools
 build-tools;27.0.3
-platforms;android-26
+platforms;android-28
 emulator