Skip to content

Commit c71653e

Browse files
committed
add gradle push source
1 parent be93aa6 commit c71653e

3 files changed

Lines changed: 104 additions & 2 deletions

File tree

gradle/bintray.gradle

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
apply plugin: 'com.jfrog.bintray'
2+
3+
version = libraryVersion
4+
5+
if (project.hasProperty("android")) { // Android libraries
6+
task sourcesJar(type: Jar) {
7+
classifier = 'sources'
8+
from android.sourceSets.main.java.srcDirs
9+
}
10+
11+
task javadoc(type: Javadoc) {
12+
source = android.sourceSets.main.java.srcDirs
13+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
14+
}
15+
} else { // Java libraries
16+
task sourcesJar(type: Jar, dependsOn: classes) {
17+
classifier = 'sources'
18+
from sourceSets.main.allSource
19+
}
20+
}
21+
22+
task javadocJar(type: Jar, dependsOn: javadoc) {
23+
classifier = 'javadoc'
24+
from javadoc.destinationDir
25+
}
26+
27+
artifacts {
28+
archives javadocJar
29+
archives sourcesJar
30+
}
31+
32+
// Bintray
33+
Properties properties = new Properties()
34+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
35+
36+
bintray {
37+
user = properties.getProperty("bintray.user")
38+
key = properties.getProperty("bintray.apikey")
39+
40+
configurations = ['archives']
41+
pkg {
42+
repo = bintrayRepo
43+
name = bintrayName
44+
desc = libraryDescription
45+
websiteUrl = siteUrl
46+
vcsUrl = gitUrl
47+
licenses = allLicenses
48+
publish = true
49+
publicDownloadNumbers = true
50+
version {
51+
desc = libraryDescription
52+
gpg {
53+
sign = true //Determines whether to GPG sign the files. The default is false
54+
passphrase = properties.getProperty("bintray.gpg.password")
55+
//Optional. The passphrase for GPG signing'
56+
}
57+
}
58+
}
59+
}

gradle/gradle-jcenter-push.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ ext {
6363

6464
// Place it at the end of the file
6565
if (project.hasProperty("android")) { // Android libraries
66-
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
66+
apply from: rootProject.file('gradle/install.gradle')
6767
}
68-
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
68+
apply from: rootProject.file('gradle/bintray.gradle')

gradle/install.gradle

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apply plugin: 'com.github.dcendents.android-maven'
2+
3+
// Maven Group ID for the artifact
4+
group = publishedGroupId
5+
6+
install {
7+
repositories.mavenInstaller {
8+
// This generates POM.xml with proper parameters
9+
pom {
10+
project {
11+
packaging 'aar'
12+
groupId publishedGroupId
13+
artifactId artifact
14+
15+
// Add your description here
16+
name libraryName
17+
description libraryDescription
18+
url siteUrl
19+
20+
// Set your license
21+
licenses {
22+
license {
23+
name licenseName
24+
url licenseUrl
25+
}
26+
}
27+
developers {
28+
developer {
29+
id developerId
30+
name developerName
31+
email developerEmail
32+
}
33+
}
34+
scm {
35+
connection gitUrl
36+
developerConnection gitUrl
37+
url siteUrl
38+
39+
}
40+
}
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)