Skip to content

Commit 0ae3bcd

Browse files
Setup gradle tasks for publishing to maven central (#119)
1 parent 9999ae0 commit 0ae3bcd

File tree

5 files changed

+17
-110
lines changed

5 files changed

+17
-110
lines changed

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ buildscript {
99
dependencies {
1010
classpath 'com.android.tools.build:gradle:4.0.0'
1111
classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0'
12-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
13-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1412
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1513
// NOTE: Do not place your application dependencies here; they belong
1614
// in the individual module build.gradle files

gradle.properties

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,17 @@
2121
# Once pinpad has been updated (https://github.com/PaystackHQ/library-android-pinpad/pull/6)
2222
# Then android.enableJetifier=true can be deleted and full AndroidX migration is complete
2323
android.enableJetifier=true
24-
2524
android.useAndroidX=true
25+
GROUP=co.paystack.android
26+
VERSION_NAME=3.1.2
27+
POM_DESCRIPTION=Android SDK for Paystack
28+
POM_URL=https://github.com/PaystackHQ/paystack-android
29+
POM_SCM_URL=https://github.com/PaystackHQ/paystack-android
30+
POM_SCM_CONNECTION=scm:git:github.com/PaystackHQ/paystack-android.git
31+
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/PaystackHQ/paystack-android.git
32+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
33+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
34+
POM_LICENCE_DIST=repo
35+
POM_DEVELOPER_ID=paystack
36+
POM_DEVELOPER_NAME=Paystack
37+
POM_DEVELOPER_EMAIL=[email protected]

paystack/bintray-config.gradle

Lines changed: 0 additions & 50 deletions
This file was deleted.

paystack/build.gradle

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3-
apply plugin: "com.jfrog.bintray"
4-
apply plugin: 'com.github.dcendents.android-maven'
5-
apply plugin: 'maven-publish'
63

74
android {
85
compileSdkVersion rootProject.ext.compileSdkVersion
@@ -36,57 +33,4 @@ dependencies {
3633
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7"
3734
}
3835

39-
project.afterEvaluate {
40-
publishing {
41-
publications {
42-
library(MavenPublication) {
43-
setGroupId 'co.paystack.android'
44-
setArtifactId 'paystack'
45-
version android.defaultConfig.versionName
46-
artifact bundleReleaseAar
47-
48-
pom.withXml {
49-
def dependenciesNode = asNode().appendNode('dependencies')
50-
configurations.implementation.allDependencies.each {
51-
if (it.name != 'unspecified') {
52-
def dependencyNode = dependenciesNode.appendNode('dependency')
53-
dependencyNode.appendNode('groupId', it.group)
54-
dependencyNode.appendNode('artifactId', it.name)
55-
dependencyNode.appendNode('version', it.version)
56-
}
57-
}
58-
}
59-
}
60-
}
61-
}
62-
}
63-
64-
ext {
65-
// Where you will see your artifact in Bintray's web interface
66-
// The "bintrayName" should match the name of the Bintray repro.
67-
bintrayRepo = 'maven'
68-
bintrayName = 'paystack-android'
69-
70-
// Maven metadata
71-
publishedGroupId = 'co.paystack.android'
72-
libraryName = 'paystack-android'
73-
// Save yourself a head ache, and set this equal to the name of the Android Studio library
74-
// module. The artifact name needs to match the name of the library.
75-
artifact = 'paystack'
76-
77-
libraryDescription = 'An android sdk for working with paystack'
78-
libraryVersion = rootProject.ext.versionName
79-
80-
developerId = 'paystack'
81-
developerName = 'Paystack'
82-
developerEmail = '[email protected]'
83-
84-
siteUrl = 'https://github.com/PaystackHQ/paystack-android'
85-
gitUrl = 'https://github.com/PaystackHQ/paystack-android.git'
86-
87-
licenseName = 'The Apache Software License, Version 2.0'
88-
licenseUrl = 'https://raw.githubusercontent.com/PaystackHQ/paystack-android/master/LICENSE.txt'
89-
allLicenses = ["Apache-2.0"]
90-
}
91-
apply from: 'https://raw.githubusercontent.com/ibrahimlawal/JCenter/master/installv1.gradle'
92-
apply from: "$rootProject.projectDir/paystack/bintray-config.gradle"
36+
apply from: "https://raw.githubusercontent.com/PaystackHQ/publish-mavencentral/main/maven-publish.gradle"

paystack/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_ARTIFACT_ID=paystack
2+
POM_NAME=paystack-android
3+
POM_PACKAGING=aar

0 commit comments

Comments
 (0)