Skip to content

Commit

Permalink
Merge pull request #104 from PaystackHQ/fix/transitive-dependencies
Browse files Browse the repository at this point in the history
Fix issue where transitive dependencies weren't bundled with library
  • Loading branch information
michael-paystack authored Jun 8, 2020
2 parents 689c4c8 + 2ef8264 commit 03ab6f9
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 15 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)



Expand Down Expand Up @@ -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:
Expand All @@ -59,7 +60,7 @@ To prepare for use, you must ensure that your app has internet permissions by ma
<uses-permission android:name="android.permission.INTERNET" />
```

### 1. initializeSdk
### 1. Initialize SDK

To use the Paystack Android SDK, you need to first initialize it using the `PaystackSdk` class.

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}
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 @@
#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
50 changes: 50 additions & 0 deletions paystack/bintray-config.gradle
Original file line number Diff line number Diff line change
@@ -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")
}
}
}
}
33 changes: 29 additions & 4 deletions paystack/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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"

0 comments on commit 03ab6f9

Please sign in to comment.