-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild.gradle
187 lines (165 loc) · 6.27 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
import java.nio.file.Paths
import com.github.jk1.license.render.JsonReportRenderer
import com.github.jk1.license.filter.LicenseBundleNormalizer
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.7.0'
id "io.github.rodm.teamcity-server" version "1.5.2"
id "com.github.jk1.dependency-license-report" version "1.17"
}
initializeWorkspace()
ext {
ext.kotlin_version = '1.7.0'
version_prefix = '0.1'
teamcity_version = anyParam('teamcityVersion') ?: '2024.07-SNAPSHOT'
// compile
spring_version = '5.3.34'
sprint_vault_version = '2.3.3'
httpclient_version = '4.5.14' // version is relevant to one used inside TeamCity
// tests
jetty_version = '9.4.19.v20190610'
testcontainers_version = '1.19.8'
assertj_version = '3.26.0'
mockito_version = '4.1.0'
jackson_version = '2.14.3'
spacePackagesUrl = "https://packages.jetbrains.team/maven/p/tc/maven"
mavenRepositoryUser = findProperty('maven.repository.user')
mavenRepositoryPassword = findProperty('maven.repository.password')
caffeine_version = "2.4.0"
}
group = 'org.jetbrains.teamcity.vault'
version = anyParam('PluginVersion') ?: "SNAPSHOT"
def localRepo = anyParamPath('TC_LOCAL_REPO')
if (System.getenv('BUILD_NUMBER') != null) {
version = "${System.env.BUILD_NUMBER}"
}
subprojects {
group = rootProject.group
version = rootProject.version
apply plugin: 'java'
apply plugin: 'java-test-fixtures'
apply plugin: 'kotlin'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions { jvmTarget = '1.8' }
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
tasks.withType(org.gradle.jvm.tasks.Jar) { duplicatesStrategy = DuplicatesStrategy.EXCLUDE }
dependencies {
testImplementation("org.testng:testng:6.8")
implementation('com.amazonaws:aws-java-sdk-core:1.12.763') { dep ->
['org.apache.httpcomponents', 'commons-logging'].each{ group -> dep.exclude group: group }
}
implementation("com.google.cloud:google-cloud-iamcredentials:2.44.0") { dep ->
['org.apache.httpcomponents', 'com.google.guava', 'org.conscrypt'].each { group -> dep.exclude group: group }
exclude group: 'io.grpc', module: 'grpc-xds'
}
runtimeOnly("com.google.http-client:google-http-client-jackson2:1.44.2") {
exclude group: 'com.google.http-client'
}
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version")
testImplementation("org.jetbrains.teamcity:server-test-core:${teamcity_version}")
testImplementation("org.jetbrains.teamcity.internal:integration-test:${teamcity_version}")
testImplementation "com.github.ben-manes.caffeine:caffeine:${caffeine_version}"
testImplementation "org.jetbrains.teamcity:tests-support:${teamcity_version}"
testImplementation("javax.servlet:javax.servlet-api:3.1.0")
testImplementation("org.mockito:mockito-testng:0.4.23") {
exclude group: "org.testng", module: "testng"
}
testImplementation "org.mockito.kotlin:mockito-kotlin:4.0.0"
testImplementation("com.willowtreeapps.assertk:assertk:0.26.1")
}
test {
useTestNG()
testLogging.showStandardStreams = true
}
repositories {
if (localRepo) {
maven {
name = "local-teamcity-artifacts"
url "file:///${localRepo}"
}
}
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
maven { url "https://download.jetbrains.com/teamcity-repository/" }
google()
maven {
url = 'https://packages.jetbrains.team/maven/p/tc/maven'
credentials {
username = mavenRepositoryUser
password = mavenRepositoryPassword
}
}
}
if (System.getenv('TEAMCITY_VERSION') != null) {
test.ignoreFailures = true
}
configurations.runtimeClasspath {
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
}
}
repositories {
if (localRepo) {
maven {
name = "local-teamcity-artifacts"
url "file:///${localRepo}"
}
}
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
google()
}
configurations.testImplementation {
exclude group: "org.jetbrains.teamcity", module: "server-api"
exclude group: "org.jetbrains.teamcity", module: "server-web-api"
exclude group: "org.jetbrains.teamcity.internal", module: "plugins"
}
licenseReport {
renderers = [new JsonReportRenderer('third-party-libraries.json')]
excludes = ["org.jetbrains.*", "com.jetbrains.*", ".*jackson-bom*"]
filters = [new LicenseBundleNormalizer(bundlePath: "${project.rootDir}/license-third-party-normalizer.json", createDefaultTransformationRules: false)]
}
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
}
def initializeWorkspace() {
if (System.getProperty("idea.active") != null) {
println "Attempt to configure workspace in IDEA"
def coreVersionProperties = project.projectDir.toPath().parent.parent.resolve(".version.properties")
if (coreVersionProperties.toFile().exists()) {
def p = new Properties().tap {
it.load(new FileInputStream(coreVersionProperties.toFile()))
}
p.forEach { k,v ->
System.setProperty(k, v);
}
}
}
}