-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
141 lines (125 loc) · 4.05 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
plugins {
id 'com.github.hierynomus.license' version '0.12.1'
id 'com.jfrog.bintray' version '1.5'
id 'com.gradle.plugin-publish' version '0.10.1'
}
apply plugin: 'java'
apply plugin: 'java-gradle-plugin'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'findbugs'
apply plugin: 'license'
apply plugin: 'com.jfrog.bintray'
apply plugin: "com.gradle.plugin-publish"
group = 'org.jayware'
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile gradleApi()
compile 'org.osgi:org.osgi.service.component.annotations:1.3.0'
compile 'org.apache.felix:org.apache.felix.scr.generator:1.18.0'
compile 'org.apache.felix:org.apache.felix.scr.ds-annotations:1.2.10'
testCompile "org.testng:testng:6.11"
testCompile "org.assertj:assertj-core:3.8.0"
testCompile "org.mockito:mockito-core:1.10.19"
}
test {
useTestNG() {}
}
findbugs {
toolVersion = '3.0.1'
sourceSets = [sourceSets.main]
}
license {
header file('HEADER.txt')
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders = true
include '**/*.java'
}
bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
pkg {
repo = 'maven'
name = 'gradle-osgi-ds'
userOrg = 'jayware'
licenses = ['Apache-2.0']
vcsUrl = project.vcsUrl
version {
name = project.version
desc = "${project.description}"
released = new Date()
vcsTag = project.version
}
}
publications = ['GradleOsgiDS']
}
pluginBundle {
website = project.website
vcsUrl = project.vcsUrl
tags = ['gradle', 'plugin', 'osgi', 'ds', 'declarative services', 'scr']
mavenCoordinates {
groupId = project.group
artifactId = project.name
version = project.version
}
}
gradlePlugin {
plugins {
osgiDs {
id = "org.jayware.osgi-ds"
displayName = 'OSGi Declarative Services plugin for Gradle'
description = project.description
implementationClass = 'org.jayware.gradle.osgi.ds.OsgiDsPlugin'
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
plugins.withType(MavenPublishPlugin) {
publishing {
publications {
GradleOsgiDS(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId project.name
version project.version
pom.withXml {
def root = asNode()
root.appendNode('name', "${project.group}:${project.name}")
root.appendNode('description', project.description)
root.appendNode('url', project.website)
root.appendNode('inceptionYear', '2016')
def scm = root.appendNode('scm')
scm.appendNode('url', project.website)
scm.appendNode('connection', project.vcsUrl)
scm.appendNode('developerConnection', project.vcsUrl)
def developers = root.appendNode('developers')
def dev = developers.appendNode('developer')
dev.appendNode('name', 'Elmar Schug')
dev.appendNode('email', 'elmar.schug@jayware.org')
dev.appendNode('organization', 'JayWare')
dev.appendNode('organizationUrl', 'https://jayware.org')
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', project.licenseName)
license.appendNode('url', project.licenseUrl)
license.appendNode('distribution', 'repo')
}
}
}
}
}