Skip to content

Allow running Gradle tasks with -PskipKodex to publish locally faster #1034

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

Merged
merged 1 commit into from
Jan 29, 2025
Merged
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
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ This library is built with Gradle.
things up during development.
* Make sure to pass the extra parameter `-Pkotlin.dataframe.debug=true` to enable debug mode. This flag will
make sure some extra checks are run, which are important but too heavy for production.
* The parameter `-PskipKodex` allows you to skip [kdoc processing](KDOC_PREPROCESSING.md),
making local publishing faster: `./gradlew publishToMavenLocal -PskipKodex`.
This, however, publishes the library with "broken" KDocs,
so it's only meant for faster iterations during development.

You can import this project into IDEA, but you have to delegate the build actions
to Gradle (in Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Runner)
Expand Down
2 changes: 2 additions & 0 deletions KDOC_PREPROCESSING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ This can be seen in action in the `core:processKDocsMain` and `core:changeJarTas
`processKDocsMain` task is executed first, which processes the KDocs in the source files and writes them to the
`generated-sources` folder. The `changeJarTask` task then makes sure that any `Jar` task in the `core` module uses the
`generated-sources` folder as the source directory instead of the normal `src` folder.
It's possible to optionally skip this step, for example, when you publish the library locally during development,
by providing the `-PskipKodex` project property: `./gradlew publishToMavenLocal -PskipKodex`

`core:processKDocsMain` can also be run separately if you just want to see the result of the KDoc processing by KoDEx.

Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ idea {
// the target of `processKdocMain`, and they are returned to normal afterward.
// This is usually only done when publishing
val changeJarTask by tasks.creating {
outputs.upToDateWhen { false }
outputs.upToDateWhen { project.hasProperty("skipKodex") }
doFirst {
tasks.withType<Jar> {
doFirst {
Expand Down Expand Up @@ -266,7 +266,7 @@ tasks.withType<Jar> {

// modify all publishing tasks to depend on `changeJarTask` so the sources are swapped out with generated sources
tasks.configureEach {
if (name.startsWith("publish")) {
if (!project.hasProperty("skipKodex") && name.startsWith("publish")) {
dependsOn(processKDocsMain, changeJarTask)
}
}
Expand Down