Skip to content

Commit ef52d86

Browse files
committed
Publish to Bintray
1 parent cf01fda commit ef52d86

File tree

3 files changed

+106
-1
lines changed

3 files changed

+106
-1
lines changed

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
buildscript {
22
ext.kotlinVersion = '1.3.71'
3+
ext.bintrayVersion = '1.8.5'
34

45
repositories {
56
google()
@@ -8,6 +9,7 @@ buildscript {
89

910
dependencies {
1011
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
12+
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintrayVersion"
1113
}
1214
}
1315

@@ -34,4 +36,6 @@ gradlePlugin {
3436
implementationClass = 'ru.mobileup.codequality.CodeQualityPlugin'
3537
}
3638
}
37-
}
39+
}
40+
41+
apply from: 'publish.gradle'

publish.gradle

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'com.jfrog.bintray'
3+
4+
ext {
5+
bintrayRepo = 'CodeQuality-Android'
6+
bintrayName = 'CodeQuality-Android'
7+
8+
publishedGroupId = 'ru.mobileup'
9+
libraryName = 'CodeQuality-Android'
10+
artifact = 'code-quality-android'
11+
12+
libraryDescription = 'Gradle plugin for integration with Gitlab Code Quality'
13+
libraryVersion = '1.0.0'
14+
15+
siteUrl = 'https://github.com/MobileUpLLC/CodeQuality-Android/'
16+
gitUrl = 'https://github.com/MobileUpLLC/CodeQuality-Android.git'
17+
18+
developerId = 'MobileUp'
19+
developerName = 'MobileUp'
20+
developerEmail = '[email protected]'
21+
22+
licenseName = 'The MIT License'
23+
licenseUrl = 'https://github.com/MobileUpLLC/CodeQuality-Android/blob/master/LICENSE'
24+
allLicenses = ['MIT']
25+
}
26+
27+
java {
28+
withJavadocJar()
29+
withSourcesJar()
30+
}
31+
32+
// Create Maven Artifact
33+
publishing {
34+
publications {
35+
codeQualityAndroid(MavenPublication) {
36+
from components.java
37+
groupId publishedGroupId
38+
artifactId artifact
39+
version libraryVersion
40+
pom {
41+
name = libraryName
42+
description = libraryDescription
43+
url = siteUrl
44+
licenses {
45+
license {
46+
name = licenseName
47+
url = licenseUrl
48+
}
49+
}
50+
developers {
51+
developer {
52+
id = developerId
53+
name = developerName
54+
email = developerEmail
55+
}
56+
}
57+
scm {
58+
connection = gitUrl
59+
developerConnection = gitUrl
60+
url = siteUrl
61+
}
62+
}
63+
}
64+
}
65+
}
66+
67+
// Publish to Bintray. Use "./gradlew bintrayUpload" to run it.
68+
Properties properties = new Properties()
69+
properties.load(file('local.properties').newDataInputStream())
70+
71+
bintray {
72+
user = properties.getProperty('bintray.user')
73+
key = properties.getProperty('bintray.apikey')
74+
publications = ['codeQualityAndroid']
75+
76+
pkg {
77+
repo = bintrayRepo
78+
name = bintrayName
79+
desc = libraryDescription
80+
websiteUrl = siteUrl
81+
vcsUrl = gitUrl
82+
licenses = allLicenses
83+
userOrg = properties.getProperty('bintray.userOrg')
84+
publish = true
85+
publicDownloadNumbers = true
86+
version {
87+
name = libraryVersion
88+
desc = libraryDescription
89+
gpg {
90+
sign = true
91+
passphrase = properties.getProperty('bintray.gpg.password')
92+
}
93+
}
94+
}
95+
}

template-for-local.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sdk.dir=
2+
3+
bintray.user=
4+
bintray.apikey=
5+
bintray.userOrg=
6+
bintray.gpg.password=

0 commit comments

Comments
 (0)