-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
48 lines (42 loc) · 1.33 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
buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:6.0.1.5171"
}
}
plugins
{
id 'eclipse'
id "com.palantir.git-version" version "3.1.0"
id 'org.sonarqube'
}
def static versionLabel(gitInfo) {
def branch = gitInfo.branchName // all branches are snapshots, only tags get released
def tag = gitInfo.lastTag
// tag is returned as is. Branch may need cleanup
return branch == null ? tag : 99 + "." + branch.replace("/", "-") + "-SNAPSHOT"
}
allprojects {
group = 'org.opendcs.testing'
version = project.findProperty("versionOverride") ?: versionLabel(versionDetails())
}
sonar {
properties {
property "sonar.projectKey", "opendcs_gherkin-to-kiwi"
property "sonar.organization", "opendcs"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.pullrequest.provider", "GitHub"
property "sonar.pullrequest.github.repository", "opendcs/gherkin-to-kiwi"
property "sonar.projectVersion", sonarVersion()
}
}
ext.sonarVersion = {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--abbrev=0', "--always"
standardOutput = stdout
}
return stdout.toString().trim() + "+"
}