-
Notifications
You must be signed in to change notification settings - Fork 379
Expand file tree
/
Copy pathPublicationManager.kt
More file actions
74 lines (63 loc) · 2.22 KB
/
Copy pathPublicationManager.kt
File metadata and controls
74 lines (63 loc) · 2.22 KB
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
package release
import org.gradle.api.Project
import org.gradle.api.publish.maven.MavenPom
import org.gradle.api.publish.maven.MavenPublication
object PublicationManager {
@JvmStatic
fun configure(
project: Project,
publication: MavenPublication,
vararg artifacts: Any,
) {
val libraryInfo = ReleaseInfo.getLibraryInfo(project)
project.group = libraryInfo.groupId
project.version = libraryInfo.version.name
publication.apply {
groupId = libraryInfo.groupId
artifactId = libraryInfo.artifactId
version = libraryInfo.version.name
setArtifacts(artifacts.asIterable())
pom {
configure(
libraryInfo = libraryInfo,
project = project
)
}
}
}
private fun MavenPom.configure(
libraryInfo: LibraryInfo,
project: Project,
) {
description?.set("A media playback library that uses the ExoPlayer as a default backing")
name?.set(libraryInfo.groupId + ":" + libraryInfo.artifactId)
url?.set("https://github.com/brianwernick/ExoMedia")
developers {
developer {
name?.set("Brian Wernick")
email?.set("brian@devbrackets.com")
organization?.set("DevBrackets")
organizationUrl?.set("https://devbrackets.com")
}
}
licenses {
license {
name?.set("The Apache License, Version 2.0")
url?.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
connection?.set("scm:git:github.com/brianwernick/ExoMedia.git")
developerConnection?.set("scm:git:ssh://github.com/brianwernick/ExoMedia.git")
url?.set("https://github.com/brianwernick/ExoMedia/tree/main")
}
// The generated POM doesn't include dependencies for Android artifacts,
// so we manually add them here
withXml {
Dependencies.appendAll(
node = asNode().appendNode("dependencies"),
configurations = project.configurations
)
}
}
}