Skip to content

Conversation

@maksym-moroz
Copy link

Gradle stuff

Copy link
Collaborator

@stefankoppier stefankoppier left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

`maven-publish`
}

val javadocJar = tasks.named<Jar>("javadocJar")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can javadocJar and emptyJar be inlined?

import org.gradle.api.Project
import kotlin.math.max

internal fun Project.halfWorkerCount() = max(gradle.startParameter.maxWorkerCount, 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I read the documentation correctly, gradle.startParameter.maxWorkerCount defaults to the number of processors (the same as the original API used), but that's not half ;)


private fun Project.registerDocumentationArtifacts() {
val dokkaHtml = tasks.named("dokkaGeneratePublicationHtml", DokkaGeneratePublicationTask::class.java)
tasks.register("javadocJar", Jar::class.java) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
tasks.register("javadocJar", Jar::class.java) {
tasks.register<Jar>("javadocJar") {

dependsOn(dokkaHtml)
}

tasks.register("emptyJar", Jar::class.java) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
tasks.register("emptyJar", Jar::class.java) {
tasks.register<Jar>("emptyJar") {

}

private fun Project.configureTests() {
tasks.withType(Test::class.java).configureEach {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
tasks.withType(Test::class.java).configureEach {
tasks.withType<Test>().configureEach {

# Gradle properties are not passed to included builds https://github.com/gradle/gradle/issues/2534
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=true
Copy link
Collaborator

@stefankoppier stefankoppier Nov 10, 2025

Choose a reason for hiding this comment

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

Cool! I didn't know about org.gradle.configureondemand yet.

`maven-publish`
}

val javadocJar = tasks.named<Jar>("javadocJar")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can these be inlined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants