-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
88 lines (70 loc) · 2.54 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
buildscript {
ext.kotlin_version = '1.6.10'
ext.buildtools_version = '7.2.2'
ext.compose_version = '1.1.1'
repositories {
google()
mavenCentral()
}
dependencies {
classpath ("com.android.tools.build:gradle:$buildtools_version"){
// Exclude the vulnerable Bouncy Castle library
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
}
classpath "org.bouncycastle:bcprov-jdk15on:1.70"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
classpath "org.jacoco:org.jacoco.core:0.8.7"
}
}
plugins {
id "org.sonarqube" version "5.0.0.4638"
}
apply from: 'publish.gradle'
apply from: 'version.gradle'
allprojects {
apply plugin: 'jacoco'
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
tasks.register("copyGitHooks", Copy) {
description = "Copies the git hooks from /git-hooks to the .git folder."
group = "git hooks"
from("$rootDir/hooks/pre-commit")
into("$rootDir/.git/hooks/")
}
tasks.register("installGitHooks", Exec) {
description = "Installs the pre-commit git hooks from /git-hooks."
group = "git hooks"
workingDir = rootDir
commandLine "chmod", "-R", "+x", ".git/hooks/"
dependsOn("copyGitHooks")
doLast {
logger.info("Git hook installed successfully.")
}
}
afterEvaluate {
tasks.getByPath(":runtime:clean").dependsOn(":installGitHooks")
}
task updateVersionsInReadme {
doLast {
def agentVersion = project.property('agent_version')
def readmeFile = file('README.md')
def replacements = [
/classpath "com.instana:android-agent-plugin:([^"]+)"/: "classpath \"com.instana:android-agent-plugin:$agentVersion\"",
/implementation 'com.instana:android-agent-runtime:([^']+)'/: "implementation 'com.instana:android-agent-runtime:$agentVersion'",
/classpath\("com.instana:android-agent-plugin:([^"]+)"\)/: "classpath(\"com.instana:android-agent-plugin:$agentVersion\")",
/implementation\("com.instana:android-agent-runtime:([^"]+)"\)/: "implementation(\"com.instana:android-agent-runtime:$agentVersion\")"
]
def readmeContent = readmeFile.text
replacements.each { pattern, replacement ->
readmeContent = readmeContent.replaceAll(pattern, replacement)
}
readmeFile.text = readmeContent
}
}