forked from Zellius/android-shortcut-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.gradle
94 lines (77 loc) · 3.13 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
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
group = 'com.github.zellius'
version '0.1.1'
def repository_url = "https://github.com/Zellius"
def lib_description = 'Android Gradle plugin generates App Shortcuts shortcuts.xml for build flavors with different applicationId.'
publishing {
publications {
PluginPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact groovydocJar
artifact javadocJar
groupId project.group
artifactId "$project.name"
version project.version
pom.withXml {
def root = asNode()
root.appendNode('name', project.name)
root.appendNode('description', lib_description)
root.appendNode('url', "$repository_url/${project.name}")
root.appendNode('inceptionYear', '2016')
def scm = root.appendNode('scm')
scm.appendNode('url', "$repository_url/${project.name}")
scm.appendNode('connection', "scm:https://zellius@github.com/zellius/${project.name}.git")
scm.appendNode('developerConnection', "scm:git://github.com/zellius/${project.name}.git")
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'MIT')
license.appendNode('url', "https://raw.github.com/zellius/${project.name}/master/LICENSE")
license.appendNode('distribution', 'repo')
def developers = root.appendNode('developers')
def developer = developers.appendNode('developer')
developer.appendNode('id', 'zellius')
developer.appendNode('name', 'Sergey Solodovnikov')
developer.appendNode('email', 'elementa.ru@gmail.com')
}
}
}
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
publications = ['PluginPublication']
pkg {
repo = 'maven'
name = project.name
desc = lib_description
licenses = ['MIT']
websiteUrl = "$repository_url/${project.name}"
issueTrackerUrl = "$repository_url/${project.name}/issues"
vcsUrl = "$repository_url/${project.name}.git"
labels = ['android', 'shortcut', 'shortcuts', 'gradle', 'applicationId']
githubRepo = 'Zellius/android-shortcut-gradle-plugin'
githubReleaseNotesFile = 'README.md'
version {
name = project.version
vcsTag = "v${project.version}"
}
}
}
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
}