зеркало из https://github.com/mozilla/glean.git
Capability is now added by GeckoView directly
This commit is contained in:
Родитель
17f2c53a44
Коммит
b55bb08c5f
|
@ -38,51 +38,6 @@ class GleanMetricsYamlTransform extends ArtifactTransform {
|
|||
}
|
||||
}
|
||||
|
||||
// Add the "glean-native" capability to any geckoview-like dependency.
|
||||
//
|
||||
// This effectively replaces glean-native anywhere in the dependency tree with that GeckoView,
|
||||
// which will provide the necessary FFI implementation.
|
||||
@CompileStatic
|
||||
class GleanCapability implements ComponentMetadataRule {
|
||||
final static Set<String> GLEAN_CAPABILITY_MODULES =
|
||||
[
|
||||
'geckoview-omni',
|
||||
'geckoview-omni-armeabi-v7a',
|
||||
'geckoview-omni-arm64-v8a',
|
||||
'geckoview-omni-x86',
|
||||
'geckoview-omni-x86_64',
|
||||
|
||||
'geckoview-default-omni',
|
||||
|
||||
'geckoview-nightly-omni',
|
||||
'geckoview-nightly-omni-armeabi-v7a',
|
||||
'geckoview-nightly-omni-arm64-v8a',
|
||||
'geckoview-nightly-omni-x86',
|
||||
'geckoview-nightly-omni-x86_64',
|
||||
|
||||
'geckoview-beta-omni',
|
||||
'geckoview-beta-omni-armeabi-v7a',
|
||||
'geckoview-beta-omni-arm64-v8a',
|
||||
'geckoview-beta-omni-x86',
|
||||
'geckoview-beta-omni-x86_64',
|
||||
] as Set<String>
|
||||
|
||||
void execute(ComponentMetadataContext context) {
|
||||
context.details.with {
|
||||
if (GLEAN_CAPABILITY_MODULES.contains(id.name)) {
|
||||
println("[Glean Plugin] Adding Glean capability through GeckoView (provided by ${id.name})")
|
||||
allVariants {
|
||||
it.withCapabilities {
|
||||
// Declare glean-native capability for GeckoView
|
||||
it.addCapability("org.mozilla.telemetry", "glean-native", id.version)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("GrPackage")
|
||||
class GleanPlugin implements Plugin<Project> {
|
||||
// The version of glean_parser to install from PyPI.
|
||||
|
@ -554,11 +509,6 @@ except:
|
|||
|
||||
setupExtractMetricsFromAARTasks(project)
|
||||
|
||||
// If this project uses both Glean and GeckoView,
|
||||
// then Glean's FFI is provided by GeckoView and we need to exclude glean-native
|
||||
// (which contains the libglean_ffi).
|
||||
project.dependencies.components.all(GleanCapability)
|
||||
|
||||
project.configurations.all {
|
||||
resolutionStrategy.capabilitiesResolution.withCapability("org.mozilla.telemetry:glean-native") {
|
||||
def toBeSelected = candidates.find { it.id instanceof ModuleComponentIdentifier && it.id.module.contains('geckoview') }
|
||||
|
|
Загрузка…
Ссылка в новой задаче