forked from mollyim/mollyim-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
120 lines (103 loc) · 3.88 KB
/
build.gradle
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
import org.gradle.api.services.BuildService
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
ext.kotlin_version = '1.8.10'
repositories {
google()
mavenCentral()
jcenter {
content {
includeVersion 'org.jetbrains.trove4j', 'trove4j', '20160824'
}
}
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'app.cash.exhaustive:exhaustive-gradle:0.1.1'
classpath ('com.squareup.wire:wire-gradle-plugin:4.4.3') {
exclude group: 'com.squareup.wire', module: 'wire-swift-generator'
exclude group: 'com.squareup.wire', module: 'wire-grpc-client'
exclude group: 'com.squareup.wire', module: 'wire-grpc-jvm'
exclude group: 'com.squareup.wire', module: 'wire-grpc-server-generator'
exclude group: 'io.outfoxx', module: 'swiftpoet'
}
classpath 'androidx.benchmark:benchmark-gradle-plugin:1.1.0-beta04'
}
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
apply from: "${rootDir}/constants.gradle.kts"
allprojects {
// Needed because otherwise the kapt task defaults to jvmTarget 17, which "poisons the well" and requires us to bump up too
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = signalKotlinJvmTarget
}
}
}
subprojects {
ext.lib_signal_service_version_number = "2.15.3"
ext.lib_signal_service_group_info = "org.whispersystems"
ext.lib_signal_client_version = "0.1.0"
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
// MOLLY: Prevent memory starvation in parallel execution
def limiterService = gradle.sharedServices.registerIfAbsent("concurrencyConstraint", BuildService.class) {
it.maxParallelUsages.set(2)
}
//noinspection UnnecessaryQualifiedReference
def expensiveTaskClasses = [
com.android.build.gradle.internal.lint.AndroidLintAnalysisTask,
com.android.build.gradle.internal.tasks.R8Task,
org.jetbrains.kotlin.gradle.tasks.KotlinCompile,
]
tasks.configureEach { task ->
if (expensiveTaskClasses.any { it.isInstance(task) }) {
usesService(limiterService)
}
}
}
task buildQa {
group 'Verification'
description 'Quality Assurance for build logic.'
dependsOn gradle.includedBuild('build-logic').task(':tools:test')
}
task qa {
group 'Verification'
description 'Quality Assurance. Run before pushing.'
dependsOn = [
'buildQa',
':libsignal-service:test',
':app:testProdGmsWebsiteReleaseUnitTest',
':app:lintProdGmsWebsiteRelease',
':app:assembleProdFossWebsiteRelease',
':app:compileProdGmsWebsiteInstrumentationAndroidTestSources'
]
}
task clean(type: Delete) {
delete rootProject.buildDir
}
task format {
group 'Formatting'
description 'Runs the ktlint formatter on all sources in this project and included builds'
def dependencyList = subprojects.collect {
tasks.findByPath(":${it.name}:ktlintFormat")
}
dependencyList.removeIf { it == null}
dependencyList.add(0, gradle.includedBuild('build-logic').task(':plugins:ktlintFormat'))
dependencyList.add(0, gradle.includedBuild('build-logic').task(':tools:ktlintFormat'))
dependsOn dependencyList
}