-
Notifications
You must be signed in to change notification settings - Fork 5
Conversation
README.md
Outdated
strictMode = false // activate/deactivate strict mode (optional, defaults to true) | ||
strictMode = false // activate/deactivate strict mode (defaults to true) | ||
androidTest = true // enables pickle on androidTest (defaults to true) | ||
unitTest = true // enables pickle on unit tests (defaults to false) |
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.
Out of scope but I have some feedback about this.
People generally tend to copy paste what they saw. When we first implementing, we just copy pasted here and that means strictMode
was false. We couldn't figure out what's wrong since no tests were generated. (We had missing steps).
I think it is a good idea to keep the example to defaults even though you say defaults to false
next.
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'll do it now cause it's a very good point d3e33eb
project.plugins.all { | ||
when (it) { | ||
project.plugins.all { plugin -> | ||
when (plugin) { | ||
is LibraryPlugin -> { | ||
project.extensions.findByType(LibraryExtension::class.java)?.run { |
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 wonder if you can do
project.extensions.findByType(TestedExtension::class.java)?.run {
here?
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 will enable us to merge 2 branches. And also probably will support other plugins like instant-apps
, dynamic-delivery
etc.
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.
Good point but it requires a bit more testing, I'll open an issue
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.
Definitely makes sense
ac8dfd0
to
26f27e9
Compare
@@ -151,7 +183,7 @@ class PicklePlugin : Plugin<Project> { | |||
* | |||
* Remove this when we want to only support Android Gradle Plugin 3.3 and above. | |||
*/ | |||
private fun setupDependency(task: GenerateTask, variant: TestVariant) { | |||
private fun setupDependency(task: GenerateTask, variant: BaseVariant) { |
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.
Since this is called for both tasks, accessing mergeAssets
causes
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property mergeAssetsTask has not been initialized
The dependency should be different for unit tests.
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.
You're very right 🤦♂️ my bad, forgot about this one
I've tested this with our project. I had lots of other problems with Robolectric but that is out of scope. This seems to work perfectly. 👍 It was able to generate code for unit tests. I have a suggestion for the extension. What about something like below:
|
@tasomaniac do you mean
? |
Exactly 👍 It is just an idea. |
It does sound good! I'll give it a try this weekend 👍 |
No description provided.