-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
57 lines (52 loc) · 2.21 KB
/
build.gradle
File metadata and controls
57 lines (52 loc) · 2.21 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
plugins {
alias libs.plugins.com.android.application apply false
alias libs.plugins.com.android.library apply false
alias libs.plugins.org.jetbrains.kotlin.android apply false
alias(libs.plugins.jreleaser) apply false
}
version = findProperty("LIBRARY_VERSION")
def getValueFromPropertiesFile = { propFile, key ->
if (!propFile.isFile() || !propFile.canRead())
return null
def prop = new Properties()
def reader = propFile.newReader()
try {
prop.load(reader)
} finally {
reader.close()
}
return prop.get(key)
}
ext.getValueFromLocalProperties = { name, defValue ->
def prop = project.properties[name] ?:
getValueFromPropertiesFile(project.rootProject.file('local.properties'), name)
return (null == prop) ? defValue : prop
}
// This only enforces dependency constraints for subprojects in Ditto Tools, not on consuming projects
subprojects {
configurations.configureEach {
resolutionStrategy.eachDependency { details ->
// Force androidx.activity to 1.7.2 for SDK 33 compatibility
if (details.requested.group == "androidx.activity") {
details.useVersion("1.7.2")
details.because("SDK 33 compatibility - 1.8.0+ requires API 34")
}
// Force material3 to 1.0.1 to avoid v34 resources
if (details.requested.group == "androidx.compose.material3" && details.requested.name == "material3") {
details.useVersion("1.0.1")
details.because("SDK 33 compatibility - 1.1.0+ includes API 34 only resources")
}
// Force material to 1.9.0 to avoid v34 dependencies
if (details.requested.group == "com.google.android.material" && details.requested.name == "material") {
details.useVersion("1.9.0")
details.because("SDK 33 compatibility - 1.10.0+ requires androidx.activity:1.8.0 which needs API 34")
}
}
}
}
// Built-in task
tasks.named("wrapper") {
// Change the `gradle-wrapper` value in the version catalog and run `./gradlew wrapper` to update.
gradleVersion = libs.versions.gradle.wrapper.get()
distributionType = Wrapper.DistributionType.BIN
}