Skip to content

Commit

Permalink
Update README and publish configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-keinander committed May 20, 2021
1 parent de14ee6 commit 9f6a113
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 16 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ The Trustly Android SDK provides an easy way to implement the Trustly Checkout i
## Integration
Integrate the Trustly Android SDK through Gradle.

To authenticate with Github Packages you need to add your GitHub username and a GitHub Access Token to your project level build.gradle file.
To authenticate with Github Packages you need to add your GitHub username and a [GitHub Access Token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) to your project level build.gradle file.

Make sure that you your token have both read and write permissions for packages.

**`NOTE: Do not commit these credentials to your repo.`**
```gradle
repositories {
maven("https://maven.pkg.github.com/trustly/TrustlyAndroidSdk") {
credentials {
username = "<GITHUB-USERNAME"
password = "<ACCESS-TOKEN>"
}
maven {
url = uri("https://maven.pkg.github.com/trustly/TrustlyAndroidSdk")
credentials {
username = "<GITHUB-USERNAME"
password = "<ACCESS-TOKEN>"
}
}
}
```
Expand All @@ -23,6 +28,12 @@ Add the following to your dependencies in the build. gradle file.
```gradle
implementation 'trustly.android.library:trustly-android-library:+'
```

You also need to add the `INTERNET` permission to your `AndroidManifest.xml`
```xml
<uses-permission android:name="android.permission.INTERNET"/>
```

## Usage
Add a WebView to the activity you wish to launch the Trustly Checkout from.

Expand Down
72 changes: 64 additions & 8 deletions TrustlyAndroidSdk/Trustly-Android-Library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply plugin: 'com.android.library'




buildscript {
repositories {
Expand All @@ -7,15 +9,26 @@ buildscript {
}
}

plugins {
id 'maven-publish'
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 30
buildToolsVersion "30.0.2"

lintOptions {
abortOnError false
}


defaultConfig {
minSdkVersion 19
targetSdkVersion 30
versionCode 4
versionName "1.0.3"
versionCode 7
versionName "3.0.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand All @@ -40,23 +53,66 @@ ext {
bintrayName = 'trustly.android.library'

publishedGroupId = 'trustly.android.library'
libraryName = 'TrustlyAndroidLibrary'
artifact = 'TrustlyAndroidLibrary'
libraryName = 'trustly-android-library'
artifact = 'trustly-android-library'

libraryDescription = 'Trustly\'s SDK for native android apps.'

siteUrl = 'https://github.com/trustly/TrustlyAndroidSdk'
gitUrl = 'https://github.com/trustly/TrustlyAndroidSdk.git'

libraryVersion = '1.0.3'
libraryVersion = '3.0.1' //UPDATE WHEN RELEASING A NEW PACKAGE

developerId = 'Trustly'
developerName = 'Team Bulle'
developerEmail = '[email protected]'
developerEmail = '[email protected]'

licenseName = 'MIT License'
licenseUrl = 'https://opensource.org/licenses/mit-license.php'
allLicenses = ["MIT"]

}

apply from: 'publish.gradle'
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from(components.release)
artifactId = 'trustly-android-library'
groupId = publishedGroupId
version = libraryVersion

pom {
name = artifact
description = libraryDescription
url = siteUrl

licenses {
license {
name = licenseName
url = licenseUrl
}
}
developers {
developer {
id = developerId
name = developerName
email = developerEmail
}
}
}
}

}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/trustly/TrustlyAndroidSdk")
credentials {
username = "<GITHUB-USER-NAME>"
password = "<GITHUB-PERSONAL-ACCESS-TOKEN>"
}
}
}
}
}
4 changes: 3 additions & 1 deletion TrustlyAndroidSdk/Trustly-Android-Library/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
Expand Down Expand Up @@ -84,4 +85,5 @@ bintray {
desc = libraryDescription
}
}
}
}
*/
2 changes: 1 addition & 1 deletion TrustlyAndroidSdk/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip

0 comments on commit 9f6a113

Please sign in to comment.