Skip to content

Commit 481a338

Browse files
committed
Prepare for MvnCentral publishing
1 parent f6ae7c1 commit 481a338

2 files changed

Lines changed: 37 additions & 27 deletions

File tree

README.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SearchPreference
22

33
[![](https://jitpack.io/v/ByteHamster/SearchPreference.svg)](https://jitpack.io/#ByteHamster/SearchPreference)
4+
[![Maven Central](https://img.shields.io/maven-central/v/com.bytehamster/lib.preferencesearch.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.bytehamster/lib.preferencesearch)
45

56
This is a library for Android apps that allows to search inside Preference xml files.
67
The library provides a subclass of `Preference` that can be integrated into existing apps easily.
@@ -12,16 +13,7 @@ The library provides a subclass of `Preference` that can be integrated into exis
1213
Add PreferenceSearch to your `app/build.gradle`:
1314

1415
dependencies {
15-
implementation 'com.github.ByteHamster:SearchPreference:2.7.0'
16-
}
17-
18-
Add PreferenceSearch to your `build.gradle`:
19-
20-
allprojects {
21-
repositories {
22-
// ...
23-
maven { url 'https://jitpack.io' }
24-
}
16+
implementation 'com.bytehamster:lib.preferencesearch:2.7.3'
2517
}
2618

2719
Add search bar to your `preferences.xml` file:
@@ -64,3 +56,4 @@ the texts shown by the library together with your app's other strings, you can o
6456
the strings in the preference xml file using attributes like `search:textNoResults`.
6557
Refer to [`attrs.xml`](lib/src/main/res/values/attrs.xml) for details.
6658
You can also overwrite the strings when constructing the SearchConfiguration object.
59+

lib/build.gradle

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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

48
android {
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

3230
dependencies {
@@ -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

Comments
 (0)