-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
109 lines (93 loc) · 3.04 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
100
101
102
103
104
105
106
107
108
109
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.android.application apply false
alias libs.plugins.ksp.devtools apply false
alias libs.plugins.kotlin.android apply false
alias libs.plugins.kotlin.plugin.compose apply false
// Publish the generated resources as Maven Artifacts.
// id 'maven-publish'
}
allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
}
}
// 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...
def versionProperties = new Properties()
versionProperties.load(new FileInputStream(rootProject.file("versions.properties")))
// Manage optional local sdk-java submodule
def sdkJavaCheck = new File('sdk-java/build.gradle')
// Expose custom properties to all modules in the project.
ext {
githubUrl = 'https://github.com/pydio/cells-android-app.git'
// Expose properties retrieved from files to child projects
configs = localProperties
ownVersions = versionProperties
// Shortcut to enable building the Android layers without checking out the sdk-java repository
useLocalSdkJava = sdkJavaCheck.exists()
}
/* Factorise some of the methods used in various sub projects */
// Pre-create generic common pom configuration:
ext.getBasePom = { repoURL ->
return {
licenses {
license {
name "The GNU Lesser General Public License, Version 3.0"
url "http://www.gnu.org/licenses/lgpl-3.0.txt"
distribution "repo"
}
}
developers {
developer {
id "bsinou"
name "Bruno Sinou"
email "[email protected]"
}
developer {
id "cdujeu"
name "Charles du Jeu"
email "[email protected]"
}
}
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
}
}