Skip to content

Commit

Permalink
Configure plugin for uploading library to mavenCentral. Remove bintra…
Browse files Browse the repository at this point in the history
…y upload plugin
  • Loading branch information
Anatoliy Shulipov committed Apr 14, 2021
1 parent a34e658 commit a52b275
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 129 deletions.
67 changes: 0 additions & 67 deletions bintray/bintray.gradle

This file was deleted.

41 changes: 0 additions & 41 deletions bintray/install.gradle

This file was deleted.

19 changes: 9 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
ext {
// App info section
app = [
version_code : 3,
version_name : '2.1.0',
version_code : 4,
version_name : '2.2.0',
min_sdk_version : 16,
target_sdk_version : 29,
compile_sdk_version: 29
Expand All @@ -16,11 +16,11 @@ buildscript {
libs = [
kotlin_version : '1.4.32',
appCompatX : '1.2.0',
recyclerViewX : '1.1.0',
recyclerViewX : '1.2.0',
viewBindingPropertyDelegate : '1.4.5',

// libs for testing
junit_version : '4.13',
junit_version : '4.13.2',
mockito_version : '1.10.19',
powermock_version : '1.6.4'
]
Expand All @@ -29,23 +29,22 @@ buildscript {
gradle_plugins = [
android_plugin_version: '4.1.3',
kotlin_plugin_version : libs.kotlin_version,
bintray_plugin_version: '1.8.0',
maven_plugin_version : '2.0'
maven_plugin_version : '0.13.0'
]
}

repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath "com.android.tools.build:gradle:$gradle_plugins.android_plugin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$gradle_plugins.kotlin_plugin_version"

classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_plugins.bintray_plugin_version"
classpath "com.github.dcendents:android-maven-gradle-plugin:$gradle_plugins.maven_plugin_version"

classpath "com.vanniktech:gradle-maven-publish-plugin:$gradle_plugins.maven_plugin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
16 changes: 5 additions & 11 deletions crunchycalendar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

//

// Bintray publication data for uploading scripts that is placed in `bintray` directory
ext {
bintrayRepo = 'maven' // The repository name in Bintray dashboard
bintrayPackageName = 'CrunchyCalendar' // The package name of th Bintray repository

// Library package information.
groupId = 'ru.cleverpumpkin' // The group ID you want to add in `implementation` line

Expand All @@ -21,11 +20,7 @@ ext {
siteUrl = 'https://github.com/CleverPumpkin/CrunchyCalendar'
gitUrl = 'https://github.com/CleverPumpkin/CrunchyCalendar.git'

// Developer information.
developerId = 'alexsurinov'
developerName = 'Alexander Surinov'
developerEmail = 'alexander.surinov@cleverpumpkin.ru'
organization = 'cleverpumpkin'
// Developer information provided in 'mavenCentral.gradle

// License information.
licenseName = 'MIT'
Expand Down Expand Up @@ -78,6 +73,5 @@ tasks.withType(Javadoc).all {
enabled = false
}

// This is the ready-to-use scripts to make uploading to bintray easy.
apply from: '../bintray/install.gradle'
apply from: '../bintray/bintray.gradle'
// This is the ready-to-use scripts to make uploading to mavenCentral easy.
apply from: '../mavenCentral/mavenCentral.gradle'
80 changes: 80 additions & 0 deletions mavenCentral/mavenCentral.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apply plugin: 'maven'
apply plugin: 'signing'

group = groupId
version = libraryVersion

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
archiveClassifier.set("source")
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
destinationDir = file("../javadoc/")
failOnError false
}

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

//Creating sources with comments
task androidSourcesJar(type: Jar) {
archiveClassifier.set("sources")
from android.sourceSets.main.java.srcDirs
}

artifacts {
archives javadocJar
archives androidSourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name libraryName
packaging 'aar'
description libraryDescription
artifactId artifactId
url siteUrl
scm {
url gitUrl
connection gitUrl
developerConnection gitUrl
}
licenses {
license {
name licenseName
url licenseUrl
distribution 'repo'
}
}
developers {
developer {
id 'alexsurinov'
name 'Alexander Surinov'
organization 'clverpumpkin'
}
developer {
id 'Limanskaya'
name 'Anastasiya Stroganova'
organization 'clverpumpkin'
}
developer {
id 'itolianezzz'
name 'Anatoly Shulipov'
organization 'clverpumpkin'
}
}
}
}
}
}

0 comments on commit a52b275

Please sign in to comment.