Skip to content

Commit

Permalink
Merge pull request #12 from nikartm/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
nikartx authored Jul 6, 2021
2 parents 0355fc5 + 529e8d3 commit 705231e
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 48 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
[![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)
[![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)



# ImageBadgeView
Library to add ImageView (ImageBadgeView) with a badge like notification count.
## Download
Add to gradle root:
```
buildscript {
repositories {
jcenter()
}
allprojects {
repositories {
mavenCentral()
}
}
```
Download via Gradle:

#### After migrating to MavenCentral, use Groove:
```
implementation 'io.github.nikartm:image-support:2.0.0'
```
Or Kotlin DSL:
```
implementation("io.github.nikartm:image-support:2.0.0")
```
Or take a different [approach](https://search.maven.org/artifact/io.github.nikartm/image-support/2.0.0/aar)

Old way (deprecated):
```
implementation 'com.github.nikartm:image-support:$LAST_VERSION'
```
Expand Down
10 changes: 4 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation 'androidx.appcompat:appcompat:1.2.0'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation project(':support')
}
12 changes: 8 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@
buildscript {

repositories {
maven { url "https://plugins.gradle.org/m2/" }
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.github.panpf.bintray-publish:bintray-publish:1.0.0'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'

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

apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply from: "${rootDir}/scripts/publish-root.gradle"

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jan 06 08:13:35 WITA 2021
#Tue Jul 06 00:34:08 MSK 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
74 changes: 74 additions & 0 deletions scripts/publish-module.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
from android.sourceSets.main.java.srcDirs
} else {
from sourceSets.main.java.srcDirs
}
}

artifacts {
archives androidSourcesJar
}

group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION

afterEvaluate {
publishing {
publications {
release(MavenPublication) {

groupId PUBLISH_GROUP_ID
artifactId PUBLISH_ARTIFACT_ID
version PUBLISH_VERSION

if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
artifact("$buildDir/libs/${project.getName()}-${version}.jar")
}

artifact androidSourcesJar

pom {
name = PUBLISH_ARTIFACT_ID
description = PUBLISH_DESCRIPTION
url = PUBLISH_URL

licenses {
license {
name = PUBLISH_LICENSE_NAME
url = PUBLISH_LICENSE_URL
}
}

developers {
developer {
id = PUBLISH_DEVELOPER_ID
name = PUBLISH_DEVELOPER_NAME
email = PUBLISH_DEVELOPER_EMAIL
}
}

scm {
connection = PUBLISH_SCM_CONNECTION
developerConnection = PUBLISH_SCM_DEVELOPER_CONNECTION
url = PUBLISH_SCM_URL
}
}
}
}
}
}

ext["signing.keyId"] = rootProject.ext["signing.keyId"]
ext["signing.password"] = rootProject.ext["signing.password"]
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]

signing {
sign publishing.publications
}
32 changes: 32 additions & 0 deletions scripts/publish-root.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.secretKeyRingFile"] = ''
ext["ossrhUsername"] = ''
ext["ossrhPassword"] = ''
ext["sonatypeStagingProfileId"] = ''

File secretPropsFile = project.rootProject.file('local.properties')
if (secretPropsFile.exists()) {
Properties p = new Properties()
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
p.each { name, value -> ext[name] = value }
} else {
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
}

nexusPublishing {
repositories {
sonatype {
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
51 changes: 22 additions & 29 deletions support/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.panpf.bintray-publish'

ext {
PUBLISH_GROUP_ID = 'io.github.nikartm'
PUBLISH_VERSION = '2.0.0'
PUBLISH_ARTIFACT_ID = 'image-support'
PUBLISH_DESCRIPTION = 'Library to add ImageView (ImageBadgeView) with a badge like notification count'
PUBLISH_URL = 'https://github.com/nikartm/Image-Support'
PUBLISH_LICENSE_NAME = 'The Apache Software License, Version 2.0'
PUBLISH_LICENSE_URL = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
PUBLISH_DEVELOPER_ID = 'ivanv'
PUBLISH_DEVELOPER_NAME = 'Ivan Vodyasov'
PUBLISH_DEVELOPER_EMAIL = '[email protected]'
PUBLISH_SCM_CONNECTION = 'scm:git:github.com/nikartm/Image-Support.git'
PUBLISH_SCM_DEVELOPER_CONNECTION = 'scm:git:ssh://github.com/nikartm/Image-Support.git'
PUBLISH_SCM_URL = 'https://github.com/nikartm/Image-Support/tree/master'
}

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
compileSdkVersion 30
Expand All @@ -25,35 +42,11 @@ android {
}
}

allprojects {
tasks.withType(Javadoc).all { enabled = false }
}

if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}

publish {
userOrg = 'nikart'
groupId = 'com.github.nikartm'
artifactId = 'image-support'
publishVersion = '1.1.0'
desc = 'Library to add ImageView (ImageBadgeView) with a badge like notification count'
licences = ['Apache-2.0']
uploadName='ImageBadgeView'
website = 'https://github.com/nikartm/Image-Support'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
}

0 comments on commit 705231e

Please sign in to comment.