-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle
100 lines (87 loc) · 2.89 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import java.nio.file.Paths
ext {
versionNumber = project.hasProperty('versionNumber') ? property('versionNumber') : 'SNAPSHOT-' + new Date().format('yyyyMMddHHmmss')
projectIds = ['group': 'teamcity-s3-storage', 'version': versionNumber, 'artifact': 's3-artifact-storage']
teamcityVersion = anyParam('teamcityVersion') ?: '2025.03-SNAPSHOT'
awsCoreVersion = anyParam('awsCoreVersion') ?: teamcityVersion ?: 'SNAPSHOT'
teamcityS3SDKVersion = project.hasProperty('teamcityS3SDKVersion') ? property('teamcityS3SDKVersion') : teamcityVersion
spaceUsername = findProperty("space.repository.user") ?: findProperty("spaceUsername")
spacePassword = findProperty("space.repository.password") ?: findProperty("spacePassword")
localRepo = anyParamPath('TC_LOCAL_REPO')
localAwsRepo = anyParamPath('TC_AWS_LOCAL_REPO') ?: anyParamPath('TC_LOCAL_REPO')
}
group = projectIds.group
version = projectIds.version
allprojects {
group = projectIds.group
version = projectIds.version
project.repositories.clear()
repositories {
if (localRepo) {
maven {
name = "local-teamcity-artifacts"
url "file:///${localRepo}"
}
}
if (localAwsRepo) {
maven {
name = "local-aws-teamcity-artifacts"
url "file:///${localAwsRepo}"
}
}
maven { url "https://repo.labs.intellij.net/teamcity" }
maven { url "https://download.jetbrains.com/teamcity-repository" }
maven { url "https://repo.labs.intellij.net/teamcity" }
maven {
url "https://packages.jetbrains.team/maven/p/tc/maven"
credentials {
username = spaceUsername as String
password = spacePassword as String
}
}
mavenLocal()
mavenCentral()
}
}
subprojects {
apply plugin: "java"
apply plugin: 'java-library'
test.useTestNG()
jar.version = null
dependencies{
api("org.jetbrains.teamcity.plugins:aws-core-common:$awsCoreVersion") {
changing = true
exclude group: 'com.fasterxml.jackson.core'
exclude group: 'com.fasterxml.jackson.dataformat'
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.jetbrains.teamcity'
}
}
tasks.withType(JavaCompile) {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
if (project.hasProperty('JDK_18')) {
options.bootstrapClasspath = layout.files("$JDK_18/jre/lib/rt.jar")
}
}
}
def anyParamPath(String... names) {
def param = anyParam(names);
if (param == null || param.isEmpty())
return null
return (Paths.get(param).isAbsolute()) ?
Paths.get(param) : getRootDir().toPath().resolve(param)
}
def anyParam(String... names) {
def param
try {
param = names.findResult {
project.hasProperty(it) ? project.getProperty(it) : System.getProperty(it) ?: System.getenv(it) ?: null
}
if (param == null || param.isEmpty())
param = null
} finally {
println("AnyParam: $names -> $param")
}
return param
}