-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update dependencies 04-2024 #63
Conversation
Release 1.3.2
Fix readme badges
Fix latest version in readme
First of all, always great to see the initiative 💪 But next time pls contact the library owner (in this case me) before starting work on it. Why? Because I was aware of issue and already made fixes #61 . My solution was in draft because I ran out of time and I actually contacted Google about desugaring changes. Using that as starting point could have save some time. A few more points:
If you want you can us my PR as starting point. I renamed duplicated resources a bit differently, your approach is probably better. |
plugins { | ||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' | ||
} | ||
|
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.
We had a conversation about this. I can't resolve toolchains so I have to use this as per documentation. I thought we could commit this maybe until this problem gets resolved [OPTIONAL].
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.
What is a problem with the toolchains?
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.
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.
Clear 👍
@@ -11,3 +15,5 @@ include ":tool-googleplay" | |||
include ":tool-appgallery" | |||
include ":tool-thimble" | |||
include ":tool-timber" | |||
|
|||
gradle.startParameter.excludedTaskNames.add(":buildSrc:testClasses") |
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.
Newest AS has this problem where you can't compile anything. AS is blaming Gradle and vice versa. We have commited this on our project as we are waiting for it to be fixed, so it should be ok here? [OPTIONAL]
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.
So this solves the issue? Test classes won't be compiled?
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.
No, test classes are still compiled 😄 . This only allows you to mitigate this weird bug new AS has.
https://issuetracker.google.com/issues/315023802
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.
RIP
@@ -1,6 +1,5 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
package="com.infinum.sentinel" |
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.
Package name inside of AndroidManifest is not supported anymore and we were getting errors/warnings, don't remember.
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.
We can set the namespace
in build.gradle files.
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.
I think you don't need to set namespace for tests (manifest for tests), gradle will just append .test by default https://developer.android.com/build/configure-app-module#change-namespace-for-testing
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.
Consider number of problems, maybe it makes more sense to just release a version without dependency updates, just with resources rename 🤷♂️
@@ -57,15 +57,17 @@ Then add the following dependencies in your app `build.gradle` or `build.gradle. | |||
**Groovy** | |||
|
|||
```groovy | |||
debugImplementation "com.infinum.sentinel:sentinel:1.3.1" | |||
releaseImplementation "com.infinum.sentinel:sentinel-no-op:1.3.1" | |||
def sentinelVersion = "1.3.2" |
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.
As the project already has 2 versions defined, would be good to go in a different direction than this and use a single version everywhere. On some libraries like PrinceOfVersions we have a gradle task to update readme with the current version.
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 correctly updated on master
, but it seems we forgot to merge this change on develop
. But you are right, this would be an improvement.
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.
I will add idea for Gradle task to the list
@@ -1,5 +1,5 @@ | |||
distributionBase=GRADLE_USER_HOME | |||
distributionPath=wrapper/dists | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip |
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.
8.7 is the latest one, what is the reason to not use that one?
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.
AGP assistant put this one. I will update it to the latest one.
@@ -1,6 +1,5 @@ | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |||
xmlns:tools="http://schemas.android.com/tools" | |||
package="com.infinum.sentinel" |
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.
We can set the namespace
in build.gradle files.
@@ -10,6 +10,6 @@ import org.junit.runners.Suite.SuiteClasses | |||
DeviceCollectorTestSuite::class, | |||
ApplicationCollectorTests::class, | |||
PermissionsCollectorTests::class, | |||
PreferencesCollectorTests::class | |||
// PreferencesCollectorTests::class |
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.
Why is this commented out?
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 seems that tests haven't been maintained in a while or some changes were added, I am not in loop. For now I just commented out the problems with them since I don't think I will manage to fix them until Monday. Obviously it won't stay like this, but for now I can't do much since I have project expectations.
I don't want to delete anything since all these tests must pass written conditions once we find time to fix them (soon). I am waiting for Karlo's advice for further steps.
Same for all other comments.
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.
Yeah, tests are causing a lot of issues, compiling sentinel (not sample app) seems to throw errors because of tests.
Some test logic was thrown out a couple of versions ago.
I definitely see values in test, but if they are blocking us we would either need to comment them out (and fix them at later point) or simply remove them
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.filters.SmallTest | ||
import com.infinum.sentinel.data.models.raw.DeviceData | ||
//import com.infinum.sentinel.data.sources.raw.formatters.XmlStringBuilderTests |
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.
Remove
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.filters.SmallTest | ||
import com.infinum.sentinel.data.models.raw.DeviceData | ||
//import com.infinum.sentinel.data.sources.raw.formatters.XmlStringBuilderTests |
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.
Run through the project and remove unused imports please
//@RunWith(Suite::class) | ||
//@SuiteClasses( | ||
// PlainStringBuilderTests::class, | ||
// MarkdownStringBuilderTests::class, | ||
// JsonStringBuilderTests::class, | ||
// XmlStringBuilderTests::class, | ||
// HtmlStringBuilderTests::class | ||
//) | ||
//public class FormattersTestSuite |
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.
What is the reason for removing quite many test classes?
plugins { | ||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' | ||
} | ||
|
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.
What is a problem with the toolchains?
@@ -10,6 +10,6 @@ import org.junit.runners.Suite.SuiteClasses | |||
DeviceCollectorTestSuite::class, | |||
ApplicationCollectorTests::class, | |||
PermissionsCollectorTests::class, | |||
PreferencesCollectorTests::class | |||
// PreferencesCollectorTests::class |
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.
Yeah, tests are causing a lot of issues, compiling sentinel (not sample app) seems to throw errors because of tests.
Some test logic was thrown out a couple of versions ago.
I definitely see values in test, but if they are blocking us we would either need to comment them out (and fix them at later point) or simply remove them
@@ -18,7 +18,7 @@ | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:minHeight="?attr/actionBarSize" | |||
app:menu="@menu/sentinel_bundle_monitor" | |||
app:menu="@menu/sentinel_bundle_monitor_menu" |
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.
Nice
tool-dbinspector/build.gradle
Outdated
compileOptions { | ||
coreLibraryDesugaringEnabled true | ||
} |
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.
I see you added desugaring to each module.
I might be wrong, but it is not only needed for modules that depend on modules that use desugaring (sentinel module, sample app module and timber module?)?
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.
I will take a look at this
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.
Yeah best to recheck if you can but compiler was complaining about desugaring not being enabled in every module.
It seems that CR will fail because of one module using dependency on library from remote repo (new version is not available on remote repo) |
I see your point, but I think 90% of issues are test related. If we remove test we should be fine. |
I see resource changes are all related to Sentinel module. So if we downgrade Sentinel version in But, |
You can publish and check the pom.xml file to see what version of a dependency is referenced. Referencing the old Sentinel module is wrong because anyone adding only some tool dependency will get the old version. I guess the idea with this setup was to:
|
…num/android-sentinel into update-dependencies-04-2024
Quick fix of tests
Only modules that depend on modules that have desugaring enabled should have it
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.
Not everything is the best solution (test, need for clients to add desugaring), but for intermediate fix version it will do the job
Quality Gate passedIssues Measures |
📷 Screenshots
No images, but tested this on sample app and some project, no more crashes.
📄 Context
After upgrading AGP to 8.3 a problem appeared with resources sharing the same name, in this case it was menu and string resources. This will happen on all projects that are upgrading and either using this lib or having that problem themselves.
📝 Changes
First of all, resources with same name have been renamed so that is out of way. Next, we used the chance to also bump dependencies.
Desugaring has become somewhat MUST HAVE so I included it in every place compiler was complaining.
In
settings.gradle
you can see a few optional changes and I commented the reason behind them.In
config.gradle
I changed version of sentinel as I was deploying and testing this locally. We should probably return that to1.3.2
, not sure how deployment works.Tests are failing miserably 😄 . For now, I did something called
Pro Developer Move
and commented out those failing but when we align on priorities, we can start fixing them. I saw that you used a different approach for this inbuild.gradle
but I couldn't compile it.📎 Related PR
🚫 Breaking
🛠️ How to test
To test this you have to comment out
signing{...}
in allpublish.gradle
files and then run./gradlew publishReleasePublicationToMavenLocal
. I coudn't test this otherwise because I think that duplicated resources are part of last maven deployment.⏱️ Next steps
We need to align on priorities between fixing tests and removal of desugaring. It seems Chucker also demands desugaring so we might not be able to do this though. Also, toml needs to be included in
build.gradle(:sentinel)
.