@@ -6,15 +6,15 @@ plugins {
6
6
alias(libs.plugins.cocoapods)
7
7
alias(libs.plugins.android.library)
8
8
alias(libs.plugins.kotlin.parcelize)
9
- alias(libs.plugins.maven.publish)
10
- signing
9
+ alias(libs.plugins.vanniktech.maven.publish)
11
10
}
12
11
13
12
version = " 1.2.18"
14
13
group = " com.ctrip.flight.mmkv"
15
14
16
15
@OptIn(ExperimentalKotlinGradlePluginApi ::class )
17
16
kotlin {
17
+ jvmToolchain(21 )
18
18
androidTarget {
19
19
publishLibraryVariants(" release" )
20
20
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree .test)
@@ -72,63 +72,45 @@ android {
72
72
testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
73
73
}
74
74
compileOptions {
75
- sourceCompatibility = JavaVersion .VERSION_11
76
- targetCompatibility = JavaVersion .VERSION_21
75
+ isCoreLibraryDesugaringEnabled = true
77
76
}
78
77
}
79
78
80
- val javadocJar : TaskProvider < Jar > by tasks.registering( Jar :: class ) {
81
- archiveClassifier.set( " javadoc " )
79
+ dependencies {
80
+ coreLibraryDesugaring(libs.desugar.jdk.libs )
82
81
}
83
82
84
- publishing {
85
- publications.withType<MavenPublication > {
86
- artifact(javadocJar)
87
- with (pom) {
88
- name.set(" MMKV-Kotlin" )
89
- description.set(" MMKV for Kotlin Multiplatform" )
90
- url.set(" https://github.com/ctripcorp/mmkv-kotlin" )
91
- licenses {
92
- license {
93
- name.set(" The Apache License, Version 2.0" )
94
- url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
95
- }
96
- }
97
- developers {
98
- developer {
99
- id.set(" qiaoyuang" )
100
- name.set(" Yuang Qiao" )
101
-
102
- }
103
- }
104
- scm {
105
- url.set(" https://github.com/ctripcorp/mmkv-kotlin" )
106
- connection.set(" scm:git:https://github.com/ctripcorp/mmkv-kotlin.git" )
107
- developerConnection.set(" scm:git:https://github.com/ctripcorp/mmkv-kotlin.git" )
83
+ mavenPublishing {
84
+ publishToMavenCentral()
85
+ signAllPublications()
86
+
87
+ coordinates(
88
+ groupId = group.toString(),
89
+ artifactId = " mmkv-kotlin" ,
90
+ version = version.toString(),
91
+ )
92
+
93
+ pom {
94
+ name.set(" MMKV-Kotlin" )
95
+ description.set(" MMKV for Kotlin Multiplatform" )
96
+ url.set(" https://github.com/ctripcorp/mmkv-kotlin" )
97
+ licenses {
98
+ license {
99
+ name.set(" The Apache License, Version 2.0" )
100
+ url.set(" https://www.apache.org/licenses/LICENSE-2.0.txt" )
108
101
}
109
102
}
110
- }
111
- repositories {
112
- maven {
113
- credentials {
114
- val NEXUS_USERNAME : String by project
115
- val NEXUS_PASSWORD : String by project
116
- username = NEXUS_USERNAME
117
- password = NEXUS_PASSWORD
103
+ developers {
104
+ developer {
105
+ id.set(" qiaoyuang" )
106
+ name.set(" Yuang Qiao" )
107
+
118
108
}
119
- url = uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2" )
109
+ }
110
+ scm {
111
+ url.set(" https://github.com/ctripcorp/mmkv-kotlin" )
112
+ connection.set(" scm:git:https://github.com/ctripcorp/mmkv-kotlin.git" )
113
+ developerConnection.set(" scm:git:https://github.com/ctripcorp/mmkv-kotlin.git" )
120
114
}
121
115
}
122
- signing {
123
- val SIGNING_KEY_ID : String by project
124
- val SIGNING_KEY : String by project
125
- val SIGNING_PASSWORD : String by project
126
- useInMemoryPgpKeys(SIGNING_KEY_ID , SIGNING_KEY , SIGNING_PASSWORD )
127
- sign(publishing.publications)
128
- }
129
- }
130
-
131
- // TODO: remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed
132
- project.tasks.withType(AbstractPublishToMaven ::class .java).configureEach {
133
- dependsOn(project.tasks.withType(Sign ::class .java))
134
116
}
0 commit comments