This repository has been archived by the owner on Nov 3, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.gradle
70 lines (65 loc) · 1.75 KB
/
deploy.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
/**
* Sources - build a jar with source files
*/
task sourcesJar(type: Jar, dependsOn: classes, description: 'Builds the sourcesJar.', group: 'build') {
from sourceSets.main.allSource
classifier = 'sources'
}
// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc, description: 'Builds the javadocJar.', group: 'build') {
classifier = 'javadoc'
from javadoc.destinationDir
}
/**
* Artifacts
*/
artifacts {
archives sourcesJar
archives javadocJar
}
/**
* Deployment
*/
publishing {
publications {
mainProject(MavenPublication) {
from project.components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId project.name
version (project.version.startsWith("v")) ? project.version.substring(1) : project.version
pom.withXml {
def root = asNode()
root.appendNode("description", project.description)
root.appendNode("name", project.name)
}
}
}
}
/**
* Bintray Upload
*/
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
publications = ['mainProject']
dryRun = false
publish = true
pkg {
// jcenter repository namespace and name
userOrg = project.name.toLowerCase()
repo = 'maven'
name = project.name.toLowerCase()
desc = project.description
licenses = ['MIT']
vcsUrl = System.getenv('CI_REPOSITORY_URL')
labels = []
publicDownloadNumbers = true
version {
name = String.valueOf(project.version).replace("v", "")
vcsTag = project.version
released = new Date()
}
}
}