forked from billmoyers/PdfiumAndroid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.gradle
41 lines (36 loc) · 1.23 KB
/
publish.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
apply plugin: 'maven-publish'
afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
groupId = project.findProperty("library.groupId")
artifactId = project.findProperty("library.artifactId")
version = project.findProperty("library.version") + versionSuffix()
artifact("$buildDir/outputs/aar/PdfiumAndroid-release.aar")
artifact androidSourcesJar
}
}
repositories {
maven {
name = "GitHubPackages"
def repository = project.findProperty("library.repository")
url = uri("https://maven.pkg.github.com/PicPay/" + repository)
credentials {
username = System.getenv("GITHUB_USER")
password = System.getenv("GITHUB_USER_TOKEN")
}
}
}
}
}
task androidSourcesJar(type: Jar) {
getArchiveClassifier().set('sources')
from android.sourceSets.main.java.srcDirs
}
static def versionSuffix() {
def sufix = System.getenv("VERSION_SUFIX") ?: ''
if (sufix != '') {
sufix = "$sufix-${new Date().format('yyyyMMddHHmmss')}"
}
return sufix
}