Skip to content
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

[Build] Update Kotlin to 1.9.22 #146

Merged
merged 3 commits into from
Jul 5, 2024
Merged

Conversation

ParaskP7
Copy link
Contributor

@ParaskP7 ParaskP7 commented Jul 5, 2024

Required By: #148

This PR updates Kotlin to 1.9.22.

Description

This update isn't that necessary, but should be considered anyway as it will do the following:

  • Align this library, to that Kotlin version, which is already used by most of this library's clients and libraries.
  • Unblock the usage of the Dependency Analysis Gradle plugin for this project.
  • Prepares this project for the Kotlin 2+ major update.

Test

  • There is nothing much to test here.
  • Verifying that all the CI checks are successful should be enough.
  • However, if you want to be thorough about reviewing this change, you could:
    • Quickly smoke test, either the JP/WPAndroid and/or WCAndroid apps, with this version of Utils, or via composite builds, and see if it works as expected.
    • Test for build time increases (local & CI).

This update isn't that necessary, but should be considered anyway as it
will do the following:
- Align this library, to that Kotlin version, which is already used by
most of this library's clients and libraries.
- Unblock the usage of the dependency analysis Gradle plugin for this
project.
- Prepares this project for the Kotlin 2+ major update.
This change is necessary because otherwise the build fails with the
below exception:

------------------------------------------------------------------------

> Task :WordPressUtils:compileDebugKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':WordPressUtils:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks
 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

  Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
  Learn more about JVM-target validation: https://kotl.in/gradle/jvm/
   target-validation
Copy link

@wzieba wzieba left a comment

Choose a reason for hiding this comment

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

Do you think it's worth to add dependency analysis to this project? It has a very little number of dependencies and is not actively developed.

This PR LGTM 👍

@ParaskP7
Copy link
Contributor Author

ParaskP7 commented Jul 5, 2024

Just like we discussed the day before, I was indeed thinking about it @wzieba , but decided to go for it. I chose in the end to go for it because this library is used as composite build for at least JP/WPAndroid, used as a dependency on all, FluxC, JP/WPAndroid and WCAndroid, plus get some contribution here-and-there from time to time, and in general it has been discussed from time to time about properly supporting this library and not letting it be on it's own... 🤷


In the end, I think I decided to at least add Dependency Analysis to all the libraries that are at least used as composite builds for either JP/WPAndroid, WCAndroid, or both, those are:

  • Login
  • Utils
  • Media Picker
  • Aztec (+DOAndroid)
  • About
  • Tracks

I think for this initial phase of introducing the new Dependency Analysis process it would be enough to start with those 6 libraries and these 4 clients that we are already tracking:

  • WCAndroid
  • JP/WPAndroid
  • DOAndroid
  • PCAndroid

And with that, I think we can stop, gather some initial feedback on the overall end-to-end process and keep adding more clients/libraries when and if needed, on demand. Wdyt? 🤔

@ParaskP7
Copy link
Contributor Author

ParaskP7 commented Jul 5, 2024

It has a very little number of dependencies...

I don't think this should matter too much, even one extra dependency or dependency misconfiguration can cause some trouble. Obviously, more of those could increase the risk of getting into trouble, but that doesn't mean having one of those there is risk, or at least maintenance free.

My goal with this plugin is to help us remove all those unused dependencies and then restrict each project to not allow any more unused dependencies from thereafter.

...and is not actively developed.

Btw, I think all those 6 libraries are (kind of) actively developed (from time to time), it is just that they are not being continuously developed.

@wzieba
Copy link

wzieba commented Jul 5, 2024

I don't see dependency-analysis-gradle-plugin printing anything troubling that could cause problems for projects that use the library, but if you think it's worth to keep such metrics for this and other libraries, I'm ok with it 👍

@ParaskP7
Copy link
Contributor Author

ParaskP7 commented Jul 5, 2024

Out of curiosity @wzieba , out of these 6 below libraries, where would you use the Dependency Analysis and why? This will help me understand how you are thinking about this plugin and its usefulness.

  • Login
  • Utils
  • Media Picker
  • Aztec (+DOAndroid)
  • About
  • Tracks

For example, for me, at this point, it is all about the maintainability of these libraries and me hoping that this plugin will give us advises that in time (when needed) will help us move forward, clean-up or fine-tune any dependencies.

@ParaskP7 ParaskP7 merged commit ba2227b into trunk Jul 5, 2024
8 checks passed
@ParaskP7 ParaskP7 deleted the build/update-kotlin-to-1.9.22 branch July 5, 2024 14:05
@wzieba
Copy link

wzieba commented Jul 5, 2024

Frankly, I'd skip all the library projects (except FluxC due to its size and frequency of development). I think this plugin is very useful in case of large set of dependencies - removing unused dependencies and applying more fitting configurations can help in developer's experience.

I'm concerned that with the library projects that are developed rarely and are small, the difference we'll gain from improving dependency configuration will be minimal and metrics we'll get from them will be mostly flat line.

@ParaskP7
Copy link
Contributor Author

ParaskP7 commented Jul 5, 2024

Got it, thanks, I think that I now understand more where you're coming from (I agree). 💯

To me, additional to your expectation(s):

  • This plugin will provide the data for each of those libraries, the "build health" data, at least the "unused count" data initially, that we can act upon. Without this data being there, we would never know what can be done to improve a project build's health and why. 📉
  • Then, it will provide the mechanism to not allow deteriorating of the "build health" any further. For example, when you manage to remove all the unused dependencies, we can instruct the plugin to not allow any further unused dependencies into the projects any more. Then, any dev that removes some code, or update one feature with another, would need to also make sure to remove the unused dependency and not letting it hang there indefinitely. 🤞

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

Successfully merging this pull request may close these issues.

2 participants