-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
108 lines (98 loc) · 3.61 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
108 lines (98 loc) · 3.61 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
plugins {
alias(libs.plugins.homeassistant.android.application)
alias(libs.plugins.homeassistant.android.flavor)
alias(libs.plugins.homeassistant.android.dependencies)
alias(libs.plugins.kotlin.parcelize)
}
android {
useLibrary("android.car")
defaultConfig {
// Override minSDK since automotive bellow 29 does not exist
minSdk = libs.versions.androidSdk.automotive.min.get().toInt()
// We add 3 because the app, wear (+1) and automotive versions need to have different version codes.
versionCode =
3 + checkNotNull(versionCode) { "Did you forget to apply the convention plugin that set the version code?" }
manifestPlaceholders["sentryRelease"] = "$applicationId@$versionName"
manifestPlaceholders["sentryDsn"] = System.getenv("SENTRY_DSN") ?: ""
bundle {
language {
enableSplit = false
}
}
lint {
// We disable the lint tasks for release only for automotive because the baseline cannot be parsed in release builds due to the fact that we share sources between app and automotive.
// It is not an issue since we still check the :app module and the code is exactly the same.
checkReleaseBuilds = false
// Until we fully migrate to Material3 this lint issue is too verbose https://github.com/home-assistant/android/issues/5420
disable += listOf("UsingMaterialAndMaterial3Libraries")
}
}
sourceSets {
getByName("main") {
kotlin {
directories += "../app/src/main/kotlin"
}
assets {
directories += "../app/src/main/assets"
}
res {
directories += "../app/src/main/res"
}
}
getByName("full") {
kotlin {
directories += "../app/src/full/kotlin"
}
res {
directories += "../app/src/full/res"
}
}
getByName("minimal") {
kotlin {
directories += "../app/src/minimal/kotlin"
}
res {
directories += "../app/src/minimal/res"
}
}
getByName("debug") {
kotlin {
directories += "../app/src/debug/kotlin"
}
res {
directories += "../app/src/debug/res"
}
}
getByName("release") {
kotlin {
directories += "../app/src/release/kotlin"
}
}
getByName("androidTest") {
kotlin {
directories += "../app/src/androidTest/kotlin"
}
assets {
directories += "../app/src/androidTest/assets"
}
res {
directories += "../app/src/androidTest/res"
}
}
}
}
detekt {
// Automotive reuses the app's Kotlin source sets, which are already analyzed by :app.
ignoredFlavors = listOf("full", "minimal")
}
dependencies {
// Most of the dependencies are coming from the convention plugin to avoid duplication with `:app` module.
implementation(libs.car.automotive)
ksp(project(":provides-sensor-processor"))
}
ksp {
// `:automotive` reuses `:app/src/main` sources, including AppProvidesSensorModule which references
// GeneratedProvidesSensorApp — so this module must generate that same object (suffix "app"), not
// an "automotive"-suffixed one. The two are never on the same classpath, so there's no collision.
arg("providesSensorModuleSuffix", "app")
}