mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 22:32:51 +00:00
Bug 1411654 - Part 1: Upgrade to Android-Gradle 3.0+ and build-tools;26.0.2. r=maliu
New Android-Gradle plugins pin the build-tools version, and we want to be consistent between Gradle and moz.build. MozReview-Commit-ID: ApWS4rHzPuH --HG-- extra : rebase_source : 5a5730b4b9ce84af40a7c73c4f1abba017103f02
This commit is contained in:
parent
188f0ab668
commit
e820c8ca18
@ -16,7 +16,6 @@ allprojects {
|
||||
topobjdir = gradle.mozconfig.topobjdir
|
||||
|
||||
compileSdkVersion = tryInt(mozconfig.substs.ANDROID_COMPILE_SDK_VERSION)
|
||||
buildToolsVersion = tryInt(mozconfig.substs.ANDROID_BUILD_TOOLS_VERSION)
|
||||
targetSdkVersion = tryInt(mozconfig.substs.ANDROID_TARGET_SDK)
|
||||
minSdkVersion = tryInt(mozconfig.substs.MOZ_ANDROID_MIN_SDK_VERSION)
|
||||
manifestPlaceholders = [
|
||||
@ -52,7 +51,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||
classpath 'com.android.tools.build:gradle:3.0.0'
|
||||
// Provided in tree.
|
||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.3'
|
||||
}
|
||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
|
||||
distributionSha256Sum=ed7e9c8bb41bd10d4c9339c95b2f8b122f5bf13188bd90504a26e0f00b123b0d
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
|
||||
distributionSha256Sum=5c07b3bac2209fbc98fb1fdf6fd831f72429cdf8c503807404eae03d8c8099e5
|
||||
|
@ -11,7 +11,6 @@ dexcount {
|
||||
|
||||
android {
|
||||
compileSdkVersion project.ext.compileSdkVersion
|
||||
buildToolsVersion project.ext.buildToolsVersion
|
||||
|
||||
defaultConfig {
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
@ -237,30 +236,31 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "com.android.support:support-v4:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
compile "com.android.support:appcompat-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
compile "com.android.support:cardview-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
compile "com.android.support:recyclerview-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
compile "com.android.support:design:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
compile "com.android.support:customtabs:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:support-v4:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:appcompat-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:cardview-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:recyclerview-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:design:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:customtabs:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:palette-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
|
||||
if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
|
||||
compile "com.android.support:mediarouter-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
compile "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
compile "com.google.android.gms:play-services-cast:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.android.support:mediarouter-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-cast:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
}
|
||||
|
||||
if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
|
||||
compile "com.google.android.gms:play-services-analytics:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-analytics:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
}
|
||||
|
||||
if (mozconfig.substs.MOZ_ANDROID_GCM) {
|
||||
compile "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
compile "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
compile "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
compile "com.google.android.gms:play-services-measurement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-measurement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
}
|
||||
|
||||
// Include LeakCanary in most gradle based builds. LeakCanary adds about 5k methods, so we disable
|
||||
@ -269,40 +269,22 @@ dependencies {
|
||||
// of this library.
|
||||
// It doesn't seem like there is a non-trivial way to be conditional on 'localOld', so instead we explicitly
|
||||
// define a version of leakcanary for every flavor:
|
||||
localCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
|
||||
localOldCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
|
||||
officialCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
|
||||
officialCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
|
||||
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
|
||||
localImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
|
||||
localOldImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
|
||||
officialImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
|
||||
officialImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
|
||||
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
|
||||
|
||||
// With a simple "compile", Gradle will always build these libraries in their default configuration
|
||||
// (i.e. release), so we need to explicitly forward our own build configuration here (bug 1385695).
|
||||
//
|
||||
// Official builds compile a hacked up app:Official..Debug, but need the
|
||||
// release versions of the dependencies, in order to not have debugging
|
||||
// information. It's not yet possible to specify just officialDebug, so we
|
||||
// hack around it here.
|
||||
if (mozconfig.substs.MOZILLA_OFFICIAL) {
|
||||
debugCompile project(path: ':geckoview', configuration: "release")
|
||||
} else {
|
||||
debugCompile project(path: ':geckoview', configuration: "debug")
|
||||
}
|
||||
releaseCompile project(path: ':geckoview', configuration: "release")
|
||||
implementation project(path: ':geckoview')
|
||||
implementation project(path: ':thirdparty')
|
||||
|
||||
if (mozconfig.substs.MOZILLA_OFFICIAL) {
|
||||
debugCompile project(path: ':thirdparty', configuration: "release")
|
||||
} else {
|
||||
debugCompile project(path: ':thirdparty', configuration: "debug")
|
||||
}
|
||||
releaseCompile project(path: ':thirdparty', configuration: "release")
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
testCompile 'org.robolectric:robolectric:3.1.2'
|
||||
testCompile 'org.simpleframework:simple-http:6.0.1'
|
||||
testCompile 'org.mockito:mockito-core:1.10.19'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
testImplementation 'org.robolectric:robolectric:3.1.2'
|
||||
testImplementation 'org.simpleframework:simple-http:6.0.1'
|
||||
testImplementation 'org.mockito:mockito-core:1.10.19'
|
||||
|
||||
// Including the Robotium JAR directly can cause issues with dexing.
|
||||
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.5.4'
|
||||
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.5.4'
|
||||
}
|
||||
|
||||
// TODO: (bug 1261486): This impl is not robust -
|
||||
@ -379,7 +361,7 @@ android.applicationVariants.all { variant ->
|
||||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
configureVariantWithJNIWrappers(variant, "Fennec")
|
||||
configureApplicationVariantWithJNIWrappers(variant, "Fennec")
|
||||
}
|
||||
|
||||
if (gradle.startParameter.taskNames.any { it.endsWith('UnitTest') }) {
|
||||
@ -416,7 +398,7 @@ android.applicationVariants.all { variant ->
|
||||
|
||||
reports {
|
||||
html.enabled = true // HTML reports for humans.
|
||||
html.destination = "$project.buildDir/reports/findbugs/findbugs-${variant.name}-output.html"
|
||||
html.destination = file("$project.buildDir/reports/findbugs/findbugs-${variant.name}-output.html")
|
||||
xml.enabled = false
|
||||
}
|
||||
}
|
||||
@ -440,7 +422,7 @@ android.applicationVariants.all { variant ->
|
||||
|
||||
reports {
|
||||
xml.enabled = true // XML reports for machines.
|
||||
xml.destination = "$project.buildDir/reports/findbugs/findbugs-${variant.name}-output.xml"
|
||||
xml.destination = file("$project.buildDir/reports/findbugs/findbugs-${variant.name}-output.xml")
|
||||
html.enabled = false
|
||||
}
|
||||
}
|
||||
@ -466,8 +448,7 @@ android.applicationVariants.all { variant ->
|
||||
|
||||
variant.outputs.each { output ->
|
||||
output.processManifest.doLast {
|
||||
[output.processManifest.manifestOutputFile,
|
||||
output.processManifest.instantRunManifestOutputFile,
|
||||
[file("${manifestOutputDirectory}/AndroidManifest.xml"),
|
||||
].each({ File manifestOutFile ->
|
||||
if (manifestOutFile.exists()) {
|
||||
def contents = manifestOutFile.getText('UTF-8')
|
||||
|
@ -579,8 +579,8 @@
|
||||
</style>
|
||||
|
||||
<style name="PopupAnimation">
|
||||
<item name="@android:windowEnterAnimation">@anim/popup_show</item>
|
||||
<item name="@android:windowExitAnimation">@anim/popup_hide</item>
|
||||
<item name="android:windowEnterAnimation">@anim/popup_show</item>
|
||||
<item name="android:windowExitAnimation">@anim/popup_hide</item>
|
||||
</style>
|
||||
|
||||
<style name="ToastBase">
|
||||
|
@ -244,7 +244,7 @@ $(eval $(call gradle_command,.gradle.deps,.aapt.deps FORCE))
|
||||
|
||||
classes.dex: .gradle.deps
|
||||
$(REPORT_BUILD)
|
||||
cp $(gradle_dir)/app/intermediates/transforms/dex/officialPhoton/debug/folders/1000/1f/main/classes.dex $@
|
||||
cp $(gradle_dir)/app/intermediates/transforms/dexMerger/officialPhoton/debug/0/classes.dex classes.dex
|
||||
|
||||
GeneratedJNIWrappers.cpp GeneratedJNIWrappers.h GeneratedJNINatives.h : .gradle.deps
|
||||
$(REPORT_BUILD)
|
||||
|
@ -38,12 +38,8 @@ def computeVersionCode() {
|
||||
|
||||
android {
|
||||
compileSdkVersion project.ext.compileSdkVersion
|
||||
buildToolsVersion project.ext.buildToolsVersion
|
||||
|
||||
defaultConfig {
|
||||
defaultPublishConfig 'release'
|
||||
publishNonDefault true
|
||||
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
minSdkVersion project.ext.minSdkVersion
|
||||
manifestPlaceholders = project.ext.manifestPlaceholders
|
||||
@ -154,8 +150,8 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "com.android.support:support-v4:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
compile "com.android.support:palette-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:support-v4:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:palette-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
}
|
||||
|
||||
apply from: "${topsrcdir}/mobile/android/gradle/with_gecko_binaries.gradle"
|
||||
@ -209,7 +205,7 @@ android.libraryVariants.all { variant ->
|
||||
}
|
||||
|
||||
android.libraryVariants.all { variant ->
|
||||
configureVariantWithJNIWrappers(variant, "Generated")
|
||||
configureLibraryVariantWithJNIWrappers(variant, "Generated")
|
||||
}
|
||||
|
||||
apply plugin: 'maven'
|
||||
|
@ -4,7 +4,6 @@ apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion project.ext.compileSdkVersion
|
||||
buildToolsVersion project.ext.buildToolsVersion
|
||||
|
||||
defaultConfig {
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
@ -36,20 +35,17 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile 'junit:junit:4.12'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
|
||||
compile 'com.android.support:support-annotations:23.4.0'
|
||||
implementation 'com.android.support:support-annotations:23.4.0'
|
||||
|
||||
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
|
||||
androidTestCompile 'com.android.support.test:runner:0.5'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
|
||||
androidTestImplementation 'com.android.support.test:runner:0.5'
|
||||
// Not defining this library again results in test-app assuming 23.1.1, and the following errors:
|
||||
// "Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.4.0) and test app (23.1.1) differ."
|
||||
androidTestCompile 'com.android.support:support-annotations:23.4.0'
|
||||
androidTestImplementation 'com.android.support:support-annotations:23.4.0'
|
||||
|
||||
debugCompile project(path: ':geckoview', configuration: "debug")
|
||||
releaseCompile project(path: ':geckoview', configuration: "release")
|
||||
withGeckoBinariesCompile project(path: ':geckoview', configuration: "withGeckoBinaries")
|
||||
withoutGeckoBinariesCompile project(path: ':geckoview', configuration: "withoutGeckoBinaries")
|
||||
implementation project(path: ':geckoview')
|
||||
}
|
||||
|
||||
apply from: "${topsrcdir}/mobile/android/gradle/with_gecko_binaries.gradle"
|
||||
|
@ -92,14 +92,39 @@ set_config('GRADLE_ANDROID_APP_TASKS', gradle_android_app_tasks)
|
||||
|
||||
|
||||
@depends(gradle_android_build_config, check_build_environment)
|
||||
@imports(_from='itertools', _import='imap')
|
||||
def gradle_android_app_apks(build_config, build_env):
|
||||
'''Paths to APK files produced by |mach android assemble-app|.'''
|
||||
flavor = '-'.join(build_config.app.variant.productFlavors)
|
||||
buildType = build_config.app.variant.buildType
|
||||
f = '{}/gradle/build/mobile/android/app/outputs/apk/app-{}-{}.apk'
|
||||
g = '{}/gradle/build/mobile/android/app/outputs/apk/app-{}-{}-androidTest.apk'
|
||||
return namespace(app_apk=f.format(build_env.topobjdir, flavor, buildType),
|
||||
app_androidTest_apk=g.format(build_env.topobjdir, flavor, buildType))
|
||||
def capitalize(s):
|
||||
# str.capitalize lower cases trailing letters.
|
||||
if s:
|
||||
return s[0].upper() + s[1:]
|
||||
else:
|
||||
return s
|
||||
|
||||
def uncapitalize(s):
|
||||
if s:
|
||||
return s[0].lower() + s[1:]
|
||||
else:
|
||||
return s
|
||||
|
||||
# Like 'officialPhoton'.
|
||||
productFlavor = uncapitalize(''.join(imap(capitalize, build_config.app.variant.productFlavors)))
|
||||
# Like 'official-photon'.
|
||||
product_flavor = '-'.join(build_config.app.variant.productFlavors)
|
||||
|
||||
substs = {
|
||||
'topobjdir': build_env.topobjdir,
|
||||
'productFlavor': productFlavor,
|
||||
'product_flavor': product_flavor,
|
||||
'buildType': build_config.app.variant.buildType,
|
||||
}
|
||||
|
||||
f = '{topobjdir}/gradle/build/mobile/android/app/outputs/apk/{productFlavor}/{buildType}/app-{product_flavor}-{buildType}.apk'
|
||||
g = '{topobjdir}/gradle/build/mobile/android/app/outputs/apk/androidTest/{productFlavor}/{buildType}/app-{product_flavor}-{buildType}-androidTest.apk'
|
||||
|
||||
return namespace(app_apk=f.format(**substs),
|
||||
app_androidTest_apk=g.format(**substs))
|
||||
|
||||
set_config('GRADLE_ANDROID_APP_APK', gradle_android_app_apks.app_apk)
|
||||
set_config('GRADLE_ANDROID_APP_ANDROIDTEST_APK', gradle_android_app_apks.app_androidTest_apk)
|
||||
@ -146,8 +171,8 @@ def gradle_android_findbugs_tasks(build_config):
|
||||
set_config('GRADLE_ANDROID_FINDBUGS_TASKS', gradle_android_findbugs_tasks)
|
||||
|
||||
|
||||
@dependable
|
||||
def gradle_android_archive_geckoview_tasks():
|
||||
@depends(gradle_android_build_config)
|
||||
def gradle_android_archive_geckoview_tasks(build_config):
|
||||
'''Gradle tasks run by |mach android archive-geckoview|.'''
|
||||
return [
|
||||
'geckoview:assembleWithGeckoBinaries',
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
||||
/* -*- Mode: Groovy; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
||||
* 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/. */
|
||||
@ -126,31 +126,20 @@ ext.configureVariantWithGeckoBinaries = { variant ->
|
||||
android.sourceSets."${sourceSet}".jniLibs.srcDir syncLibsFromDistDir.destinationDir
|
||||
}
|
||||
|
||||
ext.configureVariantWithJNIWrappers = { variant, module ->
|
||||
def jarTask
|
||||
if (module == 'Generated') {
|
||||
jarTask = tasks["package${variant.name.capitalize()}JarArtifact"]
|
||||
} else {
|
||||
jarTask = tasks["jar${variant.name.capitalize()}Classes"]
|
||||
}
|
||||
|
||||
if (jarTask.outputs.files.size() != 1) {
|
||||
throw new GradleException("Jar task output multiple files other than one single jar")
|
||||
}
|
||||
|
||||
// At configuration time, the classpath of dependencies with internal_impl
|
||||
// JAR files may not be correct. This manifests in
|
||||
ext.configureLibraryVariantWithJNIWrappers = { variant, module ->
|
||||
// Library variants have two essentially independent transform* tasks:
|
||||
//
|
||||
// 'Exception in thread "main" java.lang.NoClassDefFoundError: android/support/v4/app/ActivityCompatApi23$RequestPermissionsRequestCodeValidator'
|
||||
// - ...WithSyncLibJars... is used by assemble* and bundle*
|
||||
// - ...WithPrepareIntermediateJars... is used by consuming applications.
|
||||
//
|
||||
// when running |mach gradle clean app:generateJNI...|. We work around this
|
||||
// by configuring the classpath at evaluation-time, not configuration-time.
|
||||
//
|
||||
// The specific dependency on the `prepareDependencies` task may not be
|
||||
// necessary, but commits like
|
||||
// https://github.com/evant/gradle-retrolambda/commit/15108c65ee43be499a1359d9d4f88b0851d46769
|
||||
// suggest that it is. It certainly doesn't hurt.
|
||||
def prepareDependenciesTask = tasks.getByName("prepare${variant.name.capitalize()}Dependencies")
|
||||
// It's not really possible to insert something immediately _after_
|
||||
// ...WithPrepareIntermediateJars..., so we make the consuming moz.build
|
||||
// system invoke this target directly, and force the
|
||||
// ...WithPrepareIntermediateJars... dependency. The real consumer of the
|
||||
// JNI wrappers is the moz.build system, which always builds geckoview to
|
||||
// consume from Fennec, so that dependency likely adds less to the build time.
|
||||
def jarTask = tasks["transformClassesAndResourcesWithPrepareIntermediateJarsFor${variant.name.capitalize()}"]
|
||||
def output = jarTask.outputs.files.find({ it.absolutePath.contains('/classes.jar') })
|
||||
|
||||
def wrapperTask
|
||||
if (System.env.IS_LANGUAGE_REPACK == '1') {
|
||||
@ -160,7 +149,7 @@ ext.configureVariantWithJNIWrappers = { variant, module ->
|
||||
} else {
|
||||
wrapperTask = task("generateJNIWrappersFor${module}${variant.name.capitalize()}", type: JavaExec) {
|
||||
classpath "${topobjdir}/build/annotationProcessors/annotationProcessors.jar"
|
||||
|
||||
|
||||
// Configure the classpath at evaluation-time, not at
|
||||
// configuration-time: see above comment.
|
||||
doFirst {
|
||||
@ -171,12 +160,11 @@ ext.configureVariantWithJNIWrappers = { variant, module ->
|
||||
|
||||
main = 'org.mozilla.gecko.annotationProcessors.AnnotationProcessor'
|
||||
args module
|
||||
args jarTask.outputs.files.iterator().next()
|
||||
|
||||
args output
|
||||
|
||||
workingDir "${topobjdir}/mobile/android/base"
|
||||
|
||||
|
||||
dependsOn jarTask
|
||||
dependsOn prepareDependenciesTask
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,3 +174,29 @@ ext.configureVariantWithJNIWrappers = { variant, module ->
|
||||
tasks["assemble${variant.name.capitalize()}"].dependsOn wrapperTask
|
||||
}
|
||||
}
|
||||
|
||||
ext.configureApplicationVariantWithJNIWrappers = { variant, module ->
|
||||
def jarTask = tasks["bundleAppClasses${variant.name.capitalize()}"]
|
||||
def output = jarTask.outputs.files.find({ it.absolutePath.contains('/classes.jar') })
|
||||
|
||||
def wrapperTask = task("generateJNIWrappersFor${module}${variant.name.capitalize()}", type: JavaExec) {
|
||||
classpath "${topobjdir}/build/annotationProcessors/annotationProcessors.jar"
|
||||
|
||||
// Configure the classpath at evaluation-time, not at
|
||||
// configuration-time: see above comment.
|
||||
doFirst {
|
||||
classpath variant.javaCompile.classpath
|
||||
// Include android.jar.
|
||||
classpath variant.javaCompile.options.bootClasspath
|
||||
}
|
||||
|
||||
main = 'org.mozilla.gecko.annotationProcessors.AnnotationProcessor'
|
||||
args module
|
||||
args output
|
||||
|
||||
workingDir "${topobjdir}/mobile/android/base"
|
||||
|
||||
// This forces bundling, which isn't usually part of the assemble* process.
|
||||
dependsOn jarTask
|
||||
}
|
||||
}
|
||||
|
12
mobile/android/thirdparty/build.gradle
vendored
12
mobile/android/thirdparty/build.gradle
vendored
@ -4,12 +4,8 @@ apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion project.ext.compileSdkVersion
|
||||
buildToolsVersion project.ext.buildToolsVersion
|
||||
|
||||
defaultConfig {
|
||||
defaultPublishConfig 'release'
|
||||
publishNonDefault true
|
||||
|
||||
targetSdkVersion project.ext.targetSdkVersion
|
||||
minSdkVersion project.ext.minSdkVersion
|
||||
manifestPlaceholders = project.ext.manifestPlaceholders
|
||||
@ -47,11 +43,11 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "com.android.support:support-v4:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:support-v4:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
if (mozconfig.substs.MOZ_ANDROID_MMA) {
|
||||
compile "com.android.support:appcompat-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
compile "com.android.support:support-annotations:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
compile "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.android.support:appcompat-v7:${mozconfig.substs.ANDROID_SUPPORT_LIBRARY_VERSION}"
|
||||
implementation "com.android.support:support-annotations:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
implementation "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2116,7 +2116,7 @@ dnl ========================================================
|
||||
|
||||
case "$MOZ_BUILD_APP" in
|
||||
mobile/android)
|
||||
MOZ_ANDROID_SDK(23, 23, 25.0.3, 26.0.0 26.0.0-dev 25.3.2 25.3.1)
|
||||
MOZ_ANDROID_SDK(23, 23, 26.0.2, 26.0.0 26.0.0-dev 25.3.2 25.3.1)
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
platform-tools
|
||||
build-tools;25.0.3
|
||||
build-tools;26.0.2
|
||||
platforms;android-23
|
||||
extras;android;m2repository
|
||||
extras;google;m2repository
|
||||
|
@ -5,7 +5,7 @@ set -x -e
|
||||
echo "running as" $(id)
|
||||
|
||||
: WORKSPACE ${WORKSPACE:=/builds/worker/workspace}
|
||||
: GRADLE_VERSION ${GRADLE_VERSION:=3.4.1}
|
||||
: GRADLE_VERSION ${GRADLE_VERSION:=4.1}
|
||||
|
||||
set -v
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user