Externalise EV3Dev constants to offer support for multiple EV3Dev Distros (Jessie & Stretch) #443
Comments
|
This might be done using Jigsaw and service providers. |
|
Yes, but I was thinking in the properties to have support for jessie and stretch. Example: Jessie: Stretch: Using 2 property files it is possible to load the right properties: Related question here:
|
|
Reviewing the UML design the right class candidate to add a new method The new method could return:
The possible values will be stored in a Enum If the class doesn´t detect one of the distro will raise a RuntimeException. |
|
I have disabled some tests because static methods has a similar behaviour than a Singleton object.
It is necessary to know, how to reset a static method or field. (Reflection problem) |
|
It is necessary to identify the changes between Jessie Support & Stretch Support. Base code:
Fake objects:
Some tests:
|
|
I will continue with the changes. |
|
Added changes. |
|
Pending testing with all platforms and 2 versions. (Debian Jessie & Debian Stretch) |
|
It is necessary to review some classes that raises some exceptions in Travis. |
# Conflicts: # src/main/java/ev3dev/hardware/EV3DevPlatforms.java # src/test/java/fake_ev3dev/BaseElement.java
|
Added support. |
|
Finally, the library in the last version only support Debian Stretch. Doesn't any value to maintain 2 distros. |
# Conflicts: # build.gradle # docs/uml/graph.dot # docs/uml/graph.png # src/main/java/ev3dev/actuators/LCD.java # src/main/java/ev3dev/hardware/EV3DevDistros.java # src/main/java/ev3dev/hardware/EV3DevPlatforms.java # src/main/java/ev3dev/sensors/Battery.java # src/main/java/ev3dev/utils/Brickman.java # src/test/java/ev3dev/utils/SysfsTest.java
# Conflicts: # docs/uml/graph.dot # docs/uml/graph.png
Currently, the main library has support for
Debian JessieandDebian StretchforEV3Devbut the support is stored in 2 different Git Branches. It is necessary to unify to minimize the effort to maintain.Analyzing the changes in the library, you observe the number of changes are not huge so, it is possible to find a good solution with not so much effort.
It is necessary to find that solution.
The text was updated successfully, but these errors were encountered: