/
bintray-publishing.gradle
95 lines (78 loc) · 2.22 KB
/
bintray-publishing.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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.15"
}
}
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
def currentVersion = "0.0.2-alpha"
bintray {
user = rootProject.findProperty('bintrayUser')
key = rootProject.findProperty('bintrayKey')
publications = ["pluginPublication"]
publish = false
pkg {
repo = 'android'
name = 'versioning'
version {
name = currentVersion
}
}
}
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
name "Łukasz Wasylkowski"
email "lukasz.wasylkowski@tooploox.com"
organization "Tooploox"
organizationUrl "https://www.tooploox.com/"
}
}
scm {
url "https://github.com/tooploox/android-versioning-plugin"
}
}
publishing {
publications {
pluginPublication(MavenPublication) {
from components.java
groupId "com.tooploox"
artifactId "versioning"
version currentVersion
artifact sourceJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', 'Gradle versioning plugin')
root.appendNode('name', 'Versioning')
root.appendNode('url', 'https://github.com/tooploox/android-versioning-plugin')
root.children().last() + pomConfig
}
}
}
}
task sourceJar(type: Jar) {
description = "An archive containing the source code"
classifier = 'sources'
from sourceSets.main.allSource
}
dokka {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"
}
task javadocJar(type: Jar, dependsOn: dokka) {
classifier = 'javadoc'
from "$buildDir/javadoc"
}
tasks.findAll { it.group == "publishing" }
.forEach { it.dependsOn 'build', 'sourceJar', 'javadocJar', 'generatePomFileForPluginPublicationPublication' }