This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
settings.gradle
65 lines (62 loc) · 3.02 KB
/
settings.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
import static org.gradle.api.initialization.resolve.RepositoriesMode.FAIL_ON_PROJECT_REPOS
import static org.gradle.api.initialization.resolve.RulesMode.FAIL_ON_PROJECT_RULES
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
def fromCatalog = { String catalog, String id ->
file('gradle/' + catalog + '.versions.toml').readLines()
.findAll { String s -> s.contains id }.first().split('"')[1]
}
def pluginVersion = [
'navigation' : fromCatalog('androidxLibs', 'navigation'),
'agp' : fromCatalog('libs', 'agp'),
'dagger' : fromCatalog('libs', 'dagger'),
'dependencyAnalysis': fromCatalog('libs', 'dependencyAnalysis'),
'dependencyUpdates' : fromCatalog('libs', 'dependencyUpdates'),
'kotlin' : fromCatalog('libs', 'kotlin'),
'spotless' : fromCatalog('libs', 'spotless')
]
plugins {
id 'androidx.navigation.safeargs.kotlin' version pluginVersion.navigation
id 'com.android.application' version pluginVersion.agp
id 'com.android.library' version pluginVersion.agp
id 'dagger.hilt.android.plugin' version pluginVersion.dagger
id 'org.jetbrains.kotlin.android' version pluginVersion.kotlin
id 'org.jetbrains.kotlin.jvm' version pluginVersion.kotlin
id 'org.jetbrains.kotlin.plugin.serialization' version pluginVersion.kotlin
id 'com.autonomousapps.dependency-analysis' version pluginVersion.dependencyAnalysis
id 'com.diffplug.spotless' version pluginVersion.spotless
id 'com.github.ben-manes.versions' version pluginVersion.dependencyUpdates
}
def pluginModules = [
'androidx.navigation.safeargs.kotlin': 'androidx.navigation:navigation-safe-args-gradle-plugin:' + pluginVersion.navigation,
'com.android.application' : 'com.android.tools.build:gradle:' + pluginVersion.agp,
'com.android.library' : 'com.android.tools.build:gradle:' + pluginVersion.agp,
'dagger.hilt.android.plugin' : 'com.google.dagger:hilt-android-gradle-plugin:' + pluginVersion.dagger
]
resolutionStrategy.eachPlugin { PluginResolveDetails prd ->
def targetId = prd.target.id.id
if (pluginModules.containsKey(targetId)) prd.useModule pluginModules.get(targetId)
}
}
enableFeaturePreview('VERSION_CATALOGS')
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
dependencyResolutionManagement {
repositoriesMode.set(FAIL_ON_PROJECT_REPOS)
rulesMode.set(FAIL_ON_PROJECT_RULES)
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
versionCatalogs {
testLibs { from(files('gradle/testLibs.versions.toml')) }
androidxLibs { from(files('gradle/androidxLibs.versions.toml')) }
}
}
include(':app', ':common', ':entity',
':htz-converter-cli', ':imageloader', ':pref',
':template:android', ':template:base')