-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
146 lines (119 loc) · 3.22 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
import java.nio.file.Paths
plugins {
id 'io.github.rodm.teamcity-server' version '1.5.2'
id 'org.jetbrains.kotlin.jvm' version '1.3.41'
}
initializeWorkspace()
apply plugin: 'java'
apply plugin: 'com.github.rodm.teamcity-server'
apply plugin: 'idea'
ext {
teamcityVersion = anyParam('teamcityVersion') ?: '2022.02'
versionNumber = anyParam('versionNumber') ?: 'SNAPSHOT-' + new Date().format('yyyyMMddHHmmss')
}
def localRepo = anyParamPath('TC_LOCAL_REPO')
group = 'jetbrains.buildServer.investigationsAutoAssigner'
version = versionNumber
// Remove repositories added by plugins
project.plugins.withType(JavaPlugin) {
project.repositories.clear()
}
repositories {
if (localRepo) {
maven {
name = "local-teamcity-artifacts"
url "file:///${localRepo}"
}
}
maven { url "https://download.jetbrains.com/teamcity-repository" }
mavenCentral()
mavenLocal()
}
configurations {
}
dependencies {
provided(group: 'org.jetbrains.teamcity.internal', name: 'server', version: "${teamcityVersion}")
testCompile 'org.mockito:mockito-core:2.18.0'
testCompile 'org.assertj:assertj-core:2.2.0'
testCompile 'com.google.jimfs:jimfs:1.1'
testCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile 'org.awaitility:awaitility:3.1.6'
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
test {
useTestNG()
}
teamcity {
version = teamcityVersion
allowSnapshotVersions = true
server {
descriptor {
name = project.name
displayName = 'Investigations Auto-Assigner'
version = project.version
vendorName = 'JetBrains'
vendorUrl = 'http://www.jetbrains.com/'
description = 'Automatically assigns investigations according to a set of rules.'
useSeparateClassloader = true
nodeResponsibilitiesAware = true
files {
into('kotlin-dsl') {
from("${rootProject.projectDir}/kotlin-dsl")
}
}
}
}
}
// Do not include version into plugin archive name
serverPlugin.version = null
idea {
module {
downloadJavadoc = false
downloadSources = true
}
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
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.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);
}
}
}
}