-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle
131 lines (116 loc) · 3.9 KB
/
build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
version_name = '4.3.3'
}
}
plugins {
id 'com.android.library' version '7.4.1' apply false
alias libs.plugins.refine apply false
}
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
}
subprojects {
afterEvaluate { project ->
if (!plugins.hasPlugin('maven-publish')) {
return
}
if (project.parent == rootProject) {
group = "${groupIdBase}"
} else {
group = "${groupIdBase}.${project.parent.name}"
}
version = version_name
println("${project.displayName}: ${group}:${project.name}:${version}")
publishing {
publications {
mavenJava(MavenPublication) {
group project.group
artifactId project.name
version version_name
afterEvaluate {
from components.release
}
pom {
name = POM_NAME
description = POM_DESCRIPTION
url = POM_URL
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
}
}
developers {
developer {
name = POM_DEVELOPER_NAME
url = POM_DEVELOPER_URL
}
}
scm {
connection = POM_SCM_CONNECTION
url = POM_SCM_URL
}
}
}
}
repositories {
maven {
name 'ossrh'
url 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials(PasswordCredentials)
}
}
}
}
afterEvaluate {
if (!plugins.hasPlugin('signing')) {
return
}
android {
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
def secretKeyRingFile = findProperty("signing.secretKeyRingFile")
/*if (secretKeyRingFile != null && file(secretKeyRingFile).exists()) {
sign publishing.publications
} else if (signingKey != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
}*/
useGpgCmd()
sign configurations.archives
sign publishing.publications.mavenJava
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
groupIdBase = "dev.rikka.hidden"
POM_INCEPTION_YEAR = "2022"
POM_PACKAGING = "aar"
POM_URL = "https://github.com/RikkaW/HiddenApi"
POM_SCM_URL = "https://github.com/RikkaW/HiddenApi"
POM_SCM_CONNECTION = "scm:git@github.com:RikkaW/HiddenApi.git"
POM_SCM_DEV_CONNECTION = "scm:git@github.com:RikkaW/HiddenApi.git"
POM_LICENCE_NAME = "MIT License"
POM_LICENCE_URL = "https://github.com/RikkaW/HiddenApi/blob/master/LICENSE"
POM_LICENCE_DIST = "repo"
POM_DEVELOPER_ID = "rikka"
POM_DEVELOPER_NAME = "Rikka"
POM_DEVELOPER_URL = "https://github.com/RikkaW"
}