forked from open-learning-exchange/myplanet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.gradle
More file actions
51 lines (47 loc) · 1.59 KB
/
Copy pathsettings.gradle
File metadata and controls
51 lines (47 loc) · 1.59 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
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri('https://jitpack.io') }
maven { url = uri('https://oss.sonatype.org/content/repositories/snapshots') }
}
}
include ':app'
def localProps = new Properties()
def localPropsFile = file('local.properties')
if (localPropsFile.exists()) {
localPropsFile.withInputStream { localProps.load(it) }
}
def cacheUrl = localProps.getProperty('gradle.buildCache.url') ?: System.getenv('GRADLE_BUILD_CACHE_URL')
def cacheUser = localProps.getProperty('gradle.buildCache.user') ?: System.getenv('GRADLE_BUILD_CACHE_USER')
def cachePass = localProps.getProperty('gradle.buildCache.pass') ?: System.getenv('GRADLE_BUILD_CACHE_PASS')
def cachePush = (localProps.getProperty('gradle.buildCache.push') ?: System.getenv('GRADLE_BUILD_CACHE_PUSH')) == 'true'
println "Gradle cache: GRADLE_BUILD_CACHE_URL=${cacheUrl ?: '(not set)'}"
buildCache {
local { enabled = true }
if (cacheUrl) {
remote(HttpBuildCache) {
url = uri(cacheUrl)
push = cachePush
allowInsecureProtocol = true
if (cacheUser && cachePass) {
credentials {
username = cacheUser
password = cachePass
}
}
}
} else {
println "Gradle cache: remote cache disabled (no URL)"
}
}