1- apply plugin : ' com.android.library'
2- apply plugin : ' maven-publish'
1+ import com.vanniktech.maven.publish.SonatypeHost
2+
3+ plugins {
4+ id ' com.android.library'
5+ id ' com.vanniktech.maven.publish' version ' 0.30.0'
6+ }
37
48android {
59 namespace " com.bytehamster.lib.preferencesearch"
@@ -21,12 +25,6 @@ android {
2125 sourceCompatibility JavaVersion . VERSION_1_8
2226 targetCompatibility JavaVersion . VERSION_1_8
2327 }
24-
25- publishing {
26- singleVariant(" release" ) {
27- withSourcesJar()
28- }
29- }
3028}
3129
3230dependencies {
@@ -37,16 +35,35 @@ dependencies {
3735 implementation ' org.apache.commons:commons-text:1.3'
3836}
3937
40- afterEvaluate {
41- publishing {
42- publications {
43- // Creates a Maven publication called "release".
44- release(MavenPublication ) {
45- from components. findByName(' release' )
46- groupId = ' com.github.ByteHamster'
47- artifactId = ' SearchPreference'
48- version = ' 2.7.3'
38+ // ./gradlew publishToMavenCentral
39+ mavenPublishing {
40+ coordinates(" com.bytehamster" , " lib.preferencesearch" , " 2.7.3" )
41+
42+ pom {
43+ name = " SearchPreference"
44+ description = " Search UI for Android Preference screens"
45+ inceptionYear = " 2018"
46+ url = " https://github.com/ByteHamster/SearchPreference"
47+ licenses {
48+ license {
49+ name = " The MIT License"
50+ url = " https://opensource.org/licenses/MIT"
51+ }
52+ }
53+ developers {
54+ developer {
55+ id = " ByteHamster"
56+ name = " ByteHamster"
57+ url = " https://github.com/ByteHamster"
4958 }
5059 }
60+ scm {
61+ url = " https://github.com/ByteHamster/SearchPreference"
62+ connection = " scm:git:git://github.com/ByteHamster/SearchPreference.git"
63+ developerConnection = " scm:git:ssh://github.com:ByteHamster/SearchPreference.git"
64+ }
5165 }
66+
67+ publishToMavenCentral(SonatypeHost . CENTRAL_PORTAL )
68+ signAllPublications()
5269}
0 commit comments