Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Technical Improvements #20

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

Expand All @@ -18,4 +20,4 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}
}
Empty file modified gradlew
100644 → 100755
Empty file.
138 changes: 137 additions & 1 deletion rxp-hpp-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

ext {
bintrayRepo = 'maven'
bintrayName = 'rxp-hpp-android'
bintrayUser = System.getenv('BINTRAY_USER')
bintrayKey = System.getenv('BINTRAY_KEY')
bintrayGPGPassphrase = System.getenv('BINTRAY_GPG_PASSPHRASE')

publishedGroupId = 'com.realexpayments.hpp.sdk'
libraryName = 'rxp-hpp-android'
artifact = 'rxp-hpp-android'

libraryDescription = 'The official Realex Payments Android SDK for HPP and Remote API.'

siteUrl = 'https://developer.realexpayments.com'
gitUrl = 'https://github.com/realexpayments/rxp-android.git'

libraryVersion = '2.0'

developerId = 'realexpayments'
developerName = 'Realex Payments'
developerEmail = '[email protected]'

licenseName = 'The MIT License (MIT)'
licenseUrl = 'https://opensource.org/licenses/MIT'
allLicenses = ["MIT"]
}

// Maven Group ID for the artifact
group = publishedGroupId
version = libraryVersion

android {
compileSdkVersion 29
Expand All @@ -8,7 +41,7 @@ android {
minSdkVersion 19
targetSdkVersion 29
versionCode 3
versionName "2.0"
versionName libraryVersion
}
buildTypes {
release {
Expand All @@ -24,4 +57,107 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.squareup.retrofit:retrofit:1.7.1'
implementation 'org.apache.httpcomponents:httpcore:4.4.10'
testImplementation 'junit:junit:4.12'
}

task printBintrayEnv() {
println "bintrayUser: " + bintrayUser
println "bintrayKey: " + bintrayKey
println "bintrayGPGPassphrase: " + bintrayGPGPassphrase
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.convention('sources')
archiveClassifier.set('sources')
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
options.encoding = 'UTF-8'
options.addStringOption('Xdoclint:none', '-quiet')
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.convention('javadoc')
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
}

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

// description
name libraryName
description libraryDescription
url siteUrl

// Set your license
licenses {
license {
name licenseName
url licenseUrl
}
}

developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl

}
}
}
}
}

// Bintray
bintray {
user = bintrayUser
key = bintrayKey

configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
publish = true
publicDownloadNumbers = true

licenses = allLicenses
vcsUrl = gitUrl
websiteUrl = siteUrl

version {
name = libraryVersion
desc = libraryDescription
released = new Date()
vcsTag = libraryVersion
desc = libraryDescription
// Optional. The passphrase for GPG signing'
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = bintrayGPGPassphrase
}
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class ApiAdapter {
public static final String RETROFIT_TAG = "HPPRetrofit";

public static IHPPServerAPI getAdapter(String endpoint, Map<String, String> headers) {
RestAdapter restAdapter = new RestAdapter.Builder()
return new RestAdapter.Builder()
.setEndpoint(endpoint)
.setLogLevel(RestAdapter.LogLevel.FULL)
.setLog(new AndroidLog(RETROFIT_TAG))
.setConverter(new GsonConverter(getGson()))
.setRequestInterceptor(getRequestInterceptor(headers))
.build();
return restAdapter.create(IHPPServerAPI.class);
.build()
.create(IHPPServerAPI.class);
}

public static Gson getGson() {
Expand Down
Loading