forked from abstools/abstools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
46 lines (40 loc) · 1.38 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
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
*/
// Make sure all subprojects use the same plugin versions; see
// https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0' apply false
}
// https://stackoverflow.com/questions/15061277/how-can-i-get-the-current-git-branch-in-gradle/36760102#36760102
def gitBranch() {
def branch = ""
def proc = "git rev-parse --abbrev-ref HEAD".execute()
proc.in.eachLine { line -> branch = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
// shorter version, but does not print errors:
// def branch = 'git rev-parse --abbrev-ref HEAD'.execute().text.split()[0]
branch
}
def gitVersion() {
def version = "unknown-not_compiled_in_git_repo"
def proc = "git describe --tags".execute()
proc.in.eachLine { line -> version = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
version
}
subprojects {
repositories {
mavenCentral()
}
group = 'org.abs_models'
version = gitVersion()
}
configure(subprojects.findAll { it.getPluginManager().hasPlugin('java') }) {
toolchain.languageVersion = JavaLanguageVersion.of(11)
}