forked from concordion/concordion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.gradle
204 lines (177 loc) · 6.14 KB
/
publish.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
plugins {
id 'net.researchgate.release' version '2.3.0'
id 'org.ajoberstar.github-pages' version '1.3.1'
}
apply from: 'build.gradle'
apply plugin: 'maven-publish'
apply plugin: 'java-library-distribution'
//apply plugin: com.jfrog.bintray.gradle.BintrayPlugin
//apply plugin: org.ajoberstar.gradle.git.ghpages.GithubPagesPlugin
ext {
githubUrl = "https://github.com/concordion/${project.name}"
issuesUrl = "${githubUrl}/issues"
vcsUrl = "${githubUrl}.git"
vcsConnection = "scm:git:git://github.com/concordion/${project.name}.git"
if (!project.hasProperty("bintrayUsername")) {
bintrayUsername = ''
}
if (!project.hasProperty("bintrayApiKey")) {
bintrayApiKey = ''
}
if (!project.hasProperty("bintrayPassphrase")) {
bintrayPassphrase = ''
}
if (!project.hasProperty("sonatypeUsername")) {
sonatypeUsername = ''
}
if (!project.hasProperty("sonatypePassword")) {
sonatypePassword = ''
}
}
distributions {
// version = version - "-SNAPSHOT"
main {
contents {
from ('.') { include '*.txt','build.gradle','src/**' }
into ('lib') {
from 'licenses'
}
}
}
}
// 'gradle release' will also upload release to Nexus
createReleaseTag.dependsOn uploadArchives
createReleaseTag.dependsOn clean
publishGhPages.dependsOn test
publishGhPages.dependsOn javadoc
task publishDocs(dependsOn: ['publishGhPages'])
task publishSnapshot(dependsOn: ['test', 'publishMainPublicationToMavenRepository'])
task publishRelease(dependsOn: ['publishDocs', 'release'])
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task testJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}
publishing {
repositories {
maven {
if (project.version.endsWith('-SNAPSHOT')) {
url "http://oss.jfrog.org/artifactory/simple/oss-snapshot-local/"
credentials {
username bintrayUsername
password bintrayApiKey
}
}
}
}
}
publishing {
publications {
main(MavenPublication) {
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
artifact testJar {
classifier "tests"
}
from components.java
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name project.name
description project.description
url 'http://www.concordion.org'
packaging 'jar'
inceptionYear '2008'
scm {
url vcsUrl
connection vcsConnection
developerConnection vcsConnection
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.html'
distribution 'repo'
}
}
issueManagement{
system 'GitHub Issues'
url issuesUrl
}
developers {
developer {
id 'peterson3'
name 'David Peterson'
roles { role 'Project Creator' }
}
developer {
id 'nigel.charman.nz'
name 'Nigel Charman'
roles { role 'Project Lead' }
}
developer {
id 'drtimwright'
name 'Tim Wright'
roles { role 'Developer' }
}
developer {
id 'jose.m.beas'
name 'Jose M Beas'
roles { role 'Developer' }
}
developer {
id 'gmandnepr'
name 'Ievgen Degtiarenko'
roles { role 'Developer' }
}
developer {
id 'habuma'
roles { role 'Developer' }
}
developer {
id 'pinfieldharm'
roles { role 'Developer' }
}
developer {
id 'wangyizhuo'
roles { role 'Developer' }
}
}
}
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
githubPages {
repoUri = '[email protected]:concordion/concordion.git'
// deleteExistingFiles = false
pages {
from 'ghpages'
into ('latest') {
from ('build/reports/spec/concordion') {
into 'spec'
}
from ('build/docs/javadoc/') {
into 'javadoc'
}
}
}
}