-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
152 lines (131 loc) · 3.6 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'eclipse'
apply plugin: 'osgi'
repositories {
mavenLocal()
mavenCentral()
}
group = 'de.fhg.igd'
version = '1.1-SNAPSHOT'
jar {
// include license into jar
into 'META-INF', {
from 'LICENSE'
}
// OSGi manifest
manifest {
name = 'OSGi utilities'
symbolicName = 'de.fhg.igd.osgi.util;singleton:=true'
license = 'http://www.apache.org/licenses/LICENSE-2.0.txt;description=The Apache Software License Version 2.0'
instruction 'Bundle-Vendor', 'Fraunhofer IGD'
instruction 'Bundle-ActivationPolicy', 'lazy'
instruction 'Bundle-Activator', 'de.fhg.igd.osgi.util.OsgiUtilsActivator'
instruction 'Import-Package',
'com.google.common.util.concurrent;version="11.0"',
'org.eclipse.osgi.service.datalocation;version="[1.3,2)";resolution:=optional',
'org.osgi.framework;version="[1.6,2)"',
'org.osgi.service.prefs;version="[1.1,2)"',
'org.slf4j;version="[1.6,2)"',
'*'
}
}
dependencies {
compile 'org.eclipse.tycho:org.eclipse.osgi:3.10.0.v20140606-1445'
compile 'org.osgi:org.osgi.compendium:4.3.0'
compile 'com.google.guava:guava:11.0'
compile 'org.slf4j:slf4j-api:1.7.6'
testCompile 'junit:junit:4.11'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}
// 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
}
def configurePom(def pom) {
// ensure correct artifact ID
pom.artifactId = 'osgi-util'
// pom file details
pom.project {
name 'bnd-platform'
packaging 'jar'
description 'OSGi utilities'
url 'https://github.com/igd-geo/osgi-util'
scm {
url 'scm:git:https://github.com/igd-geo/osgi-util.git'
connection 'scm:git:https://github.com/igd-geo/osgi-util.git'
developerConnection 'scm:git:https://github.com/igd-geo/osgi-util.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 'michel-kraemer'
name 'Michel Kraemer'
email '[email protected]'
}
developer {
id 'simothum'
name 'Simon Thum'
email '[email protected]'
}
developer {
id 'stempler'
name 'Simon Templer'
email '[email protected]'
}
developer {
id 'ivo-senner'
name 'Ivo Senner'
email '[email protected]'
}
}
}
}
install {
repositories.mavenInstaller {
// ensure correct artifact ID when installing locally
configurePom(pom)
}
}
// sign all artifacts
signing {
required { gradle.taskGraph.hasTask(uploadArchives) }
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
// sign artifacts before upload
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// upload to sonatype OSS (snapshot/release)
repository(url: this.version.endsWith('-SNAPSHOT') ?
'https://oss.sonatype.org/content/repositories/snapshots' :
'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: this.hasProperty('sonatypeUsername') ? sonatypeUsername : '',
password: this.hasProperty('sonatypePassword') ? sonatypePassword : '')
}
configurePom(pom)
}
}
}