-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpublish.gradle
More file actions
78 lines (69 loc) · 2.19 KB
/
publish.gradle
File metadata and controls
78 lines (69 loc) · 2.19 KB
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
Properties properties = new Properties()
if (project.rootProject.file("local.properties").exists()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
}
afterEvaluate {
publishing {
repositories {
maven {
url = "s3://maven-bandyer/releases/"
credentials(AwsCredentials) {
accessKey = properties.getProperty("maven.accessKey")
secretKey = properties.getProperty("maven.secretKey")
}
}
}
publications {
release(MavenPublication) {
from components.release
groupId = moduleGroupId
artifactId = project.getName()
version = moduleVersion
artifact kdocJar
artifact sourcesJar
}
}
}
}
task invalidateCache(type: Exec) {
workingDir '../scripts'
def publishPath = "releases"
def packageName = moduleGroupId + "." + project.getName()
commandLine 'python3', './invalidate_s3_cache.py', properties.getProperty("maven.accessKey") ?: "", properties.getProperty("maven.secretKey") ?: "", properties.getProperty("maven.distributionId") ?: "", publishPath, packageName, moduleVersion
}
task publishUpload {
def dryRun = true
def publishTask = 'publishToMavenLocal'
if (!dryRun) publishTask = 'publish'
dependsOn publishTask
dependsOn 'invalidateCache'
tasks.findByName('invalidateCache').mustRunAfter publishTask
}
dokkaHtml {
outputDirectory.set(file("$buildDir/kDoc"))
moduleName.set(project.getName())
dokkaSourceSets {
configureEach {
jdkVersion.set(8)
suppressInheritedMembers.set(true)
reportUndocumented.set(true)
skipEmptyPackages.set(true)
}
}
}
task dokkaDoc() {
file("$buildDir/kDoc").deleteDir()
dependsOn dokkaHtml
}
task kdocJar(type: Jar, dependsOn: dokkaDoc) {
archiveClassifier.set("javadoc")
from "$buildDir/kDoc"
}
task sourcesJar(type: Jar) {
archiveClassifier.set("sources")
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives kdocJar
archives sourcesJar
}