Skip to content

Commit 60c1ff4

Browse files
committed
Setup publishing to JCenter
1 parent 6087e1c commit 60c1ff4

6 files changed

Lines changed: 243 additions & 0 deletions

File tree

core/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: "io.gitlab.arturbosch.detekt"
4+
apply from: 'publish.gradle'
45

56
detekt {
67
failFast = true

core/publish.gradle

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
group = 'com.kirich1409.android-notification-dsl'
2+
version = rootProject.ext.androidNotificationDslVersion
3+
4+
apply plugin: 'com.jfrog.bintray'
5+
apply plugin: 'maven-publish'
6+
7+
def siteUrl = 'https://github.com/kirich1409/Android-Notification-DSL'
8+
def gitRepoUrl = 'https://github.com/kirich1409/Android-Notification-DSL.git'
9+
10+
tasks.register('sourceJar', Jar) {
11+
from android.sourceSets.main.java.srcDirs
12+
classifier "sources"
13+
}
14+
15+
afterEvaluate {
16+
publishing {
17+
publications {
18+
releaseAar(MavenPublication) {
19+
from components.release
20+
artifact(sourceJar)
21+
22+
groupId = 'com.kirich1409.android-notification-dsl'
23+
artifactId = 'core'
24+
version = project.version
25+
26+
pom {
27+
name = 'Android Notifcation DSL'
28+
description = 'API for declarative Notification creation'
29+
url = siteUrl
30+
licenses {
31+
license {
32+
name = 'The Apache License, Version 2.0'
33+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
34+
}
35+
}
36+
developers {
37+
developer {
38+
id = 'kirich1409'
39+
name = 'Kirill Rozov'
40+
email = 'krl.rozov@gmail.com'
41+
}
42+
}
43+
scm {
44+
url = gitRepoUrl
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
51+
52+
bintray {
53+
user = project.hasProperty('user') ? project.property('user') : System.getenv('BINTRAY_USER')
54+
key = project.hasProperty('apiKey') ? project.property('apiKey') : System.getenv('BINTRAY_API_KEY')
55+
56+
publications = ["releaseAar"]
57+
58+
pkg {
59+
repo = 'maven'
60+
name = 'android-notification-dsl-core'
61+
desc = 'API for declarative Notification creation'
62+
websiteUrl = siteUrl
63+
issueTrackerUrl = 'https://github.com/kirich1409/Android-Notification-DSL/issues'
64+
vcsUrl = gitRepoUrl
65+
licenses = ['Apache-2.0']
66+
labels = ['android', 'notification', 'kotlin dsl', 'declarative']
67+
// publish true
68+
publicDownloadNumbers = true
69+
70+
githubRepo = 'kirich1409/Android-Notification-DSL' //Optional Github repository
71+
githubReleaseNotesFile = 'README.md' //Optional Github readme file
72+
73+
version {
74+
name = project.version
75+
desc = 'API for declarative Notification creation'
76+
released = new Date()
77+
}
78+
}
79+
}
80+

extensions/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: "io.gitlab.arturbosch.detekt"
4+
apply from: 'publish.gradle'
45

56
detekt {
67
failFast = true

extensions/publish.gradle

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
group = 'com.kirich1409.android-notification-dsl'
2+
version = rootProject.ext.androidNotificationDslVersion
3+
4+
apply plugin: 'com.jfrog.bintray'
5+
apply plugin: 'maven-publish'
6+
7+
def siteUrl = 'https://github.com/kirich1409/Android-Notification-DSL'
8+
def gitRepoUrl = 'https://github.com/kirich1409/Android-Notification-DSL.git'
9+
10+
tasks.register('sourceJar', Jar) {
11+
from android.sourceSets.main.java.srcDirs
12+
classifier "sources"
13+
}
14+
15+
afterEvaluate {
16+
publishing {
17+
publications {
18+
releaseAar(MavenPublication) {
19+
from components.release
20+
artifact(sourceJar)
21+
22+
groupId = 'com.kirich1409.android-notification-dsl'
23+
artifactId = 'extensions'
24+
version = project.version
25+
26+
pom {
27+
name = 'Android Notifcation DSL'
28+
description = 'API for declarative Notification creation'
29+
url = siteUrl
30+
licenses {
31+
license {
32+
name = 'The Apache License, Version 2.0'
33+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
34+
}
35+
}
36+
developers {
37+
developer {
38+
id = 'kirich1409'
39+
name = 'Kirill Rozov'
40+
email = 'krl.rozov@gmail.com'
41+
}
42+
}
43+
scm {
44+
url = gitRepoUrl
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
51+
52+
bintray {
53+
user = project.hasProperty('user') ? project.property('user') : System.getenv('BINTRAY_USER')
54+
key = project.hasProperty('apiKey') ? project.property('apiKey') : System.getenv('BINTRAY_API_KEY')
55+
56+
publications = ["releaseAar"]
57+
58+
pkg {
59+
repo = 'maven'
60+
name = 'android-notification-dsl-extensions'
61+
desc = 'API for declarative Notification creation'
62+
websiteUrl = siteUrl
63+
issueTrackerUrl = 'https://github.com/kirich1409/Android-Notification-DSL/issues'
64+
vcsUrl = gitRepoUrl
65+
licenses = ['Apache-2.0']
66+
labels = ['android', 'notification', 'kotlin dsl', 'declarative']
67+
// publish true
68+
publicDownloadNumbers = true
69+
70+
githubRepo = 'kirich1409/Android-Notification-DSL' //Optional Github repository
71+
githubReleaseNotesFile = 'README.md' //Optional Github readme file
72+
73+
version {
74+
name = project.version
75+
desc = 'API for declarative Notification creation'
76+
released = new Date()
77+
}
78+
}
79+
}
80+

media/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: "io.gitlab.arturbosch.detekt"
4+
apply from: 'publish.gradle'
45

56
detekt {
67
failFast = true

media/publish.gradle

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
group = 'com.kirich1409.android-notification-dsl'
2+
version = rootProject.ext.androidNotificationDslVersion
3+
4+
apply plugin: 'com.jfrog.bintray'
5+
apply plugin: 'maven-publish'
6+
7+
def siteUrl = 'https://github.com/kirich1409/Android-Notification-DSL'
8+
def gitRepoUrl = 'https://github.com/kirich1409/Android-Notification-DSL.git'
9+
10+
tasks.register('sourceJar', Jar) {
11+
from android.sourceSets.main.java.srcDirs
12+
classifier "sources"
13+
}
14+
15+
afterEvaluate {
16+
publishing {
17+
publications {
18+
releaseAar(MavenPublication) {
19+
from components.release
20+
artifact(sourceJar)
21+
22+
groupId = 'com.kirich1409.android-notification-dsl'
23+
artifactId = 'media'
24+
version = project.version
25+
26+
pom {
27+
name = 'Media Android Notifcation DSL'
28+
description = 'Media extentions for Android Notifcation DSL'
29+
url = siteUrl
30+
licenses {
31+
license {
32+
name = 'The Apache License, Version 2.0'
33+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
34+
}
35+
}
36+
developers {
37+
developer {
38+
id = 'kirich1409'
39+
name = 'Kirill Rozov'
40+
email = 'krl.rozov@gmail.com'
41+
}
42+
}
43+
scm {
44+
url = gitRepoUrl
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
51+
52+
bintray {
53+
user = project.hasProperty('user') ? project.property('user') : System.getenv('BINTRAY_USER')
54+
key = project.hasProperty('apiKey') ? project.property('apiKey') : System.getenv('BINTRAY_API_KEY')
55+
56+
publications = ["releaseAar"]
57+
58+
pkg {
59+
repo = 'maven'
60+
name = 'android-notification-dsl-media'
61+
desc = 'Media extentions for Android Notifcation DSL'
62+
websiteUrl = siteUrl
63+
issueTrackerUrl = 'https://github.com/kirich1409/Android-Notification-DSL/issues'
64+
vcsUrl = gitRepoUrl
65+
licenses = ['Apache-2.0']
66+
labels = ['android', 'notification', 'kotlin dsl', 'declarative']
67+
// publish true
68+
publicDownloadNumbers = true
69+
70+
githubRepo = 'kirich1409/Android-Notification-DSL' //Optional Github repository
71+
githubReleaseNotesFile = 'README.md' //Optional Github readme file
72+
73+
version {
74+
name = project.version
75+
desc = 'Media extentions for Android Notifcation DSL'
76+
released = new Date()
77+
}
78+
}
79+
}
80+

0 commit comments

Comments
 (0)