forked from timyates/groovy-stream
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
115 lines (94 loc) · 3.52 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
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'signing'
group = 'com.bloidonia'
version = '0.6'
sourceCompatibility = 1.6
targetCompatibility = 1.6
compileGroovy.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()
}
// In this section you declare the dependencies for your production and test code
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.1.6'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
testRuntime fileTree( dir:'build/libs/', includes:[ "groovy-stream-${version}.jar".toString() ] )
}
def metaServices = new File( 'src/main/groovy/META-INF/services' )
task generateModule << {
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='
}
}
compileGroovy.dependsOn( generateModule )
test.dependsOn( jar )
uploadArchives.dependsOn( test )
jar {
from( metaServices ) {
include 'org.codehaus.groovy.runtime.ExtensionModule' into( 'META-INF/services' )
}
}
task groovydocJar( type: Jar, dependsOn: groovydoc ) {
classifier 'javadoc'
from groovydoc.destinationDir
}
task sourcesJar( type: Jar ) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives sourcesJar
archives groovydocJar
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name 'Groovy Stream'
description 'A collection of classes to give a fluent builder for Streams (Lazy Groovy Generators).'
url 'http://timyates.github.com/groovy-stream/'
inceptionYear '2012'
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]'
}
}
}
}
}
}