forked from ben-manes/caffeine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle
55 lines (47 loc) · 1.45 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
rootProject.name = 'caffeine'
include 'caffeine'
include 'guava'
include 'jcache'
include 'simulator'
buildCache {
local.enabled = false
local(DirectoryBuildCache) {
directory = new File(rootDir, 'build-cache')
removeUnusedEntriesAfterDays = 30
}
}
// See https://github.com/vlsi/vlsi-release-plugins
buildscript {
dependencies {
classpath('com.github.vlsi.gradle:checksum-dependency-plugin:1.19.0')
// Note: replace with below to use a locally-built jar file
// classpath(files('checksum-dependency-plugin-1.19.0.jar'))
}
repositories {
gradlePluginPortal()
}
}
// Note: we need to verify the checksum for checksum-dependency-plugin itself
def expectedSha512 =
'D7B1A0C7937DCB11536F97C52FE25752BD7DA6011299E81FA59AD446A843265A6FA079ECA1D5FD49C4B3C2496A363C60C5939268BED0B722EFB8BB6787A2B193'
def sha512(File file) {
def md = java.security.MessageDigest.getInstance('SHA-512')
file.eachByte(8192) { buffer, length ->
md.update(buffer, 0, length)
}
new BigInteger(1, md.digest()).toString(16).toUpperCase()
}
def checksumDependencyJar = buildscript.configurations.classpath.resolve().first()
def actualSha512 = sha512(checksumDependencyJar)
if (actualSha512 != expectedSha512) {
throw GradleException(
"""
Checksum mismatch for $checksumDependencyJar
Expected: $expectedSha512
Actual: $actualSha512
""".stripIndent()
)
}
if (System.env.'CI') {
apply plugin: 'com.github.vlsi.checksum-dependency'
}