This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
publishing.gradle
71 lines (65 loc) · 2.83 KB
/
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
apply plugin: 'maven-publish'
apply plugin: 'signing'
signing {
def signingKeyId = findProperty("signingKeyId")
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications
}
publishing {
publications {
def maven = create(project.name, MavenPublication) {
group = project.group
version project.version
it.artifact(project.tasks.sourcesJar)
it.artifact(project.tasks.javadocJar)
it.artifact(project.tasks.jar)
it.pom.withXml {
def dependenciesNode = asNode().appendNode("dependencies")
project.configurations.compileOnly.dependencies.each {
if (!(it instanceof SelfResolvingDependency)) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
dependencyNode.appendNode('scope', 'provided')
}
}
if (!project.tasks.findByName("shadowJar")) {
project.configurations.api.dependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
dependencyNode.appendNode('scope', 'compile')
}
}
}
// Mostly self-explanatory metadata
pom {
name = "Resulter"
description = 'Tired of throwing exceptions or returning nonsense? Well, Resulter will save you!'
url = 'https://github.com/iamceph/resulter'
licenses {
license {
name = 'GPL-3.0 License'
url = 'https://www.gnu.org/licenses/gpl-3.0.html'
}
}
developers {
developer {
id = 'iamceph'
name = 'Frantisek Novosad'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:github.com/iamceph/resulter.git'
developerConnection = 'scm:git:ssh://github.com/iamceph/resulter.git'
url = 'https://github.com/iamceph/resulter/tree/main'
}
}
}
}
}