diff --git a/README.md b/README.md index 0aa63e4..368fdfc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/co.paystack.android/paystack-android/badge.svg)](https://maven-badges.herokuapp.com/maven-central/co.paystack.android/paystack-android) -[![API](https://img.shields.io/badge/API-16%2B-blue.svg?style=plastic)](https://android-arsenal.com/api?level=16) +[ ![Download](https://api.bintray.com/packages/paystack/maven/paystack-android/images/download.svg) ](https://bintray.com/paystack/maven/paystack-android/_latestVersion) +[![Min API](https://img.shields.io/badge/API-16%2B-blue.svg?style=plastic)](https://android-arsenal.com/api?level=16) @@ -37,10 +37,11 @@ You do not need to clone this repository or download the files. Just add the fol ```gradle dependencies { - implementation 'co.paystack.android.design.widget:pinpad:1.0.4' - implementation 'co.paystack.android:paystack:3.0.17' + implementation 'co.paystack.android:paystack:3.0.18' } ``` +From version `3.0.18`, the Pinpad library comes as part of this library and does not need to be explicitly included in your dependencies. + ### Eclipse To use this library with Eclipse, you need to: @@ -59,7 +60,7 @@ To prepare for use, you must ensure that your app has internet permissions by ma ``` -### 1. initializeSdk +### 1. Initialize SDK To use the Paystack Android SDK, you need to first initialize it using the `PaystackSdk` class. diff --git a/build.gradle b/build.gradle index e6d8ce9..34647bb 100644 --- a/build.gradle +++ b/build.gradle @@ -6,9 +6,9 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.1' + classpath 'com.android.tools.build:gradle:4.0.0' classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -26,9 +26,9 @@ ext { compileSdkVersion = 29 minSdkVersion = 16 targetSdkVersion = 29 - versionCode = 26 + versionCode = 27 buildToolsVersion = "29.0.2" supportLibraryVersion = "28.0.0" - versionName = "3.0.17" + versionName = "3.0.18" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6154423..fe708f7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Mar 25 12:49:33 WAT 2020 +#Wed Jun 03 13:36:41 WAT 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/paystack/bintray-config.gradle b/paystack/bintray-config.gradle new file mode 100644 index 0000000..7348268 --- /dev/null +++ b/paystack/bintray-config.gradle @@ -0,0 +1,50 @@ +apply plugin: 'com.jfrog.bintray' + +version = libraryVersion + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += configurations.compile + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} +artifacts { + // archives javadocJar + archives sourcesJar +} + +// Bintray +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) + +bintray { + user = properties.getProperty("bintray.user") + key = properties.getProperty("bintray.apikey") + publications = ['library'] + + configurations = ['archives'] + pkg { + repo = bintrayRepo + name = bintrayName + desc = libraryDescription + publish = true + publicDownloadNumbers = true + version { + desc = libraryDescription +// Optional. The passphrase for GPG signing' + gpg { + sign = true //Determines whether to GPG sign the files. The default is false + passphrase = properties.getProperty("bintray.gpg.password") + } + } + } +} \ No newline at end of file diff --git a/paystack/build.gradle b/paystack/build.gradle index db61c67..167a077 100644 --- a/paystack/build.gradle +++ b/paystack/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'com.android.library' apply plugin: "com.jfrog.bintray" apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'maven-publish' android { compileSdkVersion rootProject.ext.compileSdkVersion @@ -30,13 +31,38 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.google.code.gson:gson:2.8.5' - implementation 'com.squareup.retrofit2:retrofit:2.6.2' + implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.5.0' - implementation 'com.squareup.okhttp3:okhttp:3.14.6' + implementation 'com.squareup.okhttp3:okhttp:3.14.9' implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion" implementation 'co.paystack.android.design.widget:pinpad:1.0.4' } +project.afterEvaluate { + publishing { + publications { + library(MavenPublication) { + setGroupId 'co.paystack.android' + setArtifactId 'paystack' + version android.defaultConfig.versionName + artifact bundleReleaseAar + + pom.withXml { + def dependenciesNode = asNode().appendNode('dependencies') + configurations.implementation.allDependencies.each { + if (it.name != 'unspecified') { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', it.group) + dependencyNode.appendNode('artifactId', it.name) + dependencyNode.appendNode('version', it.version) + } + } + } + } + } + } +} + ext { // Where you will see your artifact in Bintray's web interface // The "bintrayName" should match the name of the Bintray repro. @@ -64,6 +90,5 @@ ext { licenseUrl = 'https://raw.githubusercontent.com/PaystackHQ/paystack-android/master/LICENSE.txt' allLicenses = ["Apache-2.0"] } - apply from: 'https://raw.githubusercontent.com/ibrahimlawal/JCenter/master/installv1.gradle' -apply from: 'https://raw.githubusercontent.com/ibrahimlawal/JCenter/master/bintrayv1.gradle' +apply from: "$rootProject.projectDir/paystack/bintray-config.gradle"