1
1
import groovy.json.JsonBuilder
2
+ import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
2
3
3
- buildscript {
4
- extra[" awsAccessKeyId" ] = System .getenv(" AWS_ACCESS_KEY_ID" ) ? : findProperty(" aws_access_key_id" )
5
- extra[" awsSecretAccessKey" ] = System .getenv(" AWS_SECRET_ACCESS_KEY" ) ? : findProperty(" aws_secret_access_key" )
6
- extra[" sonatypeUsername" ] = System .getenv(" SONATYPE_USERNAME" ) ? : findProperty(" sonatype_username" )
7
- extra[" sonatypePassword" ] = System .getenv(" SONATYPE_PASSWORD" ) ? : findProperty(" sonatype_password" )
8
- }
9
4
10
5
plugins {
11
6
alias(libs.plugins.android.application)
12
7
alias(libs.plugins.jetbrains.kotlin.android)
13
- id(" maven-publish" )
14
- id(" signing" )
8
+ alias(libs.plugins.vanniktech.maven.publish)
15
9
}
16
10
17
11
version = " 1.0.0"
@@ -20,7 +14,7 @@ android {
20
14
compileSdk = 34
21
15
22
16
defaultConfig {
23
- minSdk = 22
17
+ minSdk = 21
24
18
25
19
testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
26
20
@@ -48,80 +42,48 @@ android {
48
42
jvmTarget = " 1.8"
49
43
}
50
44
51
- publishing {
52
- singleVariant(" release" ) {
53
- withSourcesJar()
54
- }
55
- }
56
45
}
57
46
58
47
dependencies {
59
48
implementation(" net.java.dev.jna:jna:5.17.0@aar" )
60
49
implementation(libs.coroutines)
61
50
}
62
51
63
- afterEvaluate {
64
- publishing {
65
- publications {
66
- create<MavenPublication >(" release" ) {
67
- from(components[" release" ])
68
- groupId = " com.superwall.supercel"
69
- artifactId = " supercel"
70
- version = project.version.toString() // Set your library version
71
-
72
- pom {
73
- name.set(" SuperCEL" )
74
- description.set(" Superwall CEL Evaluator" )
75
- url.set(" https://superwall.com" )
76
-
77
- licenses {
78
- license {
79
- name.set(" MIT License" )
80
- url.set(" https://github.com/superwall/Superwall-Android?tab=MIT-1-ov-file#" )
81
- }
82
- }
83
- developers {
84
- developer {
85
- id.set(" ianrumac" )
86
- name.set(" Ian Rumac" )
87
- email.set(" ian@superwall.com" )
88
- }
89
- }
90
- scm {
91
- connection.set(" scm:git:git@github.com:superwall/SuperCEL-Android.git" )
92
- developerConnection.set(" scm:git:ssh://github.com:superwall/SuperCEL-Android.git" )
93
- url.set(" scm:git:https://github.com/superwall/SuperCEL-Android.git" )
94
- }
95
- }
52
+ mavenPublishing {
53
+ coordinates(" com.superwall.supercel" , " supercel" , project.version.toString())
54
+
55
+ pom {
56
+ name.set(" SuperCEL" )
57
+ description.set(" Superwall CEL Evaluator" )
58
+ inceptionYear.set(" 2024" )
59
+ url.set(" https://superwall.com" )
60
+ licenses {
61
+ license {
62
+ name.set(" MIT License" )
63
+ url.set(" https://github.com/superwall/Superwall-Android?tab=MIT-1-ov-file#" )
64
+ distribution.set(" https://github.com/superwall/Superwall-Android?tab=MIT-1-ov-file#" )
96
65
}
97
66
}
98
-
99
- repositories {
100
- mavenLocal()
101
-
102
- val sonatypeUsername: String? by extra
103
- val sonatypePassword: String? by extra
104
-
105
- if (sonatypeUsername != null && sonatypePassword != null ) {
106
- maven {
107
- url = uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
108
- credentials(PasswordCredentials ::class .java) {
109
- username = sonatypeUsername
110
- password = sonatypePassword
111
- }
112
- }
67
+ developers {
68
+ developer {
69
+ id.set(" ianrumac" )
70
+ name.set(" Ian Rumac" )
71
+ email.set(" ian@superwall.com" )
72
+ url.set(" https://superwall.com" )
113
73
}
114
74
}
75
+ scm {
76
+ url.set(" https://github.com/superwall/SuperCEL-Android" )
77
+ connection.set(" scm:git:git://github.com/superwall/SuperCEL-Android.git" )
78
+ developerConnection.set(" scm:git:ssh://git@github.com/superwall/SuperCEL-Android.git" )
79
+ }
115
80
}
116
81
117
-
118
- signing {
119
- val signingKeyId: String? = System .getenv(" SIGNING_KEY_ID" )
120
- val signingPassword: String? = System .getenv(" SIGNING_PASSWORD" )
121
- val signingSecretKeyRingFile: String? = System .getenv(" SIGNING_SECRET_KEY_RING_FILE" )
122
- useInMemoryPgpKeys(signingKeyId, signingSecretKeyRingFile, signingPassword )
123
- sign(publishing.publications[" release" ])
124
- }
82
+ configure(AndroidSingleVariantLibrary ())
83
+
84
+ publishToMavenCentral()
85
+
86
+ signAllPublications()
125
87
}
126
88
127
89
tasks.register(" generateBuildInfo" ) {
0 commit comments