Skip to content

Commit

Permalink
Merge pull request #257 from Tapadoo/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kpmmmurphy authored Apr 2, 2021
2 parents cdeee38 + 86e84e2 commit 17f9f77
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 106 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This library aims to overcome the limitations of Toasts and Snackbars, while reducing the
complexity of your layouts.

[![Download](https://api.bintray.com/packages/tapadoo/maven/alerter/images/download.svg)](https://bintray.com/tapadoo/maven/alerter/_latestVersion) [![API](https://img.shields.io/badge/API-14%2B-orange.svg?style=flat)](https://android-arsenal.com/api?level=14) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Alerter-blue.svg?style=flat)](https://android-arsenal.com/details/1/5302) [![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23245-blue.svg)](http://androidweekly.net/issues/issue-245)
[![API](https://img.shields.io/badge/API-14%2B-orange.svg?style=flat)](https://android-arsenal.com/api?level=14) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Alerter-blue.svg?style=flat)](https://android-arsenal.com/details/1/5302) [![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23245-blue.svg)](http://androidweekly.net/issues/issue-245)

![Header](./documentation/header.png)

Expand All @@ -12,26 +12,25 @@ complexity of your layouts.
With simplicity in mind, the Alerter employs the builder pattern to facilitate easy integration into any app.
A customisable Alert View is dynamically added to the Decor View of the Window, overlaying all content.

## Gradle
## Install

Include the JitPack.io Maven repo in your project's build.gradle file

```groovy
dependencies {
implementation 'com.tapadoo.android:alerter:$current-version'
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
```

## Kotlin

Version 3.0.0 and above requires Kotlin

## AndroidX
Then add this dependency to your app's build.gradle file

Version 4.0.0 includes support for AndroidX dependencies. If you experience issues with this update,
please ensure you have enabled AndroidX & Jetifier in your `gradle.properties` file:

```properties
android.useAndroidX=true
android.enableJetifier=true
```groovy
dependencies {
implementation 'com.github.tapadoo:alerter:$current-version'
}
```

# Usage
Expand Down
107 changes: 28 additions & 79 deletions alerter/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
//Plugins
plugins {
id "com.jfrog.bintray" version "1.8.4"
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: "maven-publish"
Expand All @@ -14,7 +9,7 @@ apply from: rootProject.file('quality.gradle')

final String GROUP_ID = "com.tapadoo.android"

final String VERSION = "7.0.1"
final String VERSION = "7.1.0"

final String DESCRIPTION = "An Android Alerting Library"
final String GITHUB_URL = "https://github.com/Tapadoo/Alerter"
Expand Down Expand Up @@ -43,33 +38,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

}

//BinTray configuration - credentials stored in user's gradle.properties
bintray {
user = getBinTrayUser()
key = getBinTrayKey()

publications = ['Alerter']

pkg {
repo = 'maven'
name = project.getName()
desc = DESCRIPTION
vcsUrl = GITHUB_URL + '.git'
websiteUrl = GITHUB_URL
issueTrackerUrl = GITHUB_URL + '/issues'
licenses = ['MIT']
publish = true

version {
name = VERSION // Version name i.e. "1.0"
desc = DESCRIPTION
vcsTag = VERSION
released = new Date()
}
}
}

// Create the POM configuration - required for jCenter uploading
Expand All @@ -94,26 +62,28 @@ task javadocJar(type: Jar) {
}

// Create the publication with the pom configuration:
publishing {
publications {
Alerter(MavenPublication) {
groupId GROUP_ID
version VERSION
artifactId project.getName()

//from components.android
artifact sourcesJar
artifact javadocJar

// Tell maven to prepare the generated "*.aar" file for publishing
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")

pom.withXml {
def root = asNode()
root.appendNode('description', DESCRIPTION)
root.appendNode('name', project.getName())
root.appendNode('url', GITHUB_URL)
root.children().last() + pomConfig
afterEvaluate {
publishing {
publications {
Alerter(MavenPublication) {
groupId GROUP_ID
version VERSION
artifactId project.getName()

//from components.android
artifact sourcesJar
artifact javadocJar

// Tell maven to prepare the generated "*.aar" file for publishing
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")

pom.withXml {
def root = asNode()
root.appendNode('description', DESCRIPTION)
root.appendNode('name', project.getName())
root.appendNode('url', GITHUB_URL)
root.children().last() + pomConfig
}
}
}
}
Expand All @@ -124,43 +94,22 @@ configurations {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.annotation:annotation:1.1.0"
implementation "androidx.annotation:annotation:1.2.0"
implementation "androidx.appcompat:appcompat:1.2.0"

// Local Unit Tests - in src/test
testImplementation 'junit:junit:4.12'

// Instrumentation Tests - in src/androidTest
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}

task showBintrayProps {
doLast {
println "Bintray user/password: ${getBinTrayUser()}/${getBinTrayKey()}"
}
}

dokka {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"
}

bintrayUpload.dependsOn 'generatePomFileForAlerterPublication'
bintrayUpload.dependsOn 'dokka'

def final getBinTrayUser() {
final String BINTRAY_USER = "BINTRAY_USER"
return project.hasProperty(BINTRAY_USER) ? project.getProperty(BINTRAY_USER) : null
}

def final getBinTrayKey() {
final String BINTRAY_KEY = "BINTRAY_KEY"
return project.hasProperty(BINTRAY_KEY) ? project.getProperty(BINTRAY_KEY) : null
}

}
1 change: 0 additions & 1 deletion alerter/src/main/java/com/tapadoo/alerter/Alerter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import android.view.View
import android.view.ViewGroup
import android.view.animation.AnimationUtils
import androidx.annotation.*
import androidx.appcompat.app.AppCompatDialog
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import java.lang.ref.WeakReference
Expand Down
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ android {

dependencies {
implementation project(':alerter')
implementation 'com.google.android.material:material:1.2.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.google.android.material:material:1.3.0'
}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
minSdkVersion = 14
targetSdkVersion = 30

kotlin_version = '1.4.21'
kotlinVersion = '1.4.21'

buildToolsVersion = '30.0.3'

Expand All @@ -23,8 +23,8 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
}
}
Expand Down
5 changes: 1 addition & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true

android.useAndroidX=true
android.enableJetifier=true

android.enableR8=true
android.useAndroidX=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jan 28 11:18:06 GMT 2021
#Fri Apr 02 10:19:30 IST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip

0 comments on commit 17f9f77

Please sign in to comment.