Skip to content

Commit

Permalink
Use local gradle files for bintray config
Browse files Browse the repository at this point in the history
  • Loading branch information
manas-chaudhari committed Aug 3, 2016
1 parent 6d4b8e5 commit 1ca992a
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gradle/bintray-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ ext {
allLicenses = ["Apache-2.0"]
}

apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
apply from: rootProject.file('gradle/bintray/install.gradle')
apply from: rootProject.file('gradle/bintray/bintray.gradle')
57 changes: 57 additions & 0 deletions gradle/bintray/bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Source: https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle
apply plugin: 'com.jfrog.bintray'

version = libraryVersion

if (project.hasProperty("android")) { // Android libraries
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
bintray {
user = hasProperty('bintrayUser') ? bintrayUser : ""
key = hasProperty('bintrayKey') ? bintrayKey : ""

configurations = ['archives']
pkg {
repo = bintrayRepo
name = bintrayName
desc = libraryDescription
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = allLicenses
publish = true
publicDownloadNumbers = true
version {
desc = libraryDescription
gpg {
sign = true //Determines whether to GPG sign the files. The default is false
passphrase = hasProperty('bintrayGpgPassword') ? bintrayGpgPassword : ""
//Optional. The passphrase for GPG signing'
}
}
}
}
43 changes: 43 additions & 0 deletions gradle/bintray/install.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//Source; https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle
apply plugin: 'com.github.dcendents.android-maven'

group = publishedGroupId // Maven Group ID for the artifact

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

// 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

}
}
}
}
}

0 comments on commit 1ca992a

Please sign in to comment.