Would be preferable to move the methods of the same classes or just use different classes for each flavor/variant?

32 Views Asked by At

Basically at the moment I have two apps (two projects), one for a root version and one for a rootless version, in which I have classes with the same name but with different methods. Even though one of source directories is not marked as source set (since I am trying to unify the projects into one by using different flavors) I was able to build the two variants successfully.

Now I would like to ask you: would be preferable to move the methods of the same classes or just use different classes for each flavor/variant?

For instance:

In project #1 com.example.root.MyClass has method1() and method2() that are needed for the root version of my app.

In project #2 com.example.rootless.MyClass has method3() and method4() that are needed for the rootless version of my app.

In the unified project with different flavors I would just have com.example.unified.MyClass with method1(), method2(), method3(), method4().

Or would be preferable to still keep those methods separate by putting those classes in different src folders (for each flavor)?

0

There are 0 best solutions below