RedJocker / fix-PhotoEditor

0 stars 0 forks source link

Common TestUtils #17

Closed Miha-x64 closed 2 years ago

Miha-x64 commented 2 years ago

I've made an attempt to generalize TestUtils. NB: neither the original project nor this one build successfully on my machine.

RedJocker commented 2 years ago

you were having building problems with the original project? Which system are you using?

There's some work being done to make a default configuration for gradle that is going to make easier to update dependency variables for all projects, but also currently android track does not have a good gradle configuration so we are trying to fix that and the work is going forward. You can see it on trello Project creation -> todo -> Update the hs-gradle-plugin for Android. Take a look there and you probably find the way to fix the build. If you are not on osx then it's is very likely that you will have to update the androidGradleVersion to "7.0.2" and then you will have to update the gradle itself to "7.0.2", but, if you try to update the gradle by setting the gradle version in the gradle.build file, then the first run might probably have gradle "6.8" and that conflicts with androidGradle being set to "7.0.2". So what we are doing is set the androidGradle version conditionally to take in account that the first run might be with "6.8" which requires androidGradle to be "4.0.2" and if the gradle is "7.0.2" then we set androidGradle to "7.0.2"

For this project specifically whomever set this up did some extra fancy work to put all dependencies in a dependencies.gradle and then one more layer of indirection to take them from a gradle.properties. With the work we are doing these version are going to come all from github though a plugin so we will endup changing the current gradle for this project. But I guess we better make a fix without the "taking variables from github though a plugin" that is going to be done in the future.

Miha-x64 commented 2 years ago

I'm on Ubuntu. I've tried Gradle 7.2 (because I use it everywhere) but was unaware that there's a variable with Gradle version somewhere except gradle-wrapper.properties. The errors were about absent AndroidManifest.xml in all test modules.

RedJocker commented 2 years ago

on build.gradle (project) change this classpath 'com.android.tools.build:gradle:4.2.2' to this classpath 'com.android.tools.build:gradle:7.0.2' if you are already using gradle above 7.0.2 i'm guessing this will already work

RedJocker commented 2 years ago

hi, your the idea of a shared code module has been adopted. I'm closing this without merging because there were a lot of changes done to make this work.