-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
118 lines (103 loc) · 2.6 KB
/
build.gradle
File metadata and controls
118 lines (103 loc) · 2.6 KB
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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'org.jsoup:jsoup:1.11.3'
}
}
group 'info.jdavid.alpn'
version '8.212'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
}
dependencies {}
test {
testLogging {
showStandardStreams = true
}
}
task readme() {
def readme = file('README.md')
def badge = { String label, String text, String color ->
"https://img.shields.io/badge/_${label}_-_${text}-${color}.png?style=flat"
}
String v = project.version
def download =
"https://bintray.com/artifact/download/programingjd/maven/info/jdavid/alpn/$v/alpn-boot-${v}.jar"
readme.readLines().withIndex().collect { line, i ->
switch (i) {
case 0:
return "})"
case 9: return "[Download](${download}) the latest jar."
case 19: return " <version>${v}</version>"
case 32: return " compile 'info.jdavid.alpn:alpn-boot:${v}'"
default: return line
}
}.join('\n').with { readme.text = it }
finalizedBy tasks.assemble
}
javadoc {
options.memberLevel = JavadocMemberLevel.PACKAGE
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar, javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
repositories {
maven {
url "$buildDir/repo"
}
}
}
bintray {
user = 'programingjd'
key = getBintrayApiKey()
dryRun = false
publish = true
publications = ['mavenJava']
pkg {
repo = 'maven'
name = 'info.jdavid.alpn.boot'
websiteUrl = 'https://github.com/programingjd/alpn_boot'
issueTrackerUrl = 'https://github.com/programingjd/alpn_boot/issues'
vcsUrl = 'https://github.com/programingjd/alpn_boot.git'
githubRepo = 'programingjd/alpn_boot'
githubReleaseNotesFile = 'README.md'
licenses = ['GPL-2.0']
labels = ['alpn','http2']
publicDownloadNumbers = true
version {
name = project.version
mavenCentralSync {
sync = false
}
}
}
}
tasks.bintrayUpload.dependsOn tasks.check
def getBintrayApiKey() {
def f = new File("$projectDir/local.properties")
f.text.splitEachLine('=', { if (it && it[0] == 'bintrayApiKey') return it[1] })
}