-
Notifications
You must be signed in to change notification settings - Fork 1
/
kotlin_maven_push.gradle
59 lines (53 loc) · 1.46 KB
/
kotlin_maven_push.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
apply plugin: "com.vanniktech.maven.publish"
apply plugin: 'org.jetbrains.dokka'
allprojects {
plugins.withId("com.vanniktech.maven.publish") {
mavenPublish {
sonatypeHost = "S01"
}
}
}
//def dokkaOutputDir = "$buildDir/javadoc"
//
//tasks.named("dokkaHtml") {
// outputDirectory.set(new File(dokkaOutputDir))
// offlineMode.set(true)
//}
//
//tasks.named("dokkaJavadoc") {
// outputDirectory.set(new File(dokkaOutputDir))
// offlineMode.set(true)
//}
//
//task javadocJar(type: Jar, dependsOn: tasks.named("dokkaHtml")) {
// classifier('javadoc')
// from dokkaOutputDir
//}
//
//tasks.publish.dependsOn(javadocJar)
//tasks.publishToMavenLocal.dependsOn(javadocJar)
task javadoc(type: Javadoc) {
// Exclude generated files
exclude '**/BuildConfig.java'
exclude '**/R.java'
source = android.sourceSets.main.java.srcDirs
failOnError false
classpath += configurations.compile
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
title POM_NAME
}
}
tasks.publish.dependsOn(javadocJar)
tasks.publishToMavenLocal.dependsOn(javadocJar)