forked from TomDmitriev/gradle-bundle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
176 lines (148 loc) · 5.45 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
plugins {
id 'eclipse'
id 'groovy'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '0.9.7'
id 'com.jfrog.bintray' version '1.7.3'
}
group = 'org.dm.gradle'
version = '0.10.1-SNAPSHOT'
def compatibilityVersion = 1.6
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
repositories {
jcenter()
mavenCentral()
maven { url 'http://oss.sonatype.org/content/repositories/snapshots/' }
}
sourceSets {
integTest {
groovy.srcDir file('src/integTest/groovy')
resources.srcDir file('src/integTest/resources')
}
}
tasks.matching { it.name ==~ /compile\w*/ }*.options*.encoding = 'UTF-8'
dependencies {
compile gradleApi()
compile localGroovy()
compile 'biz.aQute.bnd:biz.aQute.bndlib:3.3.0'
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
testCompile "org.codehaus.groovy:groovy-all:${project.hasProperty('groovy.version') ? project.getProperty('groovy.version') : '2.4.7'}"
testRuntime 'cglib:cglib-nodep:3.2.4'
integTestCompile sourceSets.main.output
integTestCompile configurations.testCompile
integTestRuntime configurations.testRuntime
}
task integTest(type: Test, dependsOn: classes) {
testClassesDir = sourceSets.integTest.output.classesDir
classpath = sourceSets.integTest.runtimeClasspath
reports.html.destination = file("$buildDir/reports/integTests")
reports.junitXml.destination = file("$buildDir/integTest-results")
binResultsDir = file("${reports.junitXml.destination}/binary/integTest")
}
check.dependsOn integTest
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Bundle Plugin',
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion
}
}
task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
classifier 'groovydoc'
from groovydoc.destinationDir
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives groovydocJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact groovydocJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('name', 'Gradle Bundle Plugin')
root.appendNode('description', 'Gradle plugin to generate OSGI bundles.')
root.appendNode('url', "https://github.com/TomDmitriev/${project.name}")
root.appendNode('inceptionYear', '2014')
def scm = root.appendNode('scm')
scm.appendNode('url', "https://github.com/TomDmitriev/${project.name}")
scm.appendNode('connection', "scm:https://github.com/TomDmitriev/${project.name}.git")
scm.appendNode('developerConnection', "scm:git://github.com/TomDmitriev/${project.name}.git")
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'The Apache Software License, Version 2.0')
license.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
license.appendNode('distribution', 'repo')
def developers = root.appendNode('developers')
def dev = developers.appendNode('developer')
dev.appendNode('id', 'TomDmitriev')
dev.appendNode('name', 'Artyom Dmitriev')
dev.appendNode('email', '[email protected]')
}
}
}
}
bintray {
user = project.properties['bintray.user.name']
key = project.properties['bintray.api.key']
publications = ['mavenJava']
dryRun = false
publish = true
pkg {
repo = 'gradle-plugins'
name = 'org.dm.bundle'
desc = 'Gradle Bundle Plugin allows you to create OSGI bundles.'
websiteUrl = "https://github.com/TomDmitriev/${project.name}"
issueTrackerUrl = "https://github.com/TomDmitriev/${project.name}/issues"
vcsUrl = "https://github.com/TomDmitriev/${project.name}.git"
licenses = ['Apache-2.0']
labels = ['gradle', 'bnd', 'bundle', 'osgi']
publicDownloadNumbers = true
version {
vcsTag = "v$project.version"
attributes = ['gradle-plugin': "org.dm.bundle:${project.group}:${project.name}"]
gpg {
sign = true
passphrase = project.properties['signing.password']
}
}
}
}
pluginBundle {
website = "https://github.com/TomDmitriev/${project.name}"
vcsUrl = "https://github.com/TomDmitriev/${project.name}.git"
description = 'Gradle Bundle Plugin allows you to create OSGI bundles.'
tags = ['bnd', 'bundle', 'osgi']
plugins {
greetingsPlugin {
id = 'org.dm.bundle'
displayName = 'Gradle Bundle plugin'
}
}
}
eclipse.classpath.file {
whenMerged { cp ->
cp.entries.removeAll { (it.kind == "src") && (it.path =~ /resources/) }
}
}
task wrapper(type: Wrapper) {
gradleVersion = '3.2.1'
}