-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
198 lines (171 loc) · 5.29 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
188
189
190
191
192
193
194
195
196
197
198
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath "net.saliman:gradle-cobertura-plugin:2.5.4"
classpath "org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2"
}
}
apply plugin: 'groovy'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply plugin: "net.saliman.cobertura"
apply plugin: "com.github.kt3k.coveralls"
group = 'com.bloidonia'
version = '0.9.1'
sourceCompatibility = 1.6
targetCompatibility = 1.6
compileJava.options.compilerArgs << "-Xlint:unchecked"
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'maven central' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
compile 'org.codehaus.groovy:groovy:2.3.8'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testCompile "junit:junit:4.11"
testCompile( "org.apache.ant:ant-junit:1.9.2" ) {
exclude(group: 'junit', module: 'junit')
}
testRuntime fileTree( dir:'build/libs/', includes:[ "groovy-stream-${version}.jar".toString() ] )
}
def metaServices = new File( 'src/main/groovy/META-INF/services' )
task generateModule() {
doLast {
metaServices.mkdirs()
new File( metaServices, 'org.codehaus.groovy.runtime.ExtensionModule' ).withWriter { w ->
w.writeLine 'moduleName=groovy-stream'
w.writeLine "moduleVersion=$version"
w.writeLine 'extensionClasses=groovy.stream.StreamExtension'
w.writeLine 'staticExtensionClasses='
}
}
}
task javadocCopy( type: Copy ) {
from( javadoc ) {
include '**/*.html'
filter { line -> line.contains( 'Generated by javadoc' ) ? '' : line }
}
from( javadoc ) {
include '**/*.js'
include '**/*.css'
include '**/*.gif'
}
into 'docs/assets/javadoc'
}
cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report
task coverageCopy( type: Copy ) {
from "${project.buildDir}/reports/cobertura"
into 'docs/assets/coverage'
}
coverageCopy.dependsOn( 'cobertura' )
task jbake( type:Exec ) {
commandLine 'jbake', 'docs', 'docs/output'
}
jbake.dependsOn( javadocCopy )
jbake.dependsOn( coverageCopy )
compileGroovy.dependsOn( generateModule )
test.dependsOn( jar )
uploadArchives.dependsOn( test )
jar {
from( metaServices ) {
include 'org.codehaus.groovy.runtime.ExtensionModule' into( 'META-INF/services' )
}
}
javadoc {
options.links = [ 'http://groovy.codehaus.org/api/', 'http://docs.oracle.com/javase/6/docs/api/' ]
}
task javadocJar( type: Jar, dependsOn: javadoc ) {
classifier 'javadoc'
from javadoc.destinationDir
}
task sourcesJar( type: Jar ) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
if( !hasProperty( 'bintrayUsername' ) ) {
ext.bintrayUsername = ''
}
if( !hasProperty( 'bintrayKey' ) ) {
ext.bintrayKey = ''
}
if( !hasProperty( 'keyPhrase' ) ) {
ext.keyPhrase = ''
}
def pomConfig = {
scm {
url 'https://github.com/timyates/groovy-stream'
connection 'scm:https://github.com/timyates/groovy-stream.git'
developerConnection 'scm:git://github.com/timyates/groovy-stream.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'tim_yates'
name 'Tim Yates'
email '[email protected]'
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
def root = asNode()
root.appendNode( 'name', 'Groovy Stream' )
root.appendNode( 'description', 'A collection of classes to give a fluent builder for Streams (Lazy Groovy Generators).' )
root.appendNode( 'url', 'http://timyates.github.com/groovy-stream/' )
root.appendNode( 'inceptionYear', '2012' )
root.children().last() + pomConfig
}
}
}
}
bintray {
user = bintrayUsername
key = bintrayKey
publications = ['mavenJava'] // When uploading Maven-based publication files
pkg {
repo = 'groovy-stream'
name = 'groovy-stream'
desc = 'A collection of classes to give a fluent builder for Streams (Lazy Groovy Generators).'
licenses = ['Apache-2.0']
labels = ['groovy','lazy','iterators','stream']
version {
gpg {
sign = true
passphrase = keyPhrase
}
}
}
dryRun = false
}
assemble.dependsOn( test )
bintrayUpload.dependsOn( assemble )