-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
executable file
·66 lines (61 loc) · 2.45 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
executable file
·66 lines (61 loc) · 2.45 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
import org.gradle.api.artifacts.dsl.LockMode
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
val kotlinVersion = "2.3.20"
repositories {
mavenCentral()
google()
}
dependencies {
classpath("com.android.tools.build:gradle:8.13.2")
classpath(kotlin("gradle-plugin", version = kotlinVersion))
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
// Lock the external dependency graph that can be packaged into any application variant. Build
// plugins are already pinned above and the Rust workspaces use committed Cargo.lock files.
project(":app") {
val lockedApplicationConfigurations = buildSet {
add("coreLibraryDesugaring")
listOf("debug", "debugNoMinify", "nouserlib", "release", "runTests").forEach { variant ->
add("${variant}AnnotationProcessorClasspath")
add("${variant}CompileClasspath")
add("${variant}RuntimeClasspath")
add("${variant}UnitTestAnnotationProcessorClasspath")
add("${variant}UnitTestCompileClasspath")
add("${variant}UnitTestRuntimeClasspath")
}
add("debugAndroidTestAnnotationProcessorClasspath")
add("debugAndroidTestCompileClasspath")
add("debugAndroidTestRuntimeClasspath")
}
dependencyLocking {
lockMode.set(LockMode.STRICT)
}
configurations.configureEach {
if (name in lockedApplicationConfigurations) {
resolutionStrategy.activateDependencyLocking()
}
}
tasks.register("resolveApplicationDependencyLocks") {
group = "build setup"
description = "Resolves every packageable app graph; run with --write-locks after reviewed updates."
notCompatibleWithConfigurationCache("dependency lock maintenance resolves configurations explicitly")
doLast {
check(gradle.startParameter.isWriteDependencyLocks) {
"resolveApplicationDependencyLocks must be run with --write-locks"
}
lockedApplicationConfigurations.sorted().forEach { configurationName ->
configurations.getByName(configurationName).incoming.resolutionResult.allComponents
}
}
}
}