forked from TheWidlarzGroup/react-native-video
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Upgrade Gradle to 7.4 & AGP to 7.1.1 (& Disable Jetifier & Dependency Removal) #18
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7961edc
Build: Update gradle to 7.3.3 for android exoplayer project
ParaskP7 602c830
Build: Update agp to 7.0.4 for android exoplayer project
ParaskP7 eae00e7
Build: Update gradle to 7.3.3 for android project
ParaskP7 dda5684
Build: Update agp to 7.0.4 for android project
ParaskP7 018921e
Build: Update gradle to 7.4 for android exoplayer project
ParaskP7 4a490a9
Build: Update agp to 7.1.1 for android exoplayer project
ParaskP7 1546e6a
Build: Update gradle to 7.4 for android project
ParaskP7 e6eef39
Build: Update agp to 7.1.1 for android project
ParaskP7 9b0a575
Build: Disable jetifier for android exoplayer project
ParaskP7 12c932b
Build: Disable jetifier for android project
ParaskP7 e8f82d0
Build: Bump version to 5.2.0-wp-3
ParaskP7 669b5ec
Build: Generate new tarball for 5.2.0-wp-3
ParaskP7 cb5181f
Build: Remove incorrect and as such unused okhttp dependency declaration
ParaskP7 bfb0880
Build: Generate new tarball for 5.2.0-wp-3
ParaskP7 9a599f2
Set jitpack jdk to openjdk11
oguzkocer 4fa6833
Build: Add back incorrect and as such unused okhttp dep declaration
ParaskP7 b1bff8b
Build: Guard incorrect and as such unused http dependency declaration
ParaskP7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the better fix here be to just change this to double-quotes? We could also do a PR to push this fix upstream, we're not the first to notice it: TheWidlarzGroup@3dc607c.
Just for reference: here is the PR adding this line to react-native-video: TheWidlarzGroup#2340
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @mchowning !
Thanks for the response! 🥇
I actually tried that but it doesn't work as the
OKHTTP_VERSION
is not available, it only resides within the RNnote module
. Thus, the build failed when I tried.My question is if we actually need this dependency, since we are able to build even without it. 🤔
We can try doing that, yes. 👍
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point. We could always wrap this in a
project.hasProperty(...)
, but keeping it simple here by just removing it also seems fine since we obviously haven't needed it.If you want to go with the "removal" approach you have here, I'm curious if you have any thoughts about possibly commenting out this line and adding a comment describing why it is being commented out. We generally try to keep these forks as close to the source as possible, and I'm thinking it might be hard for someone to backtrack and figure out why we removed this line when the inevitable conflict on this line arises in the future. I don't feel strongly, I'm more just thinking out loud, so let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It builds without this dependency because
okhttp
is a transitive dependency ofcom.facebook.fresco:imagepipeline
. If this project is usingokhttp
directly, we should keep it and use the version we want. If the project is not using it directly, it should be fine to remove it as whichever dependency needs it should also have it in its pom file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @mchowning @oguzkocer !
Thank you so much for your input! 🙏
This is a good idea. 👍
Yes, this is a good argument, on keeping the forks as close to the source as possible, I agree. 👍
Yes, actually after running
./gradlew dependencies
and checking the before and after result,com.squareup.okhttp3:okhttp-urlconnection
is also usingokhttp
as a transitive dependency, as the wholeandroidx.appcompat:appcompat
dependency itself.I also did a quick analysis, using
./gradlew dependencies
, a before and after diff for the removal of the explicit'com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}'
dependency and the only diff I found are the below line, which is found twice on the top level and thecom.facebook.react:react-native:0.66.2
tree:This makes me think that:
${OKHTTP_VERSION}
is being hardcoded and doesn't change to theOKHTTP_VERSION=3.12.12
as defined by thegradle.properties
of theReactAndroid
project. Thus, it seems to me that Gradle just ignores while building and then Lint produces theIncorrect Interpolation
error.Incorrect Interpolation
error, the end result of building the project is the same. However, this is solely based on building and linting this project individually. If, for some reason, unknown to me due to my lack of React Native experience, when this project is build and used in combination with theReactAndroid
project, it might actually do some code-generation magic to substitute thisOKHTTP_VERSION
version with the actual version to produce the final result. Thus, then I would no longer feel comfortable removing this dependency.Good thinking. 🥇
From what I am seeing this project is using a couple of
okhttp3
imports within theDataSourceUtil
, which makes me think, just to be on the safe side, since I am not having much React Native experience, to keep this dependency and suppress thisIncorrect Interpolation
Lint error to avoid future such discussions and have Lint success no matter. Wdyt? 🤔Commit here: 4fa6833
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't quite feel right to me since we're suppressing a lint warning that is highlighting the fact that this line of code doesn't actually do anything. I don't feel super-strongly, but in light of @oguzkocer 's comment noting that the build only succeeds because okhttp is a transitive dependency (thanks for pointing that out btw), I'd lean toward fixing this with the
project.hasProperty(...)
wrapper and then switching to using double quotes. That way we can set that variable and actually use it if we want to, and it will be more informative to any developer that bumps into this issue in the future.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @mchowning !
Yes, I think this is better. The only reason I didn't proceed with this change is because you mentioned that we generally try to keep these forks as close to the source as possible and I wasn't sure If I should proceed with this change.
Please expect me applying this change today. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now done: b1bff8b