Add dummy javadoc to pkl-tools

This commit is contained in:
Dan Chao
2024-02-01 19:23:35 -08:00
parent 4676f379f9
commit c0959fb3e2
2 changed files with 45 additions and 5 deletions

View File

@@ -7,12 +7,9 @@ plugins {
signing
}
val firstPartySourcesJars by configurations.existing
val dummy: SourceSet by sourceSets.creating
java {
// create an empty javadoc jar so Maven Central is happy
withJavadocJar()
}
val firstPartySourcesJars by configurations.existing
// Note: pkl-tools cannot (easily) contain pkl-config-kotlin
// because pkl-tools ships with a shaded Kotlin stdlib.
@@ -37,6 +34,21 @@ dependencies {
firstPartySourcesJars(project(":pkl-doc", "sourcesJar"))
}
// TODO: need to figure out how to properly generate javadoc here.
// For now, we'll include a dummy javadoc jar.
val javadocDummy by tasks.creating(Javadoc::class) {
source = dummy.allJava
}
java {
withJavadocJar()
}
val javadocJar by tasks.existing(Jar::class) {
from(javadocDummy.outputs.files)
archiveBaseName.set("pkl-tools-all")
}
tasks.shadowJar {
archiveBaseName.set("pkl-tools-all")
}
@@ -46,6 +58,10 @@ publishing {
named<MavenPublication>("fatJar") {
// don't use `-all` suffix because this is the only JAR we publish
artifactId = "pkl-tools"
// add dummy javadoc jar to publication
artifact(javadocJar.flatMap { it.archiveFile }) {
classifier = "javadoc"
}
pom {
url.set("https://github.com/apple/pkl/tree/main/pkl-tools")
description.set("Fat Jar containing pkl-cli, pkl-codegen-java, " +

View File

@@ -0,0 +1,24 @@
/**
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pkl.tools;
/**
* This is an intentionally empty class.
*/
// TODO: figure out how to generate javadoc for a shadow jar.
@SuppressWarnings("unused")
public class Empty {
}