Source file package structure changes #1780
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the working draft for cleaning app and re-organizing the source code files in this project. The main motivation behind this is to make it easier both for me and for new/existing contributors to find around in this rather big code base. Below are the main changes in the structure and naming.
Java source directory name
Previously, all source files where stored in
app/src/main/java/
. Now the source files are stored inapp/src/main/kotlin/
. This is rather a symbolic move but indicates once more that this project is written in Kotlin and not Java.Top-level packages within
dev.patrickgold.florisboard
Previously, FlorisBoard's top-level structure looked like this:
![image](https://user-images.githubusercontent.com/19412843/162843563-392bf3b0-9060-45af-884d-8af56b4da67e.png)
The main pain points of that were, that it is extremely unorganized, and components were used criss-cross all over the place. Now there are exactly 3 top-level packages:
app
andime
and which is somewhat self-contained.Above three points is what it should be, note though that there may be some exceptions and also some old relics, which have not been cleaned up yet. This is what the future version's dev cycle 0.4.0 will continue to fix, especially within the
ime
package.The three files for the services and the application will remain where they were, because it makes most sense as those are the main entry point to the app's logic.
But what about the git history for source code?
I have made sure to move around the files in the least destructive way so the git diff would indicate the file has actually been moved and not deleted/re-created in another place. This means git blame will, excluding the import section of each file, show the correct commit before this structure change associated with each line of source.
Impact for this project
Like said above, re-organizing this project is important for having a cleaner code base in the future. Also doing the work now is much effort, but it would be even more if I had to do it with an even bigger and messier code base if I waited longer. For the "normal" end user nothing will change, except a hyperlink to a source file may be broken. Within this project's scope I will ensure that all links will be fixed, external links may still break though.