This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
publish.gradle
84 lines (77 loc) · 2.65 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
apply plugin: 'com.novoda.bintray-release'
// small hack to override the artifact ID via group name, if it is clean the project name will be used as artifactId
def groupID, artifactID
if (project.group.contains(":")) {
(groupID, artifactID) = project.group.split(":")
} else {
groupID = project.group
artifactID = project.name
}
logger.info("desc: " + project.description)
logger.info("group: " + groupID)
logger.info("version: " + project.version)
logger.info("artifactId: " + artifactID)
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier = 'javadoc'
from "$buildDir/javadoc"
}
publish {
userOrg = 'rewe-digital'
groupId = groupID
artifactId = artifactID
repoName = rootProject.name
publishVersion = project.version
desc = project.description
bintrayUser = project.properties['bintray.user']
bintrayKey = project.properties['bintray.apikey']
dryRun = false
publications = ['maven']
}
publishing.publications {
maven(MavenPublication) {
groupId = groupID
artifactId = artifactID
from components.java
version = project.version
artifact sourcesJar {
archiveClassifier = 'sources'
}
artifact javadocJar {
archiveClassifier = 'javadoc'
}
pom {
name = project.name
description = project.description
url = "https://rewe-digital-incubator.github.io/${rootProject.name}/${project.name}"
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
distribution = 'repo'
}
}
developers {
def maintainers = [:]
file("$rootDir/MAINTAINERS").text.eachLine { line ->
def (name, mail) = line.split('<')
maintainers[name.trim()] = mail.replace('>', '').trim()
}
maintainers.entrySet().forEach { dev ->
developer {
name = dev.key
email = dev.value
}
}
}
scm {
connection = "scm:git:git://github.com/rewe-digital-incubator/${rootProject.name}.git"
developerConnection = "scm:git:git://github.com/rewe-digital-incubator/${rootProject.name}.git"
url = "https://github.com/rewe-digital-incubator/${rootProject.name}"
}
}
}
}