forked from RikkaApps/Shizuku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gradle-mavenizer.gradle
56 lines (47 loc) · 1.76 KB
/
gradle-mavenizer.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
if (!rootProject.file('gradle-maven-plugin/gradle-mavenizer.gradle').exists()) {
return
}
apply plugin: 'maven-publish'
apply from: project.rootProject.file('gradle-maven-plugin/utils.gradle')
apply from: project.rootProject.file('gradle-maven-plugin/artifact-javadoc-handler.gradle')
apply from: project.rootProject.file('gradle-maven-plugin/artifact-pom-manager.gradle')
project.afterEvaluate {
publishing {
publications {
mavenPublish(MavenPublication) {
if (isAndroidProject()) {
artifact bundleReleaseAar
artifact androidJavadocsJar
artifact androidSourcesJar
} else {
artifact jar
artifact sourcesJar
artifact javadocJar
}
decoratePom(pom)
}
}
repositories {
def isToRemoteRepo = getBooleanProperty("mavPublishToRemoteRepo")
def isToInternalRepo = getBooleanProperty("mavPublishToInternalRepo")
def isToMavenLocal = getBooleanProperty("mavPublishToMavenLocal")
if (isToRemoteRepo) {
maven {
credentials {
username getStringProperty("mavRemoteRepoUser")
password getStringProperty("mavRemoteRepoPassword")
}
url = getStringProperty("mavRepoRemoteUrl")
}
}
if (isToInternalRepo) {
maven {
url = getStringProperty("mavRepoInternalUrl")
}
}
if (isToMavenLocal || (!isToInternalRepo && !isToRemoteRepo)) {
mavenLocal()
}
}
}
}