@@ -19,39 +19,43 @@ def license_name = 干.prop('base/maven', "${license}_name")
19
19
def license_url = 干. prop(' base/maven' , " ${ license} _url" )
20
20
def license_comments = 干. prop(' base/maven' , " ${ license} _comments" )
21
21
22
- java {
23
- withJavadocJar()
24
- withSourcesJar()
25
- }
22
+ boolean isKMP = project. pluginManager. hasPlugin(' org.jetbrains.kotlin.multiplatform' )
23
+ if (! isKMP) {
24
+ java {
25
+ withJavadocJar()
26
+ withSourcesJar()
27
+ }
26
28
27
- tasks. named(' sourcesJar' ) {
28
- dependsOn ' jar'
29
- }
29
+ tasks. named(' sourcesJar' ) {
30
+ dependsOn ' jar'
31
+ }
30
32
31
- javadoc {
32
- def makeLink = { url , text -> " <a href=\" ${ url} \" style=\" text-transform: none;\" >${ text} </a>" }
33
- def javadocInfo = ' <h2>' + makeLink(" https://${ git_url} " , " ${ maven_artifact} :${ version} " ) +
34
- ' by ' + makeLink(' https://www.diffplug.com' , ' DiffPlug' ) + ' </h2>' ;
35
- // Where it's possible to name parameters and methods clearly enough
36
- // that javadoc is not necessary, why make the code bigger?
37
- // Thus, no javadoc warnings.
38
- options. addStringOption(' Xdoclint:none' , ' -quiet' )
39
- // UTF-8!!! Thanks to: https://github.com/freefair/gradle-plugins/blob/6d6f5ff6036e7da1c329075a02c6452c0bb669be/maven-plugin/src/main/java/io/freefair/gradle/plugins/maven/javadoc/JavadocUtf8Plugin.java
40
- options. charSet(' UTF-8' );
41
- options. docEncoding(' UTF-8' );
42
- options. setEncoding(' UTF-8' );
43
- // setup the header
44
- options. header javadocInfo
45
- options. footer javadocInfo
46
- // setup links
47
- options. links(javadocLinks)
33
+ javadoc {
34
+ def makeLink = { url , text -> " <a href=\" ${ url} \" style=\" text-transform: none;\" >${ text} </a>" }
35
+ def javadocInfo = ' <h2>' + makeLink(" https://${ git_url} " , " ${ maven_artifact} :${ version} " ) +
36
+ ' by ' + makeLink(' https://www.diffplug.com' , ' DiffPlug' ) + ' </h2>' ;
37
+ // Where it's possible to name parameters and methods clearly enough
38
+ // that javadoc is not necessary, why make the code bigger?
39
+ // Thus, no javadoc warnings.
40
+ options. addStringOption(' Xdoclint:none' , ' -quiet' )
41
+ // UTF-8!!! Thanks to: https://github.com/freefair/gradle-plugins/blob/6d6f5ff6036e7da1c329075a02c6452c0bb669be/maven-plugin/src/main/java/io/freefair/gradle/plugins/maven/javadoc/JavadocUtf8Plugin.java
42
+ options. charSet(' UTF-8' );
43
+ options. docEncoding(' UTF-8' );
44
+ options. setEncoding(' UTF-8' );
45
+ // setup the header
46
+ options. header javadocInfo
47
+ options. footer javadocInfo
48
+ // setup links
49
+ options. links(javadocLinks)
50
+ }
51
+ apply from : 干. file(' helper/javadoc-view.gradle' )
48
52
}
49
- apply from : 干 . file( ' helper/javadoc-view.gradle ' )
53
+
50
54
51
55
boolean isPlugin = plugins. hasPlugin(' java-gradle-plugin' )
52
56
publishing. publications. register(isPlugin ? ' pluginMaven' : ' mavenJava' , MavenPublication , {
53
57
artifactId = maven_artifact
54
- if (! isPlugin) {
58
+ if (! isPlugin && ! isKMP ) {
55
59
from components. java
56
60
}
57
61
pom {
0 commit comments