Skip to content

Commit

Permalink
migrate publication from jcenter to mavencentral
Browse files Browse the repository at this point in the history
  • Loading branch information
artyomnikolaev committed Apr 12, 2021
1 parent b87f354 commit d5e8e6a
Show file tree
Hide file tree
Showing 20 changed files with 176 additions and 551 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.1"
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.20'
}
Expand Down
96 changes: 96 additions & 0 deletions publishMavenCentral.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

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

artifacts {
archives androidSourcesJar
}

group = PUBLISH_GROUP_ID
version = PUBLISH_VERSION

ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.secretKeyRingFile"] = ''
ext["ossrhUsername"] = ''
ext["ossrhPassword"] = ''

File localPropertiesFile = project.rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Properties properties = new Properties()
properties.load(new FileInputStream(localPropertiesFile))
properties.each { name, value ->
ext[name] = value
}
} else {
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
}

publishing {
publications {
release(MavenPublication) {
groupId PUBLISH_GROUP_ID
artifactId PUBLISH_ARTIFACT_ID
version PUBLISH_VERSION

artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")

artifact androidSourcesJar

pom {
name = PUBLISH_NAME
description = PUBLISH_DESCRIPTION
url = 'https://github.com/xsolla/store-android-sdk'
organization {
name = 'Xsolla'
url = 'https://xsolla.com'
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = 'https://github.com/xsolla/store-android-sdk.git'
developerConnection = 'https://github.com/xsolla/store-android-sdk.git'
url = 'https://github.com/xsolla/store-android-sdk.git'
}
withXml {
def dependenciesNode = asNode().appendNode('dependencies')

project.configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
repositories {
maven {
name = "sonatype"
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"

credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}

signing {
sign publishing.publications
}
10 changes: 9 additions & 1 deletion xsolla-inventory-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ dokkaHtml.configure {
}
}

apply from: 'publish.gradle'
ext {
PUBLISH_GROUP_ID = 'com.xsolla.android'
PUBLISH_ARTIFACT_ID = 'inventory'
PUBLISH_VERSION = inventory_sdk_version_name
PUBLISH_NAME = 'Xsolla Inventory SDK for Android'
PUBLISH_DESCRIPTION = 'Xsolla Inventory SDK for Android is used to integrate applications based on Android with Player Inventory for managing: user inventory, virtual currency balance, cross-platform inventory'
}

apply from: "${rootDir}/publishMavenCentral.gradle"
60 changes: 0 additions & 60 deletions xsolla-inventory-sdk/publish.gradle

This file was deleted.

10 changes: 9 additions & 1 deletion xsolla-login-sdk-facebook/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@ dependencies {
api 'com.facebook.android:facebook-login:8.1.0'
}

apply from: 'publish.gradle'
ext {
PUBLISH_GROUP_ID = 'com.xsolla.android'
PUBLISH_ARTIFACT_ID = 'login-facebook'
PUBLISH_VERSION = login_sdk_version_name
PUBLISH_NAME = 'Xsolla Login SDK for Android'
PUBLISH_DESCRIPTION = 'Xsolla Login SDK for Android is used to integrate Xsolla Login, a single sign-on tool that uses API methods to authenticate and secure user passwords. This creates a seamless one-click registration experience players can use for fast and safe transactions across all of your games.'
}

apply from: "${rootDir}/publishMavenCentral.gradle"
60 changes: 0 additions & 60 deletions xsolla-login-sdk-facebook/publish.gradle

This file was deleted.

10 changes: 9 additions & 1 deletion xsolla-login-sdk-google/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ dependencies {
api 'com.google.android.gms:play-services-auth:18.0.0'
}

apply from: 'publish.gradle'
ext {
PUBLISH_GROUP_ID = 'com.xsolla.android'
PUBLISH_ARTIFACT_ID = 'login-google'
PUBLISH_VERSION = login_sdk_version_name
PUBLISH_NAME = 'Xsolla Login SDK for Android'
PUBLISH_DESCRIPTION = 'Xsolla Login SDK for Android is used to integrate Xsolla Login, a single sign-on tool that uses API methods to authenticate and secure user passwords. This creates a seamless one-click registration experience players can use for fast and safe transactions across all of your games.'
}

apply from: "${rootDir}/publishMavenCentral.gradle"
60 changes: 0 additions & 60 deletions xsolla-login-sdk-google/publish.gradle

This file was deleted.

10 changes: 9 additions & 1 deletion xsolla-login-sdk-qq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
}

apply from: 'publish.gradle'
ext {
PUBLISH_GROUP_ID = 'com.xsolla.android'
PUBLISH_ARTIFACT_ID = 'login-qq'
PUBLISH_VERSION = login_sdk_version_name
PUBLISH_NAME = 'Xsolla Login SDK for Android'
PUBLISH_DESCRIPTION = 'Xsolla Login SDK for Android is used to integrate Xsolla Login, a single sign-on tool that uses API methods to authenticate and secure user passwords. This creates a seamless one-click registration experience players can use for fast and safe transactions across all of your games.'
}

apply from: "${rootDir}/publishMavenCentral.gradle"
Loading

0 comments on commit d5e8e6a

Please sign in to comment.