-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
66 lines (55 loc) · 1.95 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
defaultTasks 'clean', 'build'
def ciCdOptimized = System.getenv("OPTIMIZE_FOR_CI_CD") == "1"
if (!ciCdOptimized) {
defaultTasks.add('publishToMavenLocal')
}
if (System.getenv("GITLAB_REPO") != null || (System.getenv("NEXUS_URL_SNAPSHOT") != null && System.getenv("NEXUS_URL_RELEASE") != null)) {
defaultTasks.add('publish')
}
subprojects {
apply plugin: 'java'
apply plugin: 'java-gradle-plugin'
apply plugin: 'maven-publish'
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
compileOnly gradleApi()
compileOnly libs.projectlombok
compileOnly libs.jetbrains.annotations
annotationProcessor libs.projectlombok
implementation libs.shadow
}
publishing {
if (System.getenv("GITLAB_REPO") != null) {
repositories {
maven {
url System.getenv("GITLAB_REPO")
name "GitLab"
credentials(HttpHeaderCredentials) {
name = 'Private-Token'
value = System.getenv("GITLAB_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
if (System.getenv("NEXUS_URL_SNAPSHOT") != null && System.getenv("NEXUS_URL_RELEASE") != null) {
repositories {
maven {
if (((String) project.version).contains("SNAPSHOT")) {
it.url = System.getenv("NEXUS_URL_SNAPSHOT")
} else {
it.url = System.getenv("NEXUS_URL_RELEASE")
}
it.credentials.username = System.getenv("NEXUS_USERNAME")
it.credentials.password = System.getenv("NEXUS_PASSWORD")
}
}
}
}
sourceCompatibility = 11
}