-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle
More file actions
122 lines (115 loc) · 5.07 KB
/
Copy pathbuild.gradle
File metadata and controls
122 lines (115 loc) · 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
constraints {
// These pins only affect the Gradle/AGP build toolchain, not the app's runtime graph.
classpath('io.netty:netty-codec:4.1.137.Final') {
because 'Keep any settings/build-tool Netty transitives on a patched line'
}
classpath('io.netty:netty-codec-http:4.1.137.Final') {
because 'Keep any settings/build-tool Netty transitives on a patched line'
}
classpath('io.netty:netty-codec-http2:4.1.137.Final') {
because 'Keep any settings/build-tool Netty transitives on a patched line'
}
classpath('io.netty:netty-common:4.1.137.Final') {
because 'Keep any settings/build-tool Netty transitives on a patched line'
}
classpath('io.netty:netty-handler:4.1.137.Final') {
because 'Keep any settings/build-tool Netty transitives on a patched line'
}
classpath('io.netty:netty-handler-proxy:4.1.137.Final') {
because 'Keep any settings/build-tool Netty transitives on a patched line'
}
classpath('org.apache.commons:commons-lang3:3.18.0') {
because 'Dependabot flags the AGP toolchain transitive version'
}
classpath('org.bouncycastle:bcpkix-jdk18on:1.84') {
because 'Keep the AGP build toolchain on a patched Bouncy Castle line'
}
classpath('org.bouncycastle:bcprov-jdk18on:1.84') {
because 'Fix GHSA-574f-3g2m-x479 / CVE-2025-14813 in AGP transitives'
}
classpath('org.bouncycastle:bcutil-jdk18on:1.84') {
because 'Align Bouncy Castle build-tool transitive modules with bcprov'
}
classpath('org.apache.httpcomponents:httpclient:4.5.14') {
because 'Keep the AGP toolchain on a patched 4.5.x line'
}
classpath('org.bitbucket.b_c:jose4j:0.9.6') {
because 'Dependabot flags the bundletool transitive version'
}
classpath('org.jdom:jdom2:2.0.6.1') {
because 'Dependabot flags the jetifier transitive version'
}
}
}
}
plugins {
id 'com.android.application' version '9.2.1' apply false
id 'com.android.test' version '9.2.1' apply false
id 'androidx.baselineprofile' version '1.5.0-alpha06' apply false
id 'org.jetbrains.kotlin.plugin.compose' version '2.3.21' apply false
}
def patchedNettyVersion = '4.1.137.Final'
def expectedNettyBuildscriptModules = [
'netty-codec',
'netty-codec-http',
'netty-codec-http2',
'netty-common',
'netty-handler',
'netty-handler-proxy'
]
def expectedNettyBuildscriptConstraints = expectedNettyBuildscriptModules.collect { module ->
[module, patchedNettyVersion]
}
def actualNettyBuildscriptConstraints = buildscript.configurations.classpath.allDependencyConstraints
.findAll { constraint -> constraint.group == 'io.netty' }
.collect { constraint -> [constraint.name, constraint.version] }
if (
actualNettyBuildscriptConstraints.size() != expectedNettyBuildscriptConstraints.size() ||
actualNettyBuildscriptConstraints.toSet() != expectedNettyBuildscriptConstraints.toSet()
) {
throw new GradleException(
"Netty buildscript constraints must exactly match ${expectedNettyBuildscriptConstraints}; " +
"found ${actualNettyBuildscriptConstraints}"
)
}
def patchedWireVersion = '6.4.7'
def patchedWireModules = ['wire-runtime', 'wire-runtime-jvm'] as Set
allprojects { project ->
configurations.configureEach { configuration ->
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'io.netty') {
details.useVersion patchedNettyVersion
details.because 'Dependabot flags Netty from Gradle/Android test tooling transitives'
}
if (details.requested.group == 'com.squareup.wire' && patchedWireModules.contains(details.requested.name)) {
details.useVersion patchedWireVersion
details.because 'Dependabot flags Wire from AndroidX benchmark/baseline-profile transitives'
}
}
}
}
// Aggregate all variant/unit tests under the root `test` task.
def testAllUnitTests = tasks.register('test') {
group = 'verification'
description = 'Runs every unit-test task in all sub-projects'
}
subprojects {
tasks.matching { it.name.endsWith('UnitTest') }.configureEach { testTask ->
testAllUnitTests.configure { dependsOn testTask }
}
}
subprojects { subProj ->
subProj.tasks.withType(Test).configureEach {
// Always execute tests; bypass up-to-date checks
outputs.upToDateWhen { false }
// Verbose console output for test status
testLogging {
events "passed", "failed", "skipped"
exceptionFormat = "full"
showStandardStreams = true
}
}
}