Refactor build scripts#623
Open
AbdullinAM wants to merge 4 commits into
Open
Conversation
The core library uses the ktfmt Gradle plugin to check its own formatting, substituting the plugin's ktfmt dependency with the locally-built jar. This creates a circular dependency: building the jar requires the format check, but the check requires the jar. Override the plugin's task ordering so ktfmtChecks runs after jar, and clear the mustRunAfter on compileKotlin.
e69f674 to
90ce6e5
Compare
hick209
approved these changes
Jun 4, 2026
Contributor
hick209
left a comment
There was a problem hiding this comment.
Mostly good, just one nit
Comment on lines
+42
to
+65
| """ | ||
| /* | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * 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 | ||
| * | ||
| * http://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 com.facebook.ktfmt.util | ||
|
|
||
| object Ktfmt { | ||
| ${properties.toList().joinToString("\n") { " const val ${it.first} = \"${it.second}\"" }} | ||
| } | ||
| """ | ||
| .trimIndent() |
Contributor
There was a problem hiding this comment.
What's up with the indent here? Is it not covered by ktfmt? If so, could you update it so that changes?
Author
There was a problem hiding this comment.
Yes, for some reason ktfmt accept this formatting. I'll update it manually
Contributor
There was a problem hiding this comment.
Oh, I know why!
It uses interpolation, so we cannot adjust the indent without risking messing up with the result.
You could extract the interpolation to add it after the trimIndent() or something like that if you want ktfmt to take care of the formatting.
* Update to latest Dokka and switch to the new default V2 plugin * Migrate to new Dokka-Javadoc plugin * Fix unresolved links in the KDocs
90ce6e5 to
170ecc1
Compare
|
@hick209 has imported this pull request. If you are a Meta employee, you can view this in D107664494. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several fixes related to the build configuration of the project:
./gradlew buildGenerateKtfmtFilePluginplugin that replacesgen_version_file.shEach commit is relatively independent, but mostly changes the same files. So I didn't split this into separate PRs for now, but can do so if necessary.
Fixes #621