This repository has been archived by the owner on Oct 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
147 lines (123 loc) · 4.16 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
// This file is part of MongoMVCC.
//
// Copyright (c) 2012 Fraunhofer IGD
//
// MongoMVCC is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// MongoMVCC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with MongoMVCC. If not, see <http://www.gnu.org/licenses/>.
apply plugin: 'maven'
apply plugin: 'osgi'
apply plugin: 'signing'
version = '0.7.1'
allprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
group = 'de.fhg.igd'
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
repositories {
mavenCentral()
}
dependencies {
compile 'org.mongodb:mongo-java-driver:2.10.1'
testCompile 'junit:junit:4.10'
testCompile 'com.carrotsearch:junit-benchmarks:0.3.0'
testCompile 'net.sf.trove4j:trove4j:3.0.2'
}
}
subprojects {
apply plugin: 'java'
version = '1.0.0'
dependencies {
// subprojects depend on the root project
compile project(':')
}
}
jar {
// define OSGi bundle manifest
manifest {
name = 'MongoMVCC'
symbolicName = 'de.fhg.igd.mongomvcc'
vendor = 'Fraunhofer IGD'
instruction 'Import-Package', '*'
instruction 'Export-Package', "de.fhg.igd.*;version=${version}"
}
// include license into jar
from 'LICENSE.txt'
}
// initialize gradle wrapper
task wrapper(type: Wrapper) {
gradleVersion = '1.2'
}
// package javadoc into a jar file
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
classifier = 'javadoc'
}
// package source into a jar file
task packageSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
// define artifacts for upload
artifacts {
archives jar
archives packageJavadoc
archives packageSources
}
// sign all artifacts
signing {
required { gradle.taskGraph.hasTask(uploadArchives) }
sign configurations.archives
}
// remove test dependencies from configuration-to-scope mapping
// this also removes them from the maven pom file
conf2ScopeMappings.mappings.remove(configurations.testCompile)
uploadArchives {
repositories {
mavenDeployer {
// sign artifacts before upload
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// upload to sonatype OSS
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: this.hasProperty('sonatypeUsername') ? sonatypeUsername : '',
password: this.hasProperty('sonatypePassword') ? sonatypePassword : '')
}
// pom file details
pom.project {
name 'MongoMVCC'
packaging 'jar'
description 'Implements the MVCC model on top of MongoDB'
url 'http://www.igd.fraunhofer.de/geo'
scm {
url 'scm:git:git://github.com/igd-geo/mongomvcc.git'
connection 'scm:git:git://github.com/igd-geo/mongomvcc.git'
developerConnection 'scm:git:git://github.com/igd-geo/mongomvcc.git'
}
licenses {
license {
name 'GNU Lesser General Public License (LGPL) v3.0'
url 'http://www.gnu.org/licenses/lgpl-3.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'michel-kraemer'
name 'Michel Kraemer'
email '[email protected]'
}
}
}
}
}
}