-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
145 lines (119 loc) · 4.26 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
buildscript {
ext.kotlinVersion = '1.7.20'
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'com.github.rodm', name: 'gradle-teamcity-plugin', version: '1.4.1'
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: "${kotlinVersion}"
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'com.github.rodm.teamcity-server'
apply plugin: 'idea'
group = 'org.jetbrains.teamcity.github'
version = "$System.env.BUILD_NUMBER"
if (version.length() == 0 || version == 'null') {
version = "SNAPSHOT"
}
ext {
pluginVersion = project.hasProperty("PluginVersion") ? "$PluginVersion"
: "SNAPSHOT"
teamcityVersion = project.hasProperty("TeamCityVersion") ? "$TeamCityVersion"
: "SNAPSHOT"
teamcityDir = "$rootDir/servers/TeamCity-${TeamCityVersion}"
teamcityDataDir = "$rootDir/data/" + (
(TeamCityVersion ==~ /(\d+\.\d+).*/) ?
((TeamCityVersion =~ /(\d+\.\d+).*/)[0][1])
: TeamCityVersion
)
teamcityJavaHome = System.properties['java.home']
}
if (TeamCityDir != null && TeamCityDir != "") {
ext.teamcityDir = TeamCityDir
ext.teamcityDataDir = "$teamcityDir/data"
}
// Remove repositories added by plugins
project.plugins.withType(JavaPlugin) {
project.repositories.clear()
}
repositories {
maven { url "https://download.jetbrains.com/teamcity-repository" }
maven {
url "https://packages.jetbrains.team/maven/p/tc/maven"
credentials {
username System.getenv("SPACE_APP_CLIENTID")
password System.getenv("SPACE_APP_SECRET")
}
}
mavenCentral()
mavenLocal()
}
configurations {
}
dependencies {
provided('org.eclipse.mylyn.github:org.eclipse.egit.github.core:4.1.0.201509280440-r') {
transitive = false
}
provided(group: 'org.jetbrains.teamcity.internal', name: 'server', version: "${TeamCityVersion}")
provided(group: 'org.jetbrains.teamcity.internal', name: 'web', version: "${TeamCityVersion}")
provided(group: 'org.jetbrains.teamcity', name: 'oauth', version: "${TeamCityVersion}")
provided(group: 'org.jetbrains.teamcity', name: 'server-web-api', version: "${TeamCityVersion}")
implementation("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
testImplementation('org.assertj:assertj-core:2.2.0')
// For Server-side Integration tests
if (file("$teamcityDir").exists()) {
testImplementation files("$teamcityDir/devPackage/tests/tests-integration.jar")
testImplementation fileTree(dir: "$teamcityDir/webapps/ROOT/WEB-INF/lib/", include: '*.jar')
}
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
test {
useTestNG()
}
teamcity {
version = TeamCityVersion
server {
descriptor {
name = project.name
displayName = 'GitHub Commit Hooks'
version = project.version
vendorName = 'JetBrains'
vendorUrl = 'https://www.jetbrains.com/'
description = 'Allows installing GitHub webhooks for GitHub repositories used by TeamCity VCS roots'
useSeparateClassloader = true
}
environments {
teamcityDev {
version = TeamCityVersion
homeDir = file(teamcityDir)
dataDir = file(teamcityDataDir)
javaHome = file(teamcityJavaHome)
serverOptions '-Xdebug'
serverOptions '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5500'
serverOptions '-Dteamcity.development.mode=true'
serverOptions '-Dteamcity.development.shadowCopyClasses=true'
}
}
}
}
// Do not include version into plugin archive name
project.tasks.getByName('serverPlugin').version = ''
if (!file("$teamcityDir").exists()) {
logger.warn("No TeamCity installation found at '$teamcityDir', integration tests would be skipped");
} else {
sourceSets {
test.kotlin.srcDirs += 'src/test-integration/kotlin'
}
}
idea {
module {
downloadJavadoc = false
downloadSources = true
}
}