Upgrading to a new ev3dev library version - ev3dev-python-tools/ev3dev2simulator GitHub Wiki
The simulator allows code that is written for the original ev3dev2 API to run on a computer without requiring changes. If developers would like to create a new simulator version that works with a newer version of the ev3dev2 APi, the steps written down below can be used as a guideline.
First, the changes of the code with respect to the original repository need to be found. As the original API can found on Github: original ev3dev library, the best way is to fork the original ev3dev library, create a branch with the current version of the ev3dev API used in the simulator, change the ev3dev folder with the ev3dev folder from the simulator and add the connectors that can be found in this repository. The newly created branch now contains a commit that adds the changed needed to make the original version work with the simulator.
Secondly, we would like to add these changes, the ones required to make the ev3dev API work with the simulator, to a different version of the ev3dev API. The git command 'rebase' can replay commits onto a different branch. Hence, create a new branch from the branch that was created in the first step, for example with git checkout -b fake-<new version ev3dev API>
. On this new branch, execute the command git rebase -i tags/<desired version>
. This replays our commit(s) with the changes on the desired version of the ev3dev library, one commit at a time. It might be required to fix merge issues, because the changes cannot be automatically applied by git.
Afterwards run the unit and system test to determine if there are manual changed required to let the simulator work. An example of a fork that has applied these changes is this example repository. If it is desired to keep all code in one repository, the ev3dev folder could be manually copied to a branch of the simulator repository. Otherwise, it might also be an option to use a separate repository for the ev3dev API made for the simulator.