-
Notifications
You must be signed in to change notification settings - Fork 44
/
build.gradle
78 lines (68 loc) · 2.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
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'signing'
apply plugin: 'maven-publish'
group = 'com.gmongo'
version = '1.5'
project.ext {
group = 'com.gmongo'
artifact = 'gmongo'
bundleDir = "$buildDir/bundle"
groovyVersion = "2.4.1"
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.codehaus.groovy', name: 'groovy', version: project.ext.groovyVersion
compile group: 'org.codehaus.groovy', name: 'groovy-ant', version: project.ext.groovyVersion
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '2.13.0'
testCompile group: 'org.codehaus.groovy', name: 'groovy-test', version: project.ext.groovyVersion
testCompile group: 'junit', name: 'junit', version: '4.10'
}
task source << {
ant.jar(destfile: "$buildDir/${project.ext.artifact}-${version}-sources.jar") {
fileset (dir: 'src/main/groovy', includes: '**/*.groovy')
}
}
task prepareBundle(dependsOn: [ 'build', 'source', 'groovydoc', 'pom' ]) << {
ant.copy(file: "$buildDir/libs/${project.ext.artifact}-${version}.jar", todir: project.ext.bundleDir)
ant.copy(file: "$buildDir/${project.ext.artifact}-${version}-sources.jar", todir: project.ext.bundleDir)
ant.copy(file: "$buildDir/pom.xml", todir: project.ext.bundleDir)
ant.jar(destfile: "${project.ext.bundleDir}/${project.ext.artifact}-${version}-javadoc.jar") {
fileset (dir: "$buildDir/docs/groovydoc")
}
signing.sign(new File(project.ext.bundleDir).listFiles())
}
task packBundle << {
ant.jar(destfile: "${project.ext.bundleDir}/${project.ext.artifact}-${version}-bundle.jar", basedir: new File(project.ext.bundleDir))
}
task pom << {
pom {
project {
groupId project.ext.group
artifactId project.ext.artifact
name 'gmongo'
description 'Mongodb for Groovy'
url 'https://github.com/poiati/gmongo'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url 'http://github.com/poiati/gmongo'
}
developers {
developer {
name 'Paulo Poiati'
email 'paulogpoiati@gmail.com'
url 'http://blog.paulopoiati.com'
}
}
}
}.writeTo("$buildDir/pom.xml")
}