Skip to content

Commit

Permalink
Add necessary bintray publication date
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Surinov committed Jun 25, 2018
1 parent 1d3c85e commit c9d9fcd
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 9 deletions.
67 changes: 67 additions & 0 deletions bintray/bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apply plugin: 'com.jfrog.bintray'

version = libraryVersion

/*
* Comment the following part if you only want to distribute .aar files.
* (For example, your source code is obfuscated by Proguard and is not shown to outsite developers)
* Without source code .jar files, you only can publish on bintray respository but not jcenter.
*/

/*--------------------------------*/
if (project.hasProperty("android")) {
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
} else { // Java libraries
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
}
/*--------------------------------*/

// Bintray
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayPackageName
desc = libraryDescription
userOrg = organization // If the repository is hosted by an organization instead of personal account.
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true
passphrase = properties.getProperty("bintray.gpg.password")
}
}
}
}
41 changes: 41 additions & 0 deletions bintray/install.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apply plugin: 'com.github.dcendents.android-maven'

group = groupId // Maven Group ID for the artifact

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

// Add your description here
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

}
}

}
}
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ buildscript {
// Gradle plugins versions
gradle_plugins = [
android_plugin_version: '3.1.1',
kotlin_plugin_version : libs.kotlin_version
kotlin_plugin_version : libs.kotlin_version,
bintray_plugin_version: '1.8.0',
maven_plugin_version: '2.0'
]
}

repositories {
google()
jcenter()

maven {
url 'https://maven.fabric.io/public'
}
}

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"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
45 changes: 41 additions & 4 deletions cpcalendar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

// Bintray publication data
ext {
bintrayRepo = 'maven'
bintrayPackageName = 'cpcalendar'

// Library package info
groupId = 'ru.cleverpumpkin'
artifactId = 'cpcalendar'
libraryVersion = app.version_name

// Library name and description
libraryName = 'CPCalendar'
libraryDescription = 'Light, powerful and easy to use Calendar Widget with a number of features out of the box'

// Git info
siteUrl = 'https://github.com/CleverPumpkin/cpcalendar-android'
gitUrl = 'https://github.com/CleverPumpkin/cpcalendar-android.git'

// Developer info
developerId = 'alexsurinov'
developerName = 'Alexander Surinov'
developerEmail = '[email protected]'
organization = 'cleverpumpkin'

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

android {
compileSdkVersion app.compile_sdk_version

Expand All @@ -23,11 +53,18 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Kotlin language standard lib
api "org.jetbrains.kotlin:kotlin-stdlib:$libs.kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$libs.kotlin_version"

// Support libraries
api "com.android.support:appcompat-v7:$libs.support_lib_version"
api "com.android.support:recyclerview-v7:$libs.support_lib_version"
implementation "com.android.support:appcompat-v7:$libs.support_lib_version"
implementation "com.android.support:recyclerview-v7:$libs.support_lib_version"

testImplementation 'junit:junit:4.12'
}
}

tasks.withType(Javadoc).all {
enabled = false
}

apply from: '../bintray/install.gradle'
apply from: '../bintray/bintray.gradle'

0 comments on commit c9d9fcd

Please sign in to comment.