File tree Expand file tree Collapse file tree 2 files changed +58
-17
lines changed Expand file tree Collapse file tree 2 files changed +58
-17
lines changed Original file line number Diff line number Diff line change
1
+ apply plugin : ' maven-publish'
2
+ apply plugin : ' signing'
3
+
4
+ publishing {
5
+ publications. all { publication ->
6
+ def publicationName = publication. name == ' kotlinMultiplatform' ? " common" : publication. name
7
+ publication. artifactId = " mokttp-$publicationName "
8
+
9
+ pom {
10
+ name = " mokttp"
11
+ description = " Kotlin Multiplatform wrapper for HTTP server libraries - " +
12
+ " GCDWebServers (iOS) and OkHttp's MockWebServer (Android)"
13
+ url = " https://github.com/michallaskowski/mokttp"
14
+ licenses {
15
+ license {
16
+ name = ' The Apache License, Version 2.0'
17
+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
18
+ }
19
+ }
20
+ scm {
21
+ url = " https://github.com/michallaskowski/mokttp.git"
22
+ }
23
+ developers {
24
+ developer {
25
+ id = ' michallaskowski'
26
+ name = ' Michal Laskowski'
27
+
28
+ }
29
+ }
30
+ }
31
+ }
32
+
33
+ repositories {
34
+ maven {
35
+ name = " central"
36
+ def snapshotRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots"
37
+ def stagingRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2"
38
+ url = version. endsWith(' SNAPSHOT' ) ? snapshotRepoUrl : stagingRepoUrl
39
+ credentials {
40
+ username = System . getenv(" MAVEN_USERNAME" )
41
+ password = System . getenv(" MAVEN_PASSWORD" )
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ signing {
48
+ required { isReleaseBuild() }
49
+ if (isReleaseBuild()) {
50
+ useInMemoryPgpKeys(System . getenv(" PGP_SIGNING_KEY" ), System . getenv(" PGP_SIGNING_PASSWORD" ))
51
+ sign publishing. publications
52
+ }
53
+ }
54
+
55
+ def isReleaseBuild () {
56
+ return ! scmVersion. version. contains(" SNAPSHOT" )
57
+ }
Original file line number Diff line number Diff line change @@ -3,23 +3,7 @@ apply plugin: 'maven'
3
3
apply plugin : ' maven-publish'
4
4
apply plugin : ' com.android.library'
5
5
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" )
23
7
24
8
android {
25
9
compileSdkVersion 29
You can’t perform that action at this time.
0 commit comments