forked from AgoraIO-Community/LrcView-Android
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpublishing.gradle
71 lines (59 loc) · 2.12 KB
/
publishing.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
afterEvaluate {
publishing {
repositories {
//it.mavenLocal()
it.maven {
url "${rootDir}/repo"
}
}
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
from components.release
groupId = mavenGroupId.toString()
artifactId = mavenArtifactId.toString()
version = android.defaultConfig.versionName
pom {
name = mavenArtifactId.toString()
description = mavenPomDescription.toString()
url = 'http://maven.apache.org'
licenses {
license {
name = 'AGORA SDK License'
url = 'https://github.com/AgoraIO/full-sdk/blob/master/LICENSE'
}
}
developers {
developer {
id = 'agora'
name = 'agora'
url = 'https://www.shengwang.cn/'
}
}
scm {
url = 'https://github.com/winskyan/Agora-Service-SDK.git'
}
}
}
}
}
signing {
sign publishing.publications.release
}
tasks.register('cleanFiles', Zip) {
delete("${rootDir}/mavenUpload")
delete("${rootDir}/repo")
}
tasks.register('zipFolderAndUpload', Zip) {
from "${rootDir}/repo" // 要压缩的文件夹路径
archiveFileName = "${mavenArtifactId.toString()}-${sdkVersion.toString()}.zip"
// 排除过滤器
exclude { FileTreeElement element ->
// 判断是文件夹且名称以指定字符串结尾
!element.isDirectory() && element.name.startsWith('maven-metadata')
}
destinationDirectory = file("${rootDir}/mavenUpload")
}
publish.dependsOn(cleanFiles)
publish.finalizedBy(zipFolderAndUpload)
}