Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions gradle/java_no_deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,14 @@ tasks.withType(Javadoc).configureEach {

options.addStringOption('Xdoclint:none', '-quiet')

doFirst {
if (project.ext.has("apiLinks")) {
options.links(*project.apiLinks)
def apiLinks = providers.provider {
project.ext.has('apiLinks') ? project.ext.get('apiLinks').collect { it.toString() } : []
}
inputs.property('apiLinks', apiLinks)
doFirst { Javadoc task ->
def links = apiLinks.get()
if (!links.isEmpty()) {
task.options.links(*links)
Comment on lines +217 to +224

@bric3 bric3 Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Do we use the javadoc api links ?

}
}
}
Expand Down
42 changes: 20 additions & 22 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,21 @@ publishing {
publication.artifact sourcesJar
publication.artifact javadocJar

afterEvaluate {
/**
* Add all the project dependencies, but set as compile instead of runtime
* (which is what project.shadow.component(publication) would use).
*/
publication.pom { org.gradle.api.publish.maven.MavenPom pom ->
pom.withXml { xml ->
def dependenciesNode = xml.asNode().appendNode('dependencies')

project.configurations.api.allDependencies.each {
if (it instanceof ProjectDependency || it instanceof ExternalModuleDependency) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
dependencyNode.appendNode("scope", "compile")
}
}
}
// Publish API dependencies with compile scope.
def apiDependencies = providers.provider {
project.configurations.api.allDependencies
.findAll { it instanceof ProjectDependency || it instanceof ExternalModuleDependency }
.collect { [group: it.group, name: it.name, version: it.version] }
}
publication.pom.withXml { xml ->
def dependenciesNode = xml.asNode().appendNode('dependencies')

apiDependencies.get().each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
dependencyNode.appendNode("scope", "compile")
}
}
} else {
Expand All @@ -64,14 +60,16 @@ if (project.plugins.hasPlugin('com.gradleup.shadow')) {
}
}

def signingKey = providers.environmentVariable("GPG_PRIVATE_KEY")
def signingPassword = providers.environmentVariable("GPG_PASSWORD")
signing {
useInMemoryPgpKeys(providers.environmentVariable("GPG_PRIVATE_KEY").orNull, providers.environmentVariable("GPG_PASSWORD").orNull)
useInMemoryPgpKeys(signingKey.orNull, signingPassword.orNull)
sign publishing.publications.maven
}

tasks.withType(Sign).configureEach {
// Only sign in Gitlab CI
onlyIf { isGitlabCI || (providers.environmentVariable("GPG_PRIVATE_KEY").isPresent() && providers.environmentVariable("GPG_PASSWORD").isPresent()) }
def signPublication = isGitlabCI || (signingKey.isPresent() && signingPassword.isPresent())
onlyIf { signPublication }
}

/**
Expand Down