Skip to content

Build improvements#12706

Merged
Stypox merged 6 commits intodevfrom
buildImprovements
Oct 20, 2025
Merged

Build improvements#12706
Stypox merged 6 commits intodevfrom
buildImprovements

Conversation

@theimpulson
Copy link
Member

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Reverts non-required reproducible build hack
  • Migrates build scripts to Kotlin DSL
  • Migrates to use build version catalog to manage dependencies
  • Introduces script to sort dependencies order

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

This reverts commit 1db1a00.

The issue has been long resolved making this fix no longer required.
@github-actions github-actions bot added the size/giant PRs with more than 750 changed lines label Oct 15, 2025
@theimpulson
Copy link
Member Author

I have re-written the script to sort TOML file in Kotlin DSL as well while cherry-picking it from the refactor branch.

Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

as per #10927 (comment)

We should do an independent update to the lastest Gradle version first and then have a look if it's useful to migrate everything to Kotlin

@theimpulson
Copy link
Member Author

theimpulson commented Oct 15, 2025

as per #10927 (comment)

We should do an independent update to the lastest Gradle version first and then have a look if it's useful to migrate everything to Kotlin

I am not sure what that comment means in relation to latest Gradle version first and Kotlin migration. I picked the TOML change as it has been merged for a long time in the refactor branch and is the current default for new android projects similar to how Kotlin is the new default DSL and language for writing new projects which we want to have with compose migration.

Do you want me to bump the Gradle version to 9.1.0 in this PR as well?

@litetex
Copy link
Member

litetex commented Oct 15, 2025

I was expecting that the change related to archivesBaseName is due to Gradle 9 but it looks like I'm wrong here, so nevermind.

Do you want me to bump the Gradle version to 9.1.0 in this PR as well?

Well you can do that but it should be done independently so that things don't get mixed up here :)


I picked the TOML change as it has been merged for a long time in the refactor branch

I see... I was not around when this was merged. I think I will create a PR to revert this on the refactor branch.

current default for new android projects

Even though Google might have declared this as the "default" it might not be very useful here.
As I pointed out in my previous comment I find it catastrophic that I have to look in 3 different places to find the version of a dependency.

@theimpulson
Copy link
Member Author

Even though Google might have declared this as the "default" it might not be very useful here. As I pointed out in my previous comment I find it catastrophic that I have to look in 3 different places to find the version of a dependency.

I feel it is useful considering we do seem to want a compose multi-platform compatible NewPipe which will involve us introducing multiple modules per-platform, sooner or later, leading us to require a way to manage multiple dependencies and plugins.

Then there is also the logic of not following the changes done by Google because we don't like them leading us to have technical burden in future like today we have with Kotlin and Compose.

@Stypox
Copy link
Member

Stypox commented Oct 16, 2025

@litetex it's actually the opposite, now all versions are in a single file instead of spread over different sections of build.gradle and app/build.gradle. I am in favour of keeping version catalogs on the refactor branch, and also merging this PR. Also see #10927 (comment)

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Thank you!

How do you know the reproducible builds fix is not needed anymore?

Comment on lines +202 to +205
// WORKAROUND: if you get errors with the NewPipeExtractor dependency, replace `v0.24.3` with
// the corresponding commit hash, since JitPack sometimes deletes artifacts.
// If there’s already a git hash, just add more of it to the end (or remove a letter)
// to cause jitpack to regenerate the artifact.
Copy link
Member

Choose a reason for hiding this comment

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

This should reference libs.versions.toml

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed it as the comment mentions to replace version with hash but it has already been using hash.

Copy link
Member

Choose a reason for hiding this comment

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

Actually we keep switching back and forth, because when a new NewPipeExtractor version is released its tag works, but then at some point we need to use a development version of NPE or Jitpack stops providing artifacts for the tag, and so we have to switch to hashes.

Copy link
Member

Choose a reason for hiding this comment

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

I reverted this change in 300f5ab (#12684)

@theimpulson
Copy link
Member Author

Thank you!

How do you know the reproducible builds fix is not needed anymore?

As per the linked issue in the original commit, the fix has been shipped in AGP 8.1.0-alpha03 and we are using way newer version of AGP now.

@litetex
Copy link
Member

litetex commented Oct 16, 2025

@theimpulson

leading us to have technical burden in future like today we have with Kotlin and Compose

I can't quite follow on this. Could you clarify what you mean with that?

Specifying JDK toolchain in the java block lets us avoid specifying
same version again and again for different options while ensuring everything
is on the same version

Ref: https://developer.android.com/build/jdks#toolchain

Signed-off-by: Aayush Gupta <[email protected]>
@Stypox
Copy link
Member

Stypox commented Oct 20, 2025

Merging for now, despite the discussion in #10927 (comment) still not being concluded, in order not to block @theimpulson's other PRs. Since version catalogs have already been merged to refactor and the work has already been done, it wouldn't make sense to delay it further. We can always revert it later if more team members think we are better off without version catalogs, and the effort for reverting won't change if this PR is merged or not, since we'd have to revert it on refactor as well.

@Stypox Stypox merged commit c8e294b into dev Oct 20, 2025
5 checks passed
Stypox added a commit to TobiGr/NewPipe that referenced this pull request Oct 21, 2025
@theimpulson theimpulson deleted the buildImprovements branch October 21, 2025 13:26
Comment on lines +229 to +230
/** Third-party libraries **/
implementation(libs.livefront.bridge)
Copy link
Member

Choose a reason for hiding this comment

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

You missed this comment :-)

Suggested change
/** Third-party libraries **/
implementation(libs.livefront.bridge)
/** Third-party libraries **/
// Instance state boilerplate elimination
implementation(libs.livefront.bridge)

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

Labels

size/giant PRs with more than 750 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate project dependencies to using Version Catalogs

4 participants