-
-
Notifications
You must be signed in to change notification settings - Fork 7
chore(gradle): build-logic; convention plugins; build file cleanup #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
stefankoppier
left a comment
There was a problem hiding this 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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| tasks.register("javadocJar", Jar::class.java) { | |
| tasks.register<Jar>("javadocJar") { |
| dependsOn(dokkaHtml) | ||
| } | ||
|
|
||
| tasks.register("emptyJar", Jar::class.java) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| tasks.register("emptyJar", Jar::class.java) { | |
| tasks.register<Jar>("emptyJar") { |
| } | ||
|
|
||
| private fun Project.configureTests() { | ||
| tasks.withType(Test::class.java).configureEach { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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 |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be inlined?
Gradle stuff