Skip to content
This repository was archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #101 from PatilShreyas/v3.0.2-dev
Browse files Browse the repository at this point in the history
[v3.0.2] Provide <query>, Publish in mavenCentral() and Package refactor
  • Loading branch information
PatilShreyas authored Mar 18, 2021
2 parents c9252f2 + 6c44e9c commit 9558a6f
Show file tree
Hide file tree
Showing 214 changed files with 15,645 additions and 4,141 deletions.
141 changes: 11 additions & 130 deletions EasyUpiPayment/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.jetbrains.dokka'

version = "3.0.1"

android {
compileSdkVersion 30
buildToolsVersion '30.0.2'
buildToolsVersion '30.0.3'
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
versionCode 4
versionName version
versionCode 5
versionName VERSION_NAME
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
Expand Down Expand Up @@ -60,6 +56,9 @@ dependencies {
testImplementation 'androidx.test:core:1.3.0'
testImplementation 'org.mockito:mockito-core:3.5.0'

// Dokka
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.4.30")

// Android Testing
androidTestImplementation 'androidx.test:core:1.3.0'
androidTestImplementation 'androidx.test:core-ktx:1.3.0'
Expand All @@ -70,132 +69,14 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'org.mockito:mockito-core:3.5.0'
androidTestImplementation 'com.linkedin.dexmaker:dexmaker-mockito-inline-extended:2.28.0'

}

dokka {
outputFormat = 'html'
outputDirectory = "ktdocs/"

configuration {
includeNonPublic = false
}
}

ext {
bintrayRepo = 'maven'
bintrayName = 'EasyUpiPayment-Android'

publishedGroupId = 'com.shreyaspatil'
libraryName = 'EasyUpiPayment'
artifact = 'EasyUpiPayment'
libraryDescription = 'Android Library to integrate UPI payment service easily in your Android app'


// Your github repo link
siteUrl = 'https://github.com/patilshreyas/EasyUpiPayment-Android'
gitUrl = 'https://github.com/patilshreyas/EasyUpiPayment-Android.git'
githubRepository = 'patilshreyas/EasyUpiPayment'

libraryVersion = version

developerId = 'patilshreyas'
developerName = 'Shreyas Patil'
developerEmail = '[email protected]'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

group = publishedGroupId
def siteUrl = 'https://github.com/PatilShreyas/EasyUpiPayment-Android'
def gitUrl = 'https://github.com/PatilShreyas/EasyUpiPayment-Android.git'

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'

// Add your description here
groupId 'com.shreyaspatil'
artifactId = 'EasyUpiPayment'
name 'EasyUpiPayment'
description = 'Android Library to integrate UPI payment service easily in your Android app'
url siteUrl

// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'PatilShreyas'
name 'Shreyas Patil'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
dokkaHtml.configure {
dokkaSourceSets {
named("main") {
noAndroidSdkLink.set(false)
}
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

// Avoid Kotlin docs error
tasks.withType(Javadoc) {
enabled = false
}

// Remove javadoc related tasks
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

artifacts {
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

// https://github.com/bintray/gradle-bintray-plugin
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
repo = "maven"
// it is the name that appears in bintray when logged
name = "com.shreyaspatil:EasyUpiPayment"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
version {
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = properties.getProperty("bintray.gpg.password")
//Optional. The passphrase for GPG signing'
}
}
}
}
repositories {
mavenCentral()
}
apply plugin: 'com.vanniktech.maven.publish'
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import androidx.test.core.app.ApplicationProvider
import androidx.test.core.app.launchActivity
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn
import com.shreyaspatil.easyupipayment.model.PaymentApp
import com.shreyaspatil.easyupipayment.testutils.paymentWith
import dev.shreyaspatil.easyupipayment.model.PaymentApp
import dev.shreyaspatil.easyupipayment.testutils.paymentWith
import dev.shreyaspatil.easyupipayment.ui.PaymentUiActivity
import junit.framework.TestCase.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
Expand Down
11 changes: 9 additions & 2 deletions EasyUpiPayment/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shreyaspatil.easyupipayment">
package="dev.shreyaspatil.easyupipayment">

<queries>
<intent>
<action android:name="android.intent.action.CHOOSER" />
<data android:scheme="upi" />
</intent>
</queries>

<application>
<activity
android:name="com.shreyaspatil.easyupipayment.ui.PaymentUiActivity"
android:name=".ui.PaymentUiActivity"
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" />
</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shreyaspatil.easyupipayment
package dev.shreyaspatil.easyupipayment

import android.app.Activity
import android.content.Intent
Expand All @@ -9,12 +9,12 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.OnLifecycleEvent
import com.shreyaspatil.easyupipayment.EasyUpiPayment.Builder
import com.shreyaspatil.easyupipayment.exception.AppNotFoundException
import com.shreyaspatil.easyupipayment.listener.PaymentStatusListener
import com.shreyaspatil.easyupipayment.model.Payment
import com.shreyaspatil.easyupipayment.model.PaymentApp
import com.shreyaspatil.easyupipayment.ui.PaymentUiActivity
import dev.shreyaspatil.easyupipayment.EasyUpiPayment.Builder
import dev.shreyaspatil.easyupipayment.exception.AppNotFoundException
import dev.shreyaspatil.easyupipayment.listener.PaymentStatusListener
import dev.shreyaspatil.easyupipayment.model.Payment
import dev.shreyaspatil.easyupipayment.model.PaymentApp
import dev.shreyaspatil.easyupipayment.ui.PaymentUiActivity

/**
* Class to implement Easy UPI Payment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shreyaspatil.easyupipayment
package dev.shreyaspatil.easyupipayment

import com.shreyaspatil.easyupipayment.listener.PaymentStatusListener
import dev.shreyaspatil.easyupipayment.listener.PaymentStatusListener

internal object Singleton {
@set:JvmSynthetic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shreyaspatil.easyupipayment.exception
package dev.shreyaspatil.easyupipayment.exception

class AppNotFoundException(appPackage: String?) : Exception("""
No UPI app${appPackage?.let { " with package name '$it'" } ?: ""} exists on this device to perform this transaction.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.shreyaspatil.easyupipayment.listener
package dev.shreyaspatil.easyupipayment.listener

import com.shreyaspatil.easyupipayment.model.TransactionDetails
import dev.shreyaspatil.easyupipayment.model.TransactionDetails

interface PaymentStatusListener {
fun onTransactionCompleted(transactionDetails: TransactionDetails)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shreyaspatil.easyupipayment.model
package dev.shreyaspatil.easyupipayment.model

import java.io.Serializable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shreyaspatil.easyupipayment.model
package dev.shreyaspatil.easyupipayment.model

@Suppress("SpellCheckingInspection")
enum class PaymentApp(val packageName: String) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shreyaspatil.easyupipayment.model
package dev.shreyaspatil.easyupipayment.model

data class TransactionDetails(
val transactionId: String?,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.shreyaspatil.easyupipayment.ui
package dev.shreyaspatil.easyupipayment.ui

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.shreyaspatil.easyupipayment.R
import com.shreyaspatil.easyupipayment.Singleton
import com.shreyaspatil.easyupipayment.exception.AppNotFoundException
import com.shreyaspatil.easyupipayment.model.Payment
import com.shreyaspatil.easyupipayment.model.TransactionDetails
import com.shreyaspatil.easyupipayment.model.TransactionStatus
import dev.shreyaspatil.easyupipayment.R
import dev.shreyaspatil.easyupipayment.Singleton
import dev.shreyaspatil.easyupipayment.exception.AppNotFoundException
import dev.shreyaspatil.easyupipayment.model.Payment
import dev.shreyaspatil.easyupipayment.model.TransactionDetails
import dev.shreyaspatil.easyupipayment.model.TransactionStatus
import java.util.*

class PaymentUiActivity : AppCompatActivity() {
Expand Down
2 changes: 1 addition & 1 deletion EasyUpiPayment/src/main/res/layout/activity_upipay.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.shreyaspatil.easyupipayment.ui.PaymentUiActivity">
tools:context=".ui.PaymentUiActivity">

<ProgressBar
style="@style/Widget.AppCompat.ProgressBar"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.shreyaspatil.easyupipayment.testutils
package dev.shreyaspatil.easyupipayment.testutils

import com.shreyaspatil.easyupipayment.EasyUpiPayment
import com.shreyaspatil.easyupipayment.listener.PaymentStatusListener
import com.shreyaspatil.easyupipayment.model.Payment
import com.shreyaspatil.easyupipayment.model.PaymentApp
import com.shreyaspatil.easyupipayment.model.TransactionDetails
import dev.shreyaspatil.easyupipayment.EasyUpiPayment
import dev.shreyaspatil.easyupipayment.listener.PaymentStatusListener
import dev.shreyaspatil.easyupipayment.model.Payment
import dev.shreyaspatil.easyupipayment.model.PaymentApp
import dev.shreyaspatil.easyupipayment.model.TransactionDetails

const val validVpa = "example@vpa"
const val invalidVpa = "emample"
Expand Down Expand Up @@ -41,7 +41,7 @@ fun paymentWith(paymentApp: PaymentApp? = null) = Payment(
"INT",
validVpa,
validName,
null,
"",
validTransactionId,
validTransactionId,
validDescription,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.shreyaspatil.easyupipayment.testutils
package dev.shreyaspatil.easyupipayment.testutils

import org.mockito.Mockito

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import android.app.Activity
import android.content.pm.PackageManager
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Lifecycle
import com.shreyaspatil.easyupipayment.model.PaymentApp
import com.shreyaspatil.easyupipayment.testutils.*
import dev.shreyaspatil.easyupipayment.EasyUpiPayment
import dev.shreyaspatil.easyupipayment.Singleton
import dev.shreyaspatil.easyupipayment.model.PaymentApp
import dev.shreyaspatil.easyupipayment.testutils.*
import junit.framework.TestCase.assertNotNull
import junit.framework.TestCase.assertNull
import org.hamcrest.CoreMatchers.equalTo
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {
sourceCompatibility "1.8"
targetCompatibility "1.8"
}
buildToolsVersion '30.0.2'
buildToolsVersion '30.0.3'
}

dependencies {
Expand All @@ -37,7 +37,7 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

// EasyUpiPayment Library
implementation 'com.shreyaspatil:EasyUpiPayment:3.0.1'
implementation 'dev.shreyaspatil.EasyUpiPayment:EasyUpiPayment:3.0.2'

// implementation project(path: ':EasyUpiPayment')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.easyupipayment.java;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
Expand All @@ -13,10 +14,11 @@
import androidx.appcompat.app.AppCompatActivity;

import com.example.easyupipayment.R;
import com.shreyaspatil.easyupipayment.EasyUpiPayment;
import com.shreyaspatil.easyupipayment.listener.PaymentStatusListener;
import com.shreyaspatil.easyupipayment.model.PaymentApp;
import com.shreyaspatil.easyupipayment.model.TransactionDetails;

import dev.shreyaspatil.easyupipayment.EasyUpiPayment;
import dev.shreyaspatil.easyupipayment.listener.PaymentStatusListener;
import dev.shreyaspatil.easyupipayment.model.PaymentApp;
import dev.shreyaspatil.easyupipayment.model.TransactionDetails;

public class MainActivity extends AppCompatActivity implements PaymentStatusListener {

Expand Down Expand Up @@ -68,6 +70,7 @@ private void initViews() {
radioAppChoice = findViewById(R.id.radioAppChoice);
}

@SuppressLint("NonConstantResourceId")
private void pay() {
String payeeVpa = fieldPayeeVpa.getText().toString();
String payeeName = fieldPayeeName.getText().toString();
Expand Down
Loading

0 comments on commit 9558a6f

Please sign in to comment.