-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
99 lines (84 loc) · 2.65 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
buildscript {
// Migration in progress - see:
// https://android-developers.googleblog.com/2024/04/jetpack-compose-compiler-moving-to-kotlin-repository.html
// And
// https://developer.android.com/build/migrate-to-catalogs
repositories {
google()
mavenCentral()
}
dependencies {
classpath libs.gradle
classpath libs.kotlin.gradle.plugin
}
}
plugins {
alias libs.plugins.ksp.devtools apply false
alias libs.plugins.android.application apply false
alias libs.plugins.compose.compiler apply false
alias libs.plugins.androidx.room apply false
}
// Retrieve local context
def localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
retrieveFromEnv(localProperties) // There must be a more elegant way to do this...
// Manage optional local submodules
def sdkKotlinCheck = new File('sdk-kotlin/sdk-kotlin.gradle')
def openApiClientCheck = new File('sdk-openapi/sdk-openapi.gradle')
// Expose custom properties to all modules in the project.
ext {
githubUrl = 'https://github.com/bsinou/pydia.git'
// Expose properties retrieved from files to child projects
configs = localProperties
useLocalSdkKotlin = sdkKotlinCheck.exists()
useLocalOpenapiClient = openApiClientCheck.exists()
}
allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
}
}
/* Factorise some of the methods used in various sub projects */
// Pre-create generic common pom configuration:
ext.getBasePom = { repoURL ->
return {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "bsinou"
name "Bruno Sinou"
email "bruno.sinou@posteo.de"
}
}
scm {
url repoURL
}
}
}
// Override local.properties sensitive values with environment parameter
def static retrieveFromEnv(Properties props) {
def tmpValue = System.getenv('ANDROID_KEYSTORE_PATH')
if (tmpValue != null) {
props['keystore.path'] = tmpValue
}
tmpValue = System.getenv('ANDROID_KEYSTORE_PWD')
if (tmpValue != null) {
props['keystore.pwd'] = tmpValue
}
tmpValue = System.getenv('ANDROID_SIGNKEY_ALIAS')
if (tmpValue != null) {
props['signkey.alias'] = tmpValue
}
tmpValue = System.getenv('ANDROID_SIGNKEY_PWD')
if (tmpValue != null) {
props['signkey.pwd'] = tmpValue
}
}