Skip to content

Commit 705231e

Browse files
authored
Merge pull request #12 from nikartm/dev
Dev
2 parents 0355fc5 + 529e8d3 commit 705231e

7 files changed

Lines changed: 162 additions & 48 deletions

File tree

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
1-
[![Download](https://api.bintray.com/packages/nikart/maven/ImageBadgeView/images/download.svg)](https://bintray.com/nikart/maven/ImageBadgeView/_latestVersion) [![Release](https://jitpack.io/v/nikartm/image-support.svg)](https://jitpack.io/#nikartm/image-support) [![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-ImageBadgeView-green.svg?style=flat )]( https://android-arsenal.com/details/1/7619) [![Donate using PayPal](https://img.shields.io/badge/paypal-donate-blue.svg)](https://www.paypal.me/ivodyasov)
1+
[![Maven Central](https://img.shields.io/maven-central/v/io.github.nikartm/image-support.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.nikartm%22%20AND%20a:%22image-support%22) [![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-ImageBadgeView-green.svg?style=flat )]( https://android-arsenal.com/details/1/7619)
2+
3+
24

35
# ImageBadgeView
46
Library to add ImageView (ImageBadgeView) with a badge like notification count.
57
## Download
68
Add to gradle root:
79
```
8-
buildscript {
9-
repositories {
10-
jcenter()
11-
}
10+
allprojects {
11+
repositories {
12+
mavenCentral()
13+
}
1214
}
1315
```
14-
Download via Gradle:
16+
17+
#### After migrating to MavenCentral, use Groove:
18+
```
19+
implementation 'io.github.nikartm:image-support:2.0.0'
20+
```
21+
Or Kotlin DSL:
22+
```
23+
implementation("io.github.nikartm:image-support:2.0.0")
24+
```
25+
Or take a different [approach](https://search.maven.org/artifact/io.github.nikartm/image-support/2.0.0/aar)
26+
27+
Old way (deprecated):
1528
```
1629
implementation 'com.github.nikartm:image-support:$LAST_VERSION'
1730
```

app/build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ android {
2525
dependencies {
2626
implementation fileTree(include: ['*.jar'], dir: 'libs')
2727

28-
testImplementation 'junit:junit:4.13.1'
29-
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
30-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
31-
32-
implementation 'androidx.appcompat:appcompat:1.2.0'
33-
28+
testImplementation 'junit:junit:4.13.2'
29+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
30+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
31+
implementation 'androidx.appcompat:appcompat:1.3.0'
3432
implementation project(':support')
3533
}

build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@
33
buildscript {
44

55
repositories {
6+
maven { url "https://plugins.gradle.org/m2/" }
67
google()
7-
jcenter()
8+
mavenCentral()
89
}
910
dependencies {
10-
classpath 'com.android.tools.build:gradle:4.1.1'
11-
classpath 'com.github.panpf.bintray-publish:bintray-publish:1.0.0'
11+
classpath 'com.android.tools.build:gradle:4.2.2'
12+
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
1213

1314
// NOTE: Do not place your application dependencies here; they belong
1415
// in the individual module build.gradle files
1516
}
1617
}
1718

19+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
20+
apply from: "${rootDir}/scripts/publish-root.gradle"
21+
1822
allprojects {
1923
repositories {
2024
google()
21-
jcenter()
25+
mavenCentral()
2226
}
2327
}
2428

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Jan 06 08:13:35 WITA 2021
1+
#Tue Jul 06 00:34:08 MSK 2021
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
6+
zipStoreBase=GRADLE_USER_HOME

scripts/publish-module.gradle

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
4+
task androidSourcesJar(type: Jar) {
5+
archiveClassifier.set('sources')
6+
if (project.plugins.findPlugin("com.android.library")) {
7+
from android.sourceSets.main.java.srcDirs
8+
} else {
9+
from sourceSets.main.java.srcDirs
10+
}
11+
}
12+
13+
artifacts {
14+
archives androidSourcesJar
15+
}
16+
17+
group = PUBLISH_GROUP_ID
18+
version = PUBLISH_VERSION
19+
20+
afterEvaluate {
21+
publishing {
22+
publications {
23+
release(MavenPublication) {
24+
25+
groupId PUBLISH_GROUP_ID
26+
artifactId PUBLISH_ARTIFACT_ID
27+
version PUBLISH_VERSION
28+
29+
if (project.plugins.findPlugin("com.android.library")) {
30+
from components.release
31+
} else {
32+
artifact("$buildDir/libs/${project.getName()}-${version}.jar")
33+
}
34+
35+
artifact androidSourcesJar
36+
37+
pom {
38+
name = PUBLISH_ARTIFACT_ID
39+
description = PUBLISH_DESCRIPTION
40+
url = PUBLISH_URL
41+
42+
licenses {
43+
license {
44+
name = PUBLISH_LICENSE_NAME
45+
url = PUBLISH_LICENSE_URL
46+
}
47+
}
48+
49+
developers {
50+
developer {
51+
id = PUBLISH_DEVELOPER_ID
52+
name = PUBLISH_DEVELOPER_NAME
53+
email = PUBLISH_DEVELOPER_EMAIL
54+
}
55+
}
56+
57+
scm {
58+
connection = PUBLISH_SCM_CONNECTION
59+
developerConnection = PUBLISH_SCM_DEVELOPER_CONNECTION
60+
url = PUBLISH_SCM_URL
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}
67+
68+
ext["signing.keyId"] = rootProject.ext["signing.keyId"]
69+
ext["signing.password"] = rootProject.ext["signing.password"]
70+
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]
71+
72+
signing {
73+
sign publishing.publications
74+
}

scripts/publish-root.gradle

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
ext["signing.keyId"] = ''
2+
ext["signing.password"] = ''
3+
ext["signing.secretKeyRingFile"] = ''
4+
ext["ossrhUsername"] = ''
5+
ext["ossrhPassword"] = ''
6+
ext["sonatypeStagingProfileId"] = ''
7+
8+
File secretPropsFile = project.rootProject.file('local.properties')
9+
if (secretPropsFile.exists()) {
10+
Properties p = new Properties()
11+
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
12+
p.each { name, value -> ext[name] = value }
13+
} else {
14+
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
15+
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
16+
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
17+
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
18+
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
19+
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
20+
}
21+
22+
nexusPublishing {
23+
repositories {
24+
sonatype {
25+
stagingProfileId = sonatypeStagingProfileId
26+
username = ossrhUsername
27+
password = ossrhPassword
28+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
29+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
30+
}
31+
}
32+
}

support/build.gradle

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.github.panpf.bintray-publish'
2+
3+
ext {
4+
PUBLISH_GROUP_ID = 'io.github.nikartm'
5+
PUBLISH_VERSION = '2.0.0'
6+
PUBLISH_ARTIFACT_ID = 'image-support'
7+
PUBLISH_DESCRIPTION = 'Library to add ImageView (ImageBadgeView) with a badge like notification count'
8+
PUBLISH_URL = 'https://github.com/nikartm/Image-Support'
9+
PUBLISH_LICENSE_NAME = 'The Apache Software License, Version 2.0'
10+
PUBLISH_LICENSE_URL = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
11+
PUBLISH_DEVELOPER_ID = 'ivanv'
12+
PUBLISH_DEVELOPER_NAME = 'Ivan Vodyasov'
13+
PUBLISH_DEVELOPER_EMAIL = 'jvissun@gmail.com'
14+
PUBLISH_SCM_CONNECTION = 'scm:git:github.com/nikartm/Image-Support.git'
15+
PUBLISH_SCM_DEVELOPER_CONNECTION = 'scm:git:ssh://github.com/nikartm/Image-Support.git'
16+
PUBLISH_SCM_URL = 'https://github.com/nikartm/Image-Support/tree/master'
17+
}
18+
19+
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
320

421
android {
522
compileSdkVersion 30
@@ -25,35 +42,11 @@ android {
2542
}
2643
}
2744

28-
allprojects {
29-
tasks.withType(Javadoc).all { enabled = false }
30-
}
31-
32-
if (JavaVersion.current().isJava8Compatible()) {
33-
allprojects {
34-
tasks.withType(Javadoc) {
35-
options.addStringOption('Xdoclint:none', '-quiet')
36-
}
37-
}
38-
}
39-
40-
publish {
41-
userOrg = 'nikart'
42-
groupId = 'com.github.nikartm'
43-
artifactId = 'image-support'
44-
publishVersion = '1.1.0'
45-
desc = 'Library to add ImageView (ImageBadgeView) with a badge like notification count'
46-
licences = ['Apache-2.0']
47-
uploadName='ImageBadgeView'
48-
website = 'https://github.com/nikartm/Image-Support'
49-
}
50-
5145
dependencies {
5246
implementation fileTree(dir: 'libs', include: ['*.jar'])
5347

54-
testImplementation 'junit:junit:4.13.1'
55-
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
56-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
57-
58-
implementation 'androidx.appcompat:appcompat:1.2.0'
48+
testImplementation 'junit:junit:4.13.2'
49+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
50+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
51+
implementation 'androidx.appcompat:appcompat:1.3.0'
5952
}

0 commit comments

Comments
 (0)