Skip to content

Commit 8f26088

Browse files
Add pom metadata for publishing
1 parent 7706a62 commit 8f26088

File tree

2 files changed

+45
-17
lines changed

2 files changed

+45
-17
lines changed

gradle/publish.gradle

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apply plugin: 'maven-publish'
2+
3+
publishing {
4+
publications.all { publication ->
5+
def publicationName = publication.name == 'kotlinMultiplatform' ? "common" : publication.name
6+
publication.artifactId = "mokttp-$publicationName"
7+
8+
pom {
9+
name = "mokttp"
10+
description = "Kotlin Multiplatform wrapper for HTTP server libraries - " +
11+
"GCDWebServers (iOS) and OkHttp's MockWebServer (Android)"
12+
url = "https://github.com/michallaskowski/mokttp"
13+
licenses {
14+
license {
15+
name = 'The Apache License, Version 2.0'
16+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
17+
}
18+
}
19+
scm {
20+
url = "https://github.com/michallaskowski/mokttp.git"
21+
}
22+
developers {
23+
developer {
24+
id = 'michallaskowski'
25+
name = 'Michal Laskowski'
26+
27+
}
28+
}
29+
}
30+
}
31+
32+
repositories {
33+
maven {
34+
name = "central"
35+
def snapshotRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
36+
def stagingRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
37+
url = version.endsWith('SNAPSHOT') ? snapshotRepoUrl : stagingRepoUrl
38+
credentials {
39+
username = System.getenv("MAVEN_USERNAME")
40+
password = System.getenv("MAVEN_PASSWORD")
41+
}
42+
}
43+
}
44+
}

library/build.gradle

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,7 @@ apply plugin: 'maven'
33
apply plugin: 'maven-publish'
44
apply plugin: 'com.android.library'
55

6-
publishing {
7-
publications {
8-
kotlinMultiplatform.artifactId = "mokttp-common"
9-
}
10-
repositories {
11-
maven {
12-
name = "central"
13-
def snapshotRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
14-
def stagingRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
15-
url = version.endsWith('SNAPSHOT') ? snapshotRepoUrl : stagingRepoUrl
16-
credentials {
17-
username = System.getenv("MAVEN_USERNAME")
18-
password = System.getenv("MAVEN_PASSWORD")
19-
}
20-
}
21-
}
22-
}
6+
apply from: rootProject.file("gradle/publish.gradle")
237

248
android {
259
compileSdkVersion 29

0 commit comments

Comments
 (0)