-
Notifications
You must be signed in to change notification settings - Fork 32
/
build.gradle
139 lines (102 loc) · 4.19 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
apply plugin: 'idea'
buildscript {
final version = project.hasProperty( 'pluginsVersion' ) ? project.pluginsVersion : '0.3.2-SNAPSHOT'
println "> Using plugins version [$version]"
repositories {
mavenLocal()
jcenter()
maven { url 'http://evgenyg.artifactoryonline.com/evgenyg/plugins-snapshots-local/' }
}
dependencies { classpath "com.github.goldin.plugins.gradle:teamcity:$version",
"com.github.goldin.plugins.gradle:about:$version",
"com.github.goldin.plugins.gradle:duplicates:$version" }
}
ext.codenarcRuleSetFiles = [ 'codenarc.groovy' ]
ext.codenarcSources = project.subprojects*.name.collect{[ "$it/src/main/groovy", "$it/src/test/groovy" ]}.flatten()
apply from: 'http://evgenyg.artifactoryonline.com/evgenyg/libs-releases-local/CodeNarc.gradle'
apply from: 'http://evgenyg.artifactoryonline.com/evgenyg/libs-releases-local/wrapper.gradle'
idea.project {
jdkName = '1.7'
ipr.withXml { provider -> provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git' }
}
idea.module {
iml.withXml {
provider ->
provider.node.component.content.first().with {
appendNode( 'excludeFolder', [ url : 'file://$MODULE_DIR$/gradle' ])
appendNode( 'excludeFolder', [ url : 'file://$MODULE_DIR$/out' ])
}
provider.node.component.first().appendNode( 'orderEntry', [ type : 'library', name : 'Groovy', level: 'application' ])
}
}
defaultTasks 'duplicates', 'clean', 'codenarc', 'build', 'assembleTeamcityPlugin', 'about', 'install'
subprojects {
Project p ->
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'about'
apply plugin: 'duplicates'
apply from: 'https://raw.github.com/evgeny-goldin/gradle-plugins/master/teamcity/teamcity.gradle'
group = 'com.github.goldin.teamcity'
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories { maven { url 'http://evgenyg.artifactoryonline.com/evgenyg/repo/' }}
configurations { compile { extendsFrom teamcityServer }}
about {
includeDependencies = [ 'compile', 'runtime' ]
prefix = '/'
}
duplicates {
configurations = [ 'runtime' ]
verbose = true
}
dependencies {
compile ( 'org.gcontracts:gcontracts-core:1.2.12' ) { exclude group: 'junit' }
compile localGroovy(),
'commons-logging:commons-logging-api:1.1'
}
clean { delete( "$rootDir/out", "$rootDir/build" ) }
idea.module {
downloadSources = true
downloadJavadoc = false
}
assembleTeamcityPlugin.dependsOn jar, test
assembleTeamcityPluginConfig {
vendorName 'Evgeny Goldin'
vendorUrl 'http://evgeny-goldin.com'
server p
artifacts p
parameter name: 'name', value: p.name
}
/**
* Copies plugin's Zip archive into ".BuildServer/plugins".
*/
task cpz( dependsOn: assembleTeamcityPlugin ) << {
final pluginsDir = "${ System.getProperty( 'user.home' )}/.BuildServer/plugins"
final archive = assembleTeamcityPlugin.archive
delete( "$pluginsDir/$archive.name" )
copy { from archive; into pluginsDir }
}
/**
* Copies plugin's static resources into TeamCity instance.
*/
task cps() << {
final teamCityApp = [
System.getProperty( 'TeamCityApp' ),
System.getenv ( 'TeamCityApp' ),
'c:/Winny/java/TeamCity/webapps/bs',
'/Users/evgenyg/app/java/TeamCity/webapps/bs'
].grep().find { new File( it ).directory }
copy {
from 'src/main/resources/buildServerResources'
into "$teamCityApp/plugins/${ p.name }"
}
}
}
project( ':console' ) {
assembleTeamcityPluginConfig {
displayName 'Console Plugin'
description 'Plugin allowing to evaluate various code snippets in TeamCity environment'
}
}