forked from JetBrains/teamcity-commit-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
134 lines (110 loc) · 3.67 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
buildscript {
ext.kotlinVersion = '1.0.3'
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'com.github.rodm', name: 'gradle-teamcity-plugin', version: '0.9.1'
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: "${kotlinVersion}"
}
}
apply plugin: 'java'
apply plugin: 'com.github.rodm.teamcity-server'
apply plugin: 'kotlin'
apply plugin: 'idea'
group = 'org.jetbrains.teamcity.github'
version = "$System.env.BUILD_NUMBER"
if (version.length() == 0) {
version = "SNAPSHOT"
}
ext {
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 "http://download.jetbrains.com/teamcity-repository" }
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', name: 'oauth', version: "${TeamCityVersion}")
provided(group: 'org.jetbrains.teamcity', name: 'server-web-api', version: "${TeamCityVersion}")
compile("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
testCompile 'org.assertj:assertj-core:2.2.0'
// For Server-side Integration tests
if (file("$teamcityDir").exists()) {
testCompile files("$teamcityDir/devPackage/tests/tests-integration.jar")
testCompile fileTree(dir: "$teamcityDir/webapps/ROOT/WEB-INF/lib/", include: '*.jar')
}
}
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
test {
useTestNG()
}
teamcity {
version = TeamCityVersion
server {
descriptor {
name = project.name
displayName = 'TeamCity Commit Hooks'
version = project.version
vendorName = 'JetBrains, s.r.o.'
vendorUrl = 'http://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
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}