Files
sousa-gecko/mobile/android/gradle/debug_level.gradle
T
Ryan VanderMeulen 73029b9510 Bug 2043932 - Migrate GeckoView off the legacy AGP variant API r=ahochheiden,android-reviewers,adhingra
AGP 9 removes the libraryVariants API. Move the Javadoc, sources, checkstyle, JNI-wrapper, debug-level, and
Maven-publishing wiring onto androidComponents.onVariants, sourcing the classpath from the javac task and
the source directories from variant.sources. The JNI wrapper and publishing are deferred to afterEvaluate,
where the AGP tasks and the debug software component exist; publishing now declares a single debug
publication.

AGP 9 also removes the android.bootClasspath and android.sdkDirectory accessors. Move the SDK bindings task
onto androidComponents.sdkComponents, resolved through lazy providers so configuration is not disturbed.

Differential Revision: https://phabricator.services.mozilla.com/D303683
2026-06-08 23:29:48 +00:00

17 lines
924 B
Groovy

/* 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/. */
// Bug 1353055 - Strip 'vars' debugging information to agree with moz.build.
ext.configureVariantDebugLevel = { variantName, buildType ->
// The default is 'lines,source,vars', which includes debugging information
// that is quite large: roughly 500kb for Fennec. Therefore we remove
// 'vars' unless we're producing a debug build, where it is useful.
if (!'debug'.equals(buildType) || mozconfig.substs.MOZILLA_OFFICIAL) {
// `onVariants` runs before AGP creates the javac task, so defer with `configureEach`.
tasks.matching { it.name == "compile${variantName.capitalize()}JavaWithJavac" }.configureEach {
options.debugOptions.debugLevel = 'lines,source'
}
}
}