Refactor build scripts#623
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
left a comment
There was a problem hiding this comment.
Mostly good, just one nit
| """ | ||
| /* | ||
| * 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() |
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?
There was a problem hiding this comment.
Yes, for some reason ktfmt accept this formatting. I'll update it manually
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. |
|
@hick209 Hey! Can you comment on the status of this PR? As far as I understand, the internal CI checks have faield (probably because I changed the build setup), so where do we go from here? |
|
Hey @AbdullinAM, sorry I went on a week-long vacation. I'm back today and will try to merge this now! |
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